1.5.0 (latest) 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0

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

Reference documentation and code samples for the Cloud Build v2 API class OAuthCredential.

Represents an OAuth token of the account that authorized the Connection,
and associated metadata.

## Inheritance

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

## Implements

[IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.md.txt)[OAuthCredential](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.OAuthCredential.md.txt), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[OAuthCredential](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.OAuthCredential.md.txt), [IDeepCloneable](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.md.txt)[OAuthCredential](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.OAuthCredential.md.txt), [IBufferMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.md.txt), [IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.md.txt)

## 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.CloudBuild.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.md.txt)

## Assembly

Google.Cloud.CloudBuild.V2.dll

## Constructors

### OAuthCredential()

    public OAuthCredential()

### OAuthCredential(OAuthCredential)

    public OAuthCredential(OAuthCredential other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `OAuthCredential` |

## Properties

### OauthTokenSecretVersion

    public string OauthTokenSecretVersion { get; set; }

A SecretManager resource containing the OAuth token that authorizes
the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### OauthTokenSecretVersionAsSecretVersionName

    public SecretVersionName OauthTokenSecretVersionAsSecretVersionName { get; set; }

[SecretVersionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.SecretVersionName.md.txt)-typed view over the [OauthTokenSecretVersion](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.OAuthCredential.md.txt#Google_Cloud_CloudBuild_V2_OAuthCredential_OauthTokenSecretVersion) resource name
property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `SecretVersionName` |   |

### Username

    public string Username { get; set; }

Output only. The username associated to this token.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |