Struct Teammates

Source
pub struct Teammates {
    pub client: Client,
}

Fields§

§client: Client

Implementations§

Source§

impl Teammates

Source

pub async fn get( &self, limit: u64, offset: u64, ) -> Result<Response<GetTeammatesResponse>, ClientError>

Retrieve all teammates.

This function performs a GET to the /teammates endpoint.

This endpoint allows you to retrieve a list of all current Teammates.

You can limit the number of results returned using the limit query paramater. To return results from a specific Teammate, use the offset paramter. The Response Headers will include pagination info.

Parameters:

  • limit: u64 – Number of items to return.
  • offset: u64 – Paging offset.
  • on_behalf_of: &str – The license key provided with your New Relic account.
Source

pub async fn post( &self, body: &PostTeammatesRequest, ) -> Result<Response<PostTeammatesResponse>, ClientError>

Invite teammate.

This function performs a POST to the /teammates endpoint.

This endpoint allows you to invite a Teammate to your account via email.

You can set a Teammate’s initial permissions using the scopes array in the request body. Teammate’s will receive a minimum set of scopes from Twilio SendGrid that are necessary for the Teammate to function.

Note: A teammate invite will expire after 7 days, but you may resend the invitation at any time to reset the expiration date.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.
Source

pub async fn post_pending_token_resend( &self, token: &str, ) -> Result<Response<PostTeammatesResponse>, ClientError>

Resend teammate invite.

This function performs a POST to the /teammates/pending/{token}/resend endpoint.

This endpoint allows you to resend a Teammate invitation.

Teammate invitations will expire after 7 days. Resending an invitation will reset the expiration date.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.
Source

pub async fn get_scopes_requests( &self, limit: i64, offset: i64, ) -> Result<Response<Vec<GetScopesRequestsResponse>>, ClientError>

Retrieve access requests.

This function performs a GET to the /scopes/requests endpoint.

This endpoint allows you to retrieve a list of all recent access requests.

The Response Header’s link parameter will include pagination info.

Parameters:

  • limit: i64 – Optional field to limit the number of results returned.
  • offset: i64 – Optional beginning point in the list to retrieve from.
Source

pub async fn get_all_scopes_requests( &self, offset: i64, ) -> Result<Response<Vec<GetScopesRequestsResponse>>, ClientError>

Retrieve access requests.

This function performs a GET to the /scopes/requests endpoint.

As opposed to get_scopes_requests, this function returns all the pages of the request at once.

This endpoint allows you to retrieve a list of all recent access requests.

The Response Header’s link parameter will include pagination info.

Source

pub async fn get_pending( &self, ) -> Result<Response<GetTeammatesPendingResponse>, ClientError>

Retrieve all pending teammates.

This function performs a GET to the /teammates/pending endpoint.

This endpoint allows you to retrieve a list of all pending Teammate invitations.

Each teammate invitation is valid for 7 days. Users may resend the invitation to refresh the expiration date.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.
Source

pub async fn get_username( &self, username: &str, ) -> Result<Response<GetTeammatesUsernameResponse>, ClientError>

Retrieve specific teammate.

This function performs a GET to the /teammates/{username} endpoint.

This endpoint allows you to retrieve a specific Teammate by username.

You can retrieve the username’s for each of your Teammates using the “Retrieve all Teammates” endpoint.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.
Source

pub async fn delete_username( &self, username: &str, ) -> Result<Response<PostSendersResponse>, ClientError>

Delete teammate.

This function performs a DELETE to the /teammates/{username} endpoint.

This endpoint allows you to delete a teammate.

Only the parent user or an admin teammate can delete another teammate.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.
Source

pub async fn patch_username( &self, username: &str, body: &PatchTeammatesUsernameRequest, ) -> Result<Response<GetTeammatesUsernameResponse>, ClientError>

Update teammate’s permissions.

This function performs a PATCH to the /teammates/{username} endpoint.

This endpoint allows you to update a teammate’s permissions.

To turn a teammate into an admin, the request body should contain an is_admin set to true. Otherwise, set is_admin to false and pass in all the scopes that a teammate should have.

Only the parent user or other admin teammates can update another teammate’s permissions.

Admin users can only update permissions.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.
Source

pub async fn patch_scopes_requests_approve( &self, request_id: &str, ) -> Result<Response<PatchScopesRequestsApproveResponse>, ClientError>

Approve access request.

This function performs a PATCH to the /scopes/requests/{request_id}/approve endpoint.

This endpoint allows you to approve an access attempt.

Note: Only teammate admins may approve another teammate’s access request.

Source

pub async fn delete_scopes_requests_request( &self, request_id: &str, ) -> Result<Response<()>, ClientError>

Deny access request.

This function performs a DELETE to the /scopes/requests/{request_id} endpoint.

This endpoint allows you to deny an attempt to access your account.

Note: Only teammate admins may delete a teammate’s access request.

Source

pub async fn delete_pending_token( &self, token: &str, ) -> Result<Response<()>, ClientError>

Delete pending teammate.

This function performs a DELETE to the /teammates/pending/{token} endpoint.

This endpoint allows you to delete a pending teammate invite.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,