# IAM Service Account Credentials v1 API - Class GenerateAccessTokenRequest (2.5.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.5.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/latest/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/2.4.0/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/2.3.0/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/2.2.0/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/2.1.0/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/2.0.0/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/1.2.0/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/1.1.0/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/1.0.0/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest)

    public sealed class GenerateAccessTokenRequest : IMessage<GenerateAccessTokenRequest>, IEquatable<GenerateAccessTokenRequest>, IDeepCloneable<GenerateAccessTokenRequest>, IBufferMessage, IMessage

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> GenerateAccessTokenRequest

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[GenerateAccessTokenRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/latest/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[GenerateAccessTokenRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/latest/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[GenerateAccessTokenRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/latest/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Iam.Credentials.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/latest/Google.Cloud.Iam.Credentials.V1)

## Assembly

Google.Cloud.Iam.Credentials.V1.dll

## Constructors

### GenerateAccessTokenRequest()

    public GenerateAccessTokenRequest()

### GenerateAccessTokenRequest(GenerateAccessTokenRequest)

    public GenerateAccessTokenRequest(GenerateAccessTokenRequest other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/latest/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest` |

## Properties

### Delegates

    public RepeatedField<string> Delegates { get; }

The sequence of service accounts in a delegation chain. Each service
account must be granted the `roles/iam.serviceAccountTokenCreator` role
on its next service account in the chain. The last service account in the
chain must be granted the `roles/iam.serviceAccountTokenCreator` role
on the service account that is specified in the `name` field of the
request.

The delegates must have the following format:
`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
character is required; replacing it with a project ID is invalid.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### Lifetime

    public Duration Lifetime { get; set; }

The desired lifetime duration of the access token in seconds.
Must be set to a value less than or equal to 3600 (1 hour). If a value is
not specified, the token's lifetime will be set to a default value of one
hour.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Duration.html` |   |

### Name

    public string Name { get; set; }

Required. The resource name of the service account for which the credentials
are requested, in the following format:
`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
character is required; replacing it with a project ID is invalid.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Scope

    public RepeatedField<string> Scope { get; }

Required. Code to identify the scopes to be included in the OAuth 2.0 access token.
See <https://developers.google.com/identity/protocols/googlescopes> for more
information.
At least one value required.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### ServiceAccountName

    public ServiceAccountName ServiceAccountName { get; set; }

[ServiceAccountName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/latest/Google.Cloud.Iam.Credentials.V1.ServiceAccountName)-typed view over the [Name](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/latest/Google.Cloud.Iam.Credentials.V1.GenerateAccessTokenRequest#Google_Cloud_Iam_Credentials_V1_GenerateAccessTokenRequest_Name) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Credentials.V1/latest/Google.Cloud.Iam.Credentials.V1.ServiceAccountName` |   |