Class OrganizationsClient
- Namespace
- Auth0.ManagementApi.Clients
- Assembly
- Auth0.ManagementApi.dll
public class OrganizationsClient : BaseClient, IOrganizationsClient
- Inheritance
-
OrganizationsClient
- Implements
- Inherited Members
Constructors
OrganizationsClient(IManagementConnection, Uri, IDictionary<string, string>)
Initializes a new instance of ClientsClient.
public OrganizationsClient(IManagementConnection connection, Uri baseUri, IDictionary<string, string> defaultHeaders)
Parameters
connection
IManagementConnectionIManagementConnection used to make all API calls.
baseUri
UriUri of the endpoint to use in making API calls.
defaultHeaders
IDictionary<string, string>Dictionary containing default headers included with every request this client makes.
Methods
AddMemberRolesAsync(string, string, OrganizationAddMemberRolesRequest, CancellationToken)
Add members to an organization.
public Task AddMemberRolesAsync(string organizationId, string userId, OrganizationAddMemberRolesRequest request, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to add roles to the given user.
userId
stringThe id of the user for which you want to add roles.
request
OrganizationAddMemberRolesRequestThe OrganizationAddMemberRolesRequest containing the roles.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
AddMembersAsync(string, OrganizationAddMembersRequest, CancellationToken)
Add members to an organization.
public Task AddMembersAsync(string organizationId, OrganizationAddMembersRequest request, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to add members.
request
OrganizationAddMembersRequestThe OrganizationAddMembersRequest containing the members.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
CreateAsync(OrganizationCreateRequest, CancellationToken)
Creates a new organization.
public Task<Organization> CreateAsync(OrganizationCreateRequest request, CancellationToken cancellationToken = default)
Parameters
request
OrganizationCreateRequestThe OrganizationCreateRequest containing the properties of the new organization.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<Organization>
The new Organization that has been created.
CreateClientGrantAsync(string, OrganizationCreateClientGrantRequest, CancellationToken)
Associate a client grant with an organization
public Task<OrganizationClientGrant> CreateClientGrantAsync(string organizationId, OrganizationCreateClientGrantRequest request, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization to which you want to associate the client grants.
request
OrganizationCreateClientGrantRequestThe OrganizationCreateClientGrantRequest containing the properties of the Client Grant to associate with the organization.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<OrganizationClientGrant>
The new ClientGrant that has been created.
CreateConnectionAsync(string, OrganizationConnectionCreateRequest, CancellationToken)
Creates a new organization connection.
public Task<OrganizationConnection> CreateConnectionAsync(string organizationId, OrganizationConnectionCreateRequest request, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to add the connection.
request
OrganizationConnectionCreateRequestThe OrganizationConnectionCreateRequest containing the properties of the new organization connection.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<OrganizationConnection>
The new OrganizationConnection that has been created.
CreateInvitationAsync(string, OrganizationCreateInvitationRequest, CancellationToken)
Creates a new organization invitation.
public Task<OrganizationInvitation> CreateInvitationAsync(string organizationId, OrganizationCreateInvitationRequest request, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization to which you want to invite a user.
request
OrganizationCreateInvitationRequestThe OrganizationCreateInvitationRequest containing the properties of the new organization invitation.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<OrganizationInvitation>
The new OrganizationInvitation that has been created.
DeleteAsync(string, CancellationToken)
Deletes an organization.
public Task DeleteAsync(string id, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the organization to delete.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
DeleteClientGrantAsync(string, string, CancellationToken)
Remove a client grant from an organization.
public Task DeleteClientGrantAsync(string organizationId, string clientGrantId, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to delete the client grant.
clientGrantId
stringThe id of the client grant you want to delete from the organization
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
DeleteConnectionAsync(string, string, CancellationToken)
Deletes an organization connection.
public Task DeleteConnectionAsync(string organizationId, string connectionId, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to delete the connection.
connectionId
stringThe id of the connection to delete from the organization.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
DeleteInvitationAsync(string, string, CancellationToken)
Deletes an organization invitation.
public Task DeleteInvitationAsync(string organizationId, string invitationId, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to delete the invitation.
invitationId
stringThe id of the invitation you want to remove.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
DeleteMemberAsync(string, OrganizationDeleteMembersRequest, CancellationToken)
Deletes members from an organization.
public Task DeleteMemberAsync(string organizationId, OrganizationDeleteMembersRequest request, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to delete the members.
request
OrganizationDeleteMembersRequestThe OrganizationDeleteMembersRequest containing the members.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
DeleteMemberRolesAsync(string, string, OrganizationDeleteMemberRolesRequest, CancellationToken)
Deletes roles from an organization member.
public Task DeleteMemberRolesAsync(string organizationId, string userId, OrganizationDeleteMemberRolesRequest request, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to delete roles for a given user.
userId
stringThe id of the user for which you want to remove roles.
request
OrganizationDeleteMemberRolesRequestThe OrganizationDeleteMemberRolesRequest containing the roles.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
GetAllAsync(CheckpointPaginationInfo, CancellationToken)
Retrieves a list of all organizations using checkpoint pagination
.
public Task<ICheckpointPagedList<Organization>> GetAllAsync(CheckpointPaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
pagination
CheckpointPaginationInfoSpecifies CheckpointPaginationInfo to use in requesting checkpoint-paginated results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<ICheckpointPagedList<Organization>>
An ICheckpointPagedList<T> containing the organizations.
GetAllAsync(PaginationInfo, CancellationToken)
Retrieves a list of all organizations.
public Task<IPagedList<Organization>> GetAllAsync(PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<Organization>>
An IPagedList<T> containing the organizations.
GetAllClientGrantsAsync(string, OrganizationGetClientGrantsRequest, PaginationInfo, CancellationToken)
Get client grants associated to an organization.
public Task<IPagedList<OrganizationClientGrant>> GetAllClientGrantsAsync(string organizationId, OrganizationGetClientGrantsRequest request, PaginationInfo pagination = null, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to retrieve the client grants.
request
OrganizationGetClientGrantsRequestSpecifies criteria to use when querying client grants for the organization.
pagination
PaginationInfoSpecifies PaginationInfo to use in requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<OrganizationClientGrant>>
A IPagedList<T> containing the client grants requested.
GetAllConnectionsAsync(string, PaginationInfo, CancellationToken)
Retrieves a list of all organization connections.
public Task<IPagedList<OrganizationConnection>> GetAllConnectionsAsync(string organizationId, PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe ID of the organization for which you want to retrieve the connections.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<OrganizationConnection>>
An IPagedList<T> containing the organization connections.
GetAllInvitationsAsync(string, OrganizationGetAllInvitationsRequest, PaginationInfo, CancellationToken)
Retrieves a list of all organization invitations.
public Task<IPagedList<OrganizationInvitation>> GetAllInvitationsAsync(string organizationId, OrganizationGetAllInvitationsRequest request, PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to retrieve the invitations.
request
OrganizationGetAllInvitationsRequestThe OrganizationGetAllInvitationsRequest containing the properties to retrieve the organization invitations.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<OrganizationInvitation>>
An IPagedList<T> containing the organization members.
GetAllMemberRolesAsync(string, string, PaginationInfo, CancellationToken)
Retrieves a list of all roles for an organization members.
public Task<IPagedList<Role>> GetAllMemberRolesAsync(string organizationId, string userId, PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to retrieve the roles for a given user.
userId
stringThe id of the user for which you want to retrieve the roles.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<Role>>
An IPagedList<T> containing the organization members.
GetAllMembersAsync(string, OrganizationGetAllMembersRequest, CheckpointPaginationInfo, CancellationToken)
Retrieves a list of all organization members using checkpoint pagination
.
public Task<ICheckpointPagedList<OrganizationMember>> GetAllMembersAsync(string organizationId, OrganizationGetAllMembersRequest request, CheckpointPaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe ID of the organization for which you want to retrieve the members.
request
OrganizationGetAllMembersRequestSpecifies criteria to use when querying organization members.
pagination
CheckpointPaginationInfoSpecifies CheckpointPaginationInfo to use in requesting checkpoint-paginated results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<ICheckpointPagedList<OrganizationMember>>
An ICheckpointPagedList<T> containing the organization members.
GetAllMembersAsync(string, OrganizationGetAllMembersRequest, PaginationInfo, CancellationToken)
Retrieves a list of all organization members.
public Task<IPagedList<OrganizationMember>> GetAllMembersAsync(string organizationId, OrganizationGetAllMembersRequest request, PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe ID of the organization for which you want to retrieve the members.
request
OrganizationGetAllMembersRequestSpecifies criteria to use when querying organization members.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<OrganizationMember>>
An IPagedList<T> containing the organization members.
GetAllMembersAsync(string, CheckpointPaginationInfo, CancellationToken)
Retrieves a list of all organization members using checkpoint pagination
.
public Task<ICheckpointPagedList<OrganizationMember>> GetAllMembersAsync(string organizationId, CheckpointPaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe ID of the organization for which you want to retrieve the members.
pagination
CheckpointPaginationInfoSpecifies CheckpointPaginationInfo to use in requesting checkpoint-paginated results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<ICheckpointPagedList<OrganizationMember>>
An ICheckpointPagedList<T> containing the organization members.
GetAllMembersAsync(string, PaginationInfo, CancellationToken)
Retrieves a list of all organization members.
public Task<IPagedList<OrganizationMember>> GetAllMembersAsync(string organizationId, PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe ID of the organization for which you want to retrieve the members.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<OrganizationMember>>
An IPagedList<T> containing the organization members.
GetAsync(string, CancellationToken)
Retrieves an organization by its id.
public Task<Organization> GetAsync(string id, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the organization to retrieve.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<Organization>
The Organization retrieved.
GetByNameAsync(string, CancellationToken)
Retrieves an organization by its name.
public Task<Organization> GetByNameAsync(string name, CancellationToken cancellationToken = default)
Parameters
name
stringThe name of the organization to retrieve.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<Organization>
The Organization retrieved.
GetConnectionAsync(string, string, CancellationToken)
Retrieves an organization connection by its id.
public Task<OrganizationConnection> GetConnectionAsync(string organizationId, string connectionId, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to retrieve the connection.
connectionId
stringThe id of the connection to retrieve.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<OrganizationConnection>
The OrganizationConnection retrieved.
GetInvitationAsync(string, string, OrganizationGetInvitationRequest, CancellationToken)
Retrieves an organization invitation by its id.
public Task<OrganizationInvitation> GetInvitationAsync(string organizationId, string invitationId, OrganizationGetInvitationRequest request, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to retrieve the invitation.
invitationId
stringThe id of the organization invitation to retrieve.
request
OrganizationGetInvitationRequestThe OrganizationGetInvitationRequest containing the properties to retrieve the organization invitation.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<OrganizationInvitation>
The OrganizationInvitation retrieved.
UpdateAsync(string, OrganizationUpdateRequest, CancellationToken)
Updates an organization.
public Task<Organization> UpdateAsync(string id, OrganizationUpdateRequest request, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the organization you want to update.
request
OrganizationUpdateRequestThe OrganizationUpdateRequest containing the properties of the organization you want to update.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<Organization>
The Organization that was updated.
UpdateConnectionAsync(string, string, OrganizationConnectionUpdateRequest, CancellationToken)
Updates an organization connection.
public Task<OrganizationConnection> UpdateConnectionAsync(string organizationId, string connectionId, OrganizationConnectionUpdateRequest request, CancellationToken cancellationToken = default)
Parameters
organizationId
stringThe id of the organization for which you want to update the connection.
connectionId
stringThe id of the connection you want to update for the organization.
request
OrganizationConnectionUpdateRequestThe OrganizationConnectionUpdateRequest containing the properties of the organization connection you want to update.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<OrganizationConnection>
The OrganizationConnection that was updated.