pub struct ServiceAccountClient { /* private fields */ }Expand description
Calls ServiceAccountService.
Service accounts: an organization’s identities for software, which never
log in interactively. A new service account holds no role: grant it one
with a role binding on its member. Software with an OIDC token of its
own, such as a CI job, acts as a service_account::Type::Workload service account through a
federated credential (FederatedCredentialService). Software with none,
such as a job on a server of your own, acts as an service_account::Type::External one with a
key (ServiceAccountKeyService). Either is exchanged at
<https://sts.origincloudapis.eu> for the service account’s access token.
Implementations§
Source§impl ServiceAccountClient
impl ServiceAccountClient
Sourcepub fn new(client: &Client) -> Self
pub fn new(client: &Client) -> Self
Returns a client of ServiceAccountService that sends its calls through client.
Sourcepub fn service(&self) -> &Service
pub fn service(&self) -> &Service
The endpoint the client sends its calls to, which also serves the operations its methods answer with.
Sourcepub fn with_options(&self, options: CallOptions) -> Self
pub fn with_options(&self, options: CallOptions) -> Self
The same client, whose calls are sent as options says instead of as the Client’s settings do, such as a mutation that must not be sent twice: .with_options(CallOptions::new().max_attempts(1)). See CallOptions.
Sourcepub async fn get_service_account(
&self,
request: GetServiceAccountRequest,
) -> Result<ServiceAccount, Error>
pub async fn get_service_account( &self, request: GetServiceAccountRequest, ) -> Result<ServiceAccount, Error>
Returns a service account, deleted or not. Needs
iam.service_account.list on the organization.
Sourcepub async fn list_service_accounts(
&self,
request: ListServiceAccountsRequest,
) -> Result<ListServiceAccountsResponse, Error>
pub async fn list_service_accounts( &self, request: ListServiceAccountsRequest, ) -> Result<ListServiceAccountsResponse, Error>
Lists an organization’s service accounts, oldest first. Deleted ones
are listed only when show_deleted is set. Needs
iam.service_account.list on the organization.
Sourcepub fn all_service_accounts(
&self,
request: ListServiceAccountsRequest,
) -> Pages<ServiceAccount>
pub fn all_service_accounts( &self, request: ListServiceAccountsRequest, ) -> Pages<ServiceAccount>
Returns everything list_service_accounts lists from request’s page on, fetching the next page as the stream reaches it. A page that fails ends the stream with its error.
Sourcepub async fn create_service_account(
&self,
request: CreateServiceAccountRequest,
) -> Result<ServiceAccount, Error>
pub async fn create_service_account( &self, request: CreateServiceAccountRequest, ) -> Result<ServiceAccount, Error>
Creates a service account. It has no credential yet: give a
service_account::Type::Workload one a federated credential, an service_account::Type::External one a key. Needs
iam.service_account.create on the organization.
Sourcepub async fn delete_service_account(
&self,
request: DeleteServiceAccountRequest,
) -> Result<Empty, Error>
pub async fn delete_service_account( &self, request: DeleteServiceAccountRequest, ) -> Result<Empty, Error>
Deletes a service account for good: its credential is refused from
then on, an access token it already holds is refused on its next
request, and every role binding it holds, in any organization, is
removed. It stays readable as service_account::State::Deleted. Deleting a deleted service
account succeeds. Needs iam.service_account.revoke on the
organization.