pub struct InvitationMethods<'a, C>where
C: 'a,{ /* private fields */ }Expand description
A builder providing access to all methods supported on invitation resources.
It is not used directly, but through the Classroom hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_classroom1 as classroom1;
use classroom1::{Classroom, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
let secret: yup_oauth2::ApplicationSecret = Default::default();
let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http1()
.build()
);
let mut hub = Classroom::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `accept(...)`, `create(...)`, `delete(...)`, `get(...)` and `list(...)`
// to build up your call.
let rb = hub.invitations();Implementations§
Source§impl<'a, C> InvitationMethods<'a, C>
impl<'a, C> InvitationMethods<'a, C>
Sourcepub fn accept(&self, id: &str) -> InvitationAcceptCall<'a, C>
pub fn accept(&self, id: &str) -> InvitationAcceptCall<'a, C>
Create a builder to help you perform the following task:
Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may accept an invitation. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to accept the requested invitation or for access errors. * FAILED_PRECONDITION for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * NOT_FOUND if no invitation exists with the requested ID.
§Arguments
id- Identifier of the invitation to accept.
Sourcepub fn create(&self, request: Invitation) -> InvitationCreateCall<'a, C>
pub fn create(&self, request: Invitation) -> InvitationCreateCall<'a, C>
Create a builder to help you perform the following task:
Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to create invitations for this course or for access errors. * NOT_FOUND if the course or the user does not exist. * FAILED_PRECONDITION: * if the requested user’s account is disabled. * if the user already has this role or a role with greater permissions. * for the following request errors: * IneligibleOwner * ALREADY_EXISTS if an invitation for the specified user and course already exists.
§Arguments
request- No description provided.
Sourcepub fn delete(&self, id: &str) -> InvitationDeleteCall<'a, C>
pub fn delete(&self, id: &str) -> InvitationDeleteCall<'a, C>
Create a builder to help you perform the following task:
Deletes an invitation. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to delete the requested invitation or for access errors. * NOT_FOUND if no invitation exists with the requested ID.
§Arguments
id- Identifier of the invitation to delete.
Sourcepub fn get(&self, id: &str) -> InvitationGetCall<'a, C>
pub fn get(&self, id: &str) -> InvitationGetCall<'a, C>
Create a builder to help you perform the following task:
Returns an invitation. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to view the requested invitation or for access errors. * NOT_FOUND if no invitation exists with the requested ID.
§Arguments
id- Identifier of the invitation to return.
Sourcepub fn list(&self) -> InvitationListCall<'a, C>
pub fn list(&self) -> InvitationListCall<'a, C>
Create a builder to help you perform the following task:
Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. Note: At least one of user_id or course_id must be supplied. Both fields can be supplied. This method returns the following error codes: * PERMISSION_DENIED for access errors.
Trait Implementations§
impl<'a, C> MethodsBuilder for InvitationMethods<'a, C>
Auto Trait Implementations§
impl<'a, C> Freeze for InvitationMethods<'a, C>
impl<'a, C> !RefUnwindSafe for InvitationMethods<'a, C>
impl<'a, C> Send for InvitationMethods<'a, C>where
C: Sync,
impl<'a, C> Sync for InvitationMethods<'a, C>where
C: Sync,
impl<'a, C> Unpin for InvitationMethods<'a, C>
impl<'a, C> !UnwindSafe for InvitationMethods<'a, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more