Show / Hide Table of Contents

Class ProjectsResource.ServiceAccountsResource.KeysResource

The "keys" collection of methods.

Inheritance
object
ProjectsResource.ServiceAccountsResource.KeysResource
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.Iam.v1
Assembly: Google.Apis.Iam.v1.dll
Syntax
public class ProjectsResource.ServiceAccountsResource.KeysResource

Constructors

KeysResource(IClientService)

Constructs a new resource.

Declaration
public KeysResource(IClientService service)
Parameters
Type Name Description
IClientService service

Methods

Create(CreateServiceAccountKeyRequest, string)

Creates a ServiceAccountKey.

Declaration
public virtual ProjectsResource.ServiceAccountsResource.KeysResource.CreateRequest Create(CreateServiceAccountKeyRequest body, string name)
Parameters
Type Name Description
CreateServiceAccountKeyRequest body

The body of the request.

string name

Required. The resource name of the service account. Use one of the following formats: * projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS} * projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID} As an alternative, you can use the - wildcard character instead of the project ID: * projects/-/serviceAccounts/{EMAIL_ADDRESS} * projects/-/serviceAccounts/{UNIQUE_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account projects/-/serviceAccounts/fake@example.com, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

Returns
Type Description
ProjectsResource.ServiceAccountsResource.KeysResource.CreateRequest

Delete(string)

Deletes a ServiceAccountKey. Deleting a service account key does not revoke short-lived credentials that have been issued based on the service account key.

Declaration
public virtual ProjectsResource.ServiceAccountsResource.KeysResource.DeleteRequest Delete(string name)
Parameters
Type Name Description
string name

Required. The resource name of the service account key. Use one of the following formats: * projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} * projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} As an alternative, you can use the - wildcard character instead of the project ID: * projects/-/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} * projects/-/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account key projects/-/serviceAccounts/fake@example.com/keys/fake-key, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

Returns
Type Description
ProjectsResource.ServiceAccountsResource.KeysResource.DeleteRequest

Disable(DisableServiceAccountKeyRequest, string)

Disable a ServiceAccountKey. A disabled service account key can be re-enabled with EnableServiceAccountKey.

Declaration
public virtual ProjectsResource.ServiceAccountsResource.KeysResource.DisableRequest Disable(DisableServiceAccountKeyRequest body, string name)
Parameters
Type Name Description
DisableServiceAccountKeyRequest body

The body of the request.

string name

Required. The resource name of the service account key. Use one of the following formats: * projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} * projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} As an alternative, you can use the - wildcard character instead of the project ID: * projects/-/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} * projects/-/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account key projects/-/serviceAccounts/fake@example.com/keys/fake-key, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

Returns
Type Description
ProjectsResource.ServiceAccountsResource.KeysResource.DisableRequest

Enable(EnableServiceAccountKeyRequest, string)

Enable a ServiceAccountKey.

Declaration
public virtual ProjectsResource.ServiceAccountsResource.KeysResource.EnableRequest Enable(EnableServiceAccountKeyRequest body, string name)
Parameters
Type Name Description
EnableServiceAccountKeyRequest body

The body of the request.

string name

Required. The resource name of the service account key. Use one of the following formats: * projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} * projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} As an alternative, you can use the - wildcard character instead of the project ID: * projects/-/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} * projects/-/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account key projects/-/serviceAccounts/fake@example.com/keys/fake-key, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

Returns
Type Description
ProjectsResource.ServiceAccountsResource.KeysResource.EnableRequest

Get(string)

Gets a ServiceAccountKey.

Declaration
public virtual ProjectsResource.ServiceAccountsResource.KeysResource.GetRequest Get(string name)
Parameters
Type Name Description
string name

Required. The resource name of the service account key. Use one of the following formats: * projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} * projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} As an alternative, you can use the - wildcard character instead of the project ID: * projects/-/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} * projects/-/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account key projects/-/serviceAccounts/fake@example.com/keys/fake-key, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

Returns
Type Description
ProjectsResource.ServiceAccountsResource.KeysResource.GetRequest

List(string)

Lists every ServiceAccountKey for a service account.

Declaration
public virtual ProjectsResource.ServiceAccountsResource.KeysResource.ListRequest List(string name)
Parameters
Type Name Description
string name

Required. The resource name of the service account. Use one of the following formats: * projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS} * projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID} As an alternative, you can use the - wildcard character instead of the project ID: * projects/-/serviceAccounts/{EMAIL_ADDRESS} * projects/-/serviceAccounts/{UNIQUE_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account projects/-/serviceAccounts/fake@example.com, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

Returns
Type Description
ProjectsResource.ServiceAccountsResource.KeysResource.ListRequest

Upload(UploadServiceAccountKeyRequest, string)

Uploads the public key portion of a key pair that you manage, and associates the public key with a ServiceAccount. After you upload the public key, you can use the private key from the key pair as a service account key.

Declaration
public virtual ProjectsResource.ServiceAccountsResource.KeysResource.UploadRequest Upload(UploadServiceAccountKeyRequest body, string name)
Parameters
Type Name Description
UploadServiceAccountKeyRequest body

The body of the request.

string name

The resource name of the service account key. Use one of the following formats: * projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS} * projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID} As an alternative, you can use the - wildcard character instead of the project ID: * projects/-/serviceAccounts/{EMAIL_ADDRESS} * projects/-/serviceAccounts/{UNIQUE_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account projects/-/serviceAccounts/fake@example.com, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

Returns
Type Description
ProjectsResource.ServiceAccountsResource.KeysResource.UploadRequest
In this article
Back to top Generated by DocFX