pub struct Teammates {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Teammates
impl Teammates
Sourcepub async fn get(
&self,
limit: u64,
offset: u64,
) -> Result<Response<GetTeammatesResponse>, ClientError>
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.
Sourcepub async fn post(
&self,
body: &PostTeammatesRequest,
) -> Result<Response<PostTeammatesResponse>, ClientError>
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.
Sourcepub async fn post_pending_token_resend(
&self,
token: &str,
) -> Result<Response<PostTeammatesResponse>, ClientError>
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.
Sourcepub async fn get_scopes_requests(
&self,
limit: i64,
offset: i64,
) -> Result<Response<Vec<GetScopesRequestsResponse>>, ClientError>
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.
Sourcepub async fn get_all_scopes_requests(
&self,
offset: i64,
) -> Result<Response<Vec<GetScopesRequestsResponse>>, ClientError>
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.
Sourcepub async fn get_pending(
&self,
) -> Result<Response<GetTeammatesPendingResponse>, ClientError>
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.
Sourcepub async fn get_username(
&self,
username: &str,
) -> Result<Response<GetTeammatesUsernameResponse>, ClientError>
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.
Sourcepub async fn delete_username(
&self,
username: &str,
) -> Result<Response<PostSendersResponse>, ClientError>
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.
Sourcepub async fn patch_username(
&self,
username: &str,
body: &PatchTeammatesUsernameRequest,
) -> Result<Response<GetTeammatesUsernameResponse>, ClientError>
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.
Sourcepub async fn patch_scopes_requests_approve(
&self,
request_id: &str,
) -> Result<Response<PatchScopesRequestsApproveResponse>, ClientError>
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.
Sourcepub async fn delete_scopes_requests_request(
&self,
request_id: &str,
) -> Result<Response<()>, ClientError>
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.
Sourcepub async fn delete_pending_token(
&self,
token: &str,
) -> Result<Response<()>, ClientError>
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.