# Google Cloud Dialogflow v2 API - Class EncryptionSpecServiceClient (4.30.0)

4.30.0 (latest) 4.29.0 4.28.0 4.27.0 4.26.0 4.25.0 4.24.0 4.23.0 4.22.0 4.21.0 4.20.0 4.19.0 4.18.0 4.17.0 4.16.0 4.15.0 4.14.0 4.13.0 4.12.0 4.11.0 4.10.0 4.9.0 4.8.0 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0

    public abstract class EncryptionSpecServiceClient

Reference documentation and code samples for the Google Cloud Dialogflow v2 API class EncryptionSpecServiceClient.

EncryptionSpecService client wrapper, for convenient use.

## Inheritance

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

## 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.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Derived Types

[EncryptionSpecServiceClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClientImpl)

## Namespace

[Google.Cloud.Dialogflow.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2)

## Assembly

Google.Cloud.Dialogflow.V2.dll

## Remarks

Manages encryption spec settings for Dialogflow and Agent Assist.

## Properties

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the EncryptionSpecService service, which is a host of "dialogflow.googleapis.com"
and a port of 443.

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

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default EncryptionSpecService scopes.

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

**Remarks** The default EncryptionSpecService scopes are:

- <https://www.googleapis.com/auth/cloud-platform>
- <https://www.googleapis.com/auth/dialogflow>

### GrpcClient

    public virtual EncryptionSpecService.EncryptionSpecServiceClient GrpcClient { get; }

The underlying gRPC EncryptionSpecService client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecService.EncryptionSpecServiceClient` |   |

### InitializeEncryptionSpecOperationsClient

    public virtual OperationsClient InitializeEncryptionSpecOperationsClient { get; }

The long-running operations client for `InitializeEncryptionSpec`.

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

### LocationsClient

    public virtual LocationsClient LocationsClient { get; }

The [LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html) associated with this client.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

## Methods

### Create()

    public static EncryptionSpecServiceClient Create()

Synchronously creates a [EncryptionSpecServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClient) using the default credentials, endpoint
and settings. To specify custom credentials or other settings, use
[EncryptionSpecServiceClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClient` | The created [EncryptionSpecServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClient). |

### CreateAsync(CancellationToken)

    public static Task<EncryptionSpecServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a [EncryptionSpecServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClient) using the default credentials, endpoint
and settings. To specify custom credentials or other settings, use
[EncryptionSpecServiceClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClient` | The task representing the created [EncryptionSpecServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClient). |

### GetEncryptionSpec(EncryptionSpecName, CallSettings)

    public virtual EncryptionSpec GetEncryptionSpec(EncryptionSpecName name, CallSettings callSettings = null)

Gets location-level encryption key specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecName` Required. The name of the encryption spec resource to get. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` | The RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = EncryptionSpecServiceClient.Create();
    // Initialize request argument(s)
    EncryptionSpecName name = EncryptionSpecName.FromProjectLocation("[PROJECT]", "[LOCATION]");
    // Make the request
    EncryptionSpec response = encryptionSpecServiceClient.GetEncryptionSpec(name);

### GetEncryptionSpec(GetEncryptionSpecRequest, CallSettings)

    public virtual EncryptionSpec GetEncryptionSpec(GetEncryptionSpecRequest request, CallSettings callSettings = null)

Gets location-level encryption key specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.GetEncryptionSpecRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` | The RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = EncryptionSpecServiceClient.Create();
    // Initialize request argument(s)
    GetEncryptionSpecRequest request = new GetEncryptionSpecRequest
    {
        EncryptionSpecName = EncryptionSpecName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    };
    // Make the request
    EncryptionSpec response = encryptionSpecServiceClient.GetEncryptionSpec(request);

### GetEncryptionSpec(string, CallSettings)

    public virtual EncryptionSpec GetEncryptionSpec(string name, CallSettings callSettings = null)

Gets location-level encryption key specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the encryption spec resource to get. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` | The RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = EncryptionSpecServiceClient.Create();
    // Initialize request argument(s)
    string name = "projects/[PROJECT]/locations/[LOCATION]/encryptionSpec";
    // Make the request
    EncryptionSpec response = encryptionSpecServiceClient.GetEncryptionSpec(name);

### GetEncryptionSpecAsync(EncryptionSpecName, CallSettings)

    public virtual Task<EncryptionSpec> GetEncryptionSpecAsync(EncryptionSpecName name, CallSettings callSettings = null)

Gets location-level encryption key specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecName` Required. The name of the encryption spec resource to get. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` | A Task containing the RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = await EncryptionSpecServiceClient.CreateAsync();
    // Initialize request argument(s)
    EncryptionSpecName name = EncryptionSpecName.FromProjectLocation("[PROJECT]", "[LOCATION]");
    // Make the request
    EncryptionSpec response = await encryptionSpecServiceClient.GetEncryptionSpecAsync(name);

### GetEncryptionSpecAsync(EncryptionSpecName, CancellationToken)

    public virtual Task<EncryptionSpec> GetEncryptionSpecAsync(EncryptionSpecName name, CancellationToken cancellationToken)

Gets location-level encryption key specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecName` Required. The name of the encryption spec resource to get. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` | A Task containing the RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = await EncryptionSpecServiceClient.CreateAsync();
    // Initialize request argument(s)
    EncryptionSpecName name = EncryptionSpecName.FromProjectLocation("[PROJECT]", "[LOCATION]");
    // Make the request
    EncryptionSpec response = await encryptionSpecServiceClient.GetEncryptionSpecAsync(name);

### GetEncryptionSpecAsync(GetEncryptionSpecRequest, CallSettings)

    public virtual Task<EncryptionSpec> GetEncryptionSpecAsync(GetEncryptionSpecRequest request, CallSettings callSettings = null)

Gets location-level encryption key specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.GetEncryptionSpecRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` | A Task containing the RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = await EncryptionSpecServiceClient.CreateAsync();
    // Initialize request argument(s)
    GetEncryptionSpecRequest request = new GetEncryptionSpecRequest
    {
        EncryptionSpecName = EncryptionSpecName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    };
    // Make the request
    EncryptionSpec response = await encryptionSpecServiceClient.GetEncryptionSpecAsync(request);

### GetEncryptionSpecAsync(GetEncryptionSpecRequest, CancellationToken)

    public virtual Task<EncryptionSpec> GetEncryptionSpecAsync(GetEncryptionSpecRequest request, CancellationToken cancellationToken)

Gets location-level encryption key specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.GetEncryptionSpecRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` | A Task containing the RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = await EncryptionSpecServiceClient.CreateAsync();
    // Initialize request argument(s)
    GetEncryptionSpecRequest request = new GetEncryptionSpecRequest
    {
        EncryptionSpecName = EncryptionSpecName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    };
    // Make the request
    EncryptionSpec response = await encryptionSpecServiceClient.GetEncryptionSpecAsync(request);

### GetEncryptionSpecAsync(string, CallSettings)

    public virtual Task<EncryptionSpec> GetEncryptionSpecAsync(string name, CallSettings callSettings = null)

Gets location-level encryption key specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the encryption spec resource to get. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` | A Task containing the RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = await EncryptionSpecServiceClient.CreateAsync();
    // Initialize request argument(s)
    string name = "projects/[PROJECT]/locations/[LOCATION]/encryptionSpec";
    // Make the request
    EncryptionSpec response = await encryptionSpecServiceClient.GetEncryptionSpecAsync(name);

### GetEncryptionSpecAsync(string, CancellationToken)

    public virtual Task<EncryptionSpec> GetEncryptionSpecAsync(string name, CancellationToken cancellationToken)

Gets location-level encryption key specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the encryption spec resource to get. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` | A Task containing the RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = await EncryptionSpecServiceClient.CreateAsync();
    // Initialize request argument(s)
    string name = "projects/[PROJECT]/locations/[LOCATION]/encryptionSpec";
    // Make the request
    EncryptionSpec response = await encryptionSpecServiceClient.GetEncryptionSpecAsync(name);

### InitializeEncryptionSpec(EncryptionSpec, CallSettings)

    public virtual Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> InitializeEncryptionSpec(EncryptionSpec encryptionSpec, CallSettings callSettings = null)

Initializes a location-level encryption key specification. An error will
be thrown if the location has resources already created before the
initialization. Once the encryption specification is initialized at a
location, it is immutable and all newly created resources under the
location will be encrypted with the existing specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `encryptionSpec` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` Required. The encryption spec used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key_name is left empty, no encryption will be enforced. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecMetadata` | The RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = EncryptionSpecServiceClient.Create();
    // Initialize request argument(s)
    EncryptionSpec encryptionSpec = new EncryptionSpec();
    // Make the request
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> response = encryptionSpecServiceClient.InitializeEncryptionSpec(encryptionSpec);

    // Poll until the returned long-running operation is complete
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    InitializeEncryptionSpecResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> retrievedResponse = encryptionSpecServiceClient.PollOnceInitializeEncryptionSpec(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        InitializeEncryptionSpecResponse retrievedResult = retrievedResponse.Result;
    }

### InitializeEncryptionSpec(InitializeEncryptionSpecRequest, CallSettings)

    public virtual Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> InitializeEncryptionSpec(InitializeEncryptionSpecRequest request, CallSettings callSettings = null)

Initializes a location-level encryption key specification. An error will
be thrown if the location has resources already created before the
initialization. Once the encryption specification is initialized at a
location, it is immutable and all newly created resources under the
location will be encrypted with the existing specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecMetadata` | The RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = EncryptionSpecServiceClient.Create();
    // Initialize request argument(s)
    InitializeEncryptionSpecRequest request = new InitializeEncryptionSpecRequest
    {
        EncryptionSpec = new EncryptionSpec(),
    };
    // Make the request
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> response = encryptionSpecServiceClient.InitializeEncryptionSpec(request);

    // Poll until the returned long-running operation is complete
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    InitializeEncryptionSpecResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> retrievedResponse = encryptionSpecServiceClient.PollOnceInitializeEncryptionSpec(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        InitializeEncryptionSpecResponse retrievedResult = retrievedResponse.Result;
    }

### InitializeEncryptionSpecAsync(EncryptionSpec, CallSettings)

    public virtual Task<Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata>> InitializeEncryptionSpecAsync(EncryptionSpec encryptionSpec, CallSettings callSettings = null)

Initializes a location-level encryption key specification. An error will
be thrown if the location has resources already created before the
initialization. Once the encryption specification is initialized at a
location, it is immutable and all newly created resources under the
location will be encrypted with the existing specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `encryptionSpec` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` Required. The encryption spec used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key_name is left empty, no encryption will be enforced. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = await EncryptionSpecServiceClient.CreateAsync();
    // Initialize request argument(s)
    EncryptionSpec encryptionSpec = new EncryptionSpec();
    // Make the request
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> response = await encryptionSpecServiceClient.InitializeEncryptionSpecAsync(encryptionSpec);

    // Poll until the returned long-running operation is complete
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    InitializeEncryptionSpecResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> retrievedResponse = await encryptionSpecServiceClient.PollOnceInitializeEncryptionSpecAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        InitializeEncryptionSpecResponse retrievedResult = retrievedResponse.Result;
    }

### InitializeEncryptionSpecAsync(EncryptionSpec, CancellationToken)

    public virtual Task<Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata>> InitializeEncryptionSpecAsync(EncryptionSpec encryptionSpec, CancellationToken cancellationToken)

Initializes a location-level encryption key specification. An error will
be thrown if the location has resources already created before the
initialization. Once the encryption specification is initialized at a
location, it is immutable and all newly created resources under the
location will be encrypted with the existing specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `encryptionSpec` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpec` Required. The encryption spec used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key_name is left empty, no encryption will be enforced. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = await EncryptionSpecServiceClient.CreateAsync();
    // Initialize request argument(s)
    EncryptionSpec encryptionSpec = new EncryptionSpec();
    // Make the request
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> response = await encryptionSpecServiceClient.InitializeEncryptionSpecAsync(encryptionSpec);

    // Poll until the returned long-running operation is complete
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    InitializeEncryptionSpecResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> retrievedResponse = await encryptionSpecServiceClient.PollOnceInitializeEncryptionSpecAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        InitializeEncryptionSpecResponse retrievedResult = retrievedResponse.Result;
    }

### InitializeEncryptionSpecAsync(InitializeEncryptionSpecRequest, CallSettings)

    public virtual Task<Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata>> InitializeEncryptionSpecAsync(InitializeEncryptionSpecRequest request, CallSettings callSettings = null)

Initializes a location-level encryption key specification. An error will
be thrown if the location has resources already created before the
initialization. Once the encryption specification is initialized at a
location, it is immutable and all newly created resources under the
location will be encrypted with the existing specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = await EncryptionSpecServiceClient.CreateAsync();
    // Initialize request argument(s)
    InitializeEncryptionSpecRequest request = new InitializeEncryptionSpecRequest
    {
        EncryptionSpec = new EncryptionSpec(),
    };
    // Make the request
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> response = await encryptionSpecServiceClient.InitializeEncryptionSpecAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    InitializeEncryptionSpecResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> retrievedResponse = await encryptionSpecServiceClient.PollOnceInitializeEncryptionSpecAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        InitializeEncryptionSpecResponse retrievedResult = retrievedResponse.Result;
    }

### InitializeEncryptionSpecAsync(InitializeEncryptionSpecRequest, CancellationToken)

    public virtual Task<Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata>> InitializeEncryptionSpecAsync(InitializeEncryptionSpecRequest request, CancellationToken cancellationToken)

Initializes a location-level encryption key specification. An error will
be thrown if the location has resources already created before the
initialization. Once the encryption specification is initialized at a
location, it is immutable and all newly created resources under the
location will be encrypted with the existing specification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    EncryptionSpecServiceClient encryptionSpecServiceClient = await EncryptionSpecServiceClient.CreateAsync();
    // Initialize request argument(s)
    InitializeEncryptionSpecRequest request = new InitializeEncryptionSpecRequest
    {
        EncryptionSpec = new EncryptionSpec(),
    };
    // Make the request
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> response = await encryptionSpecServiceClient.InitializeEncryptionSpecAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    InitializeEncryptionSpecResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> retrievedResponse = await encryptionSpecServiceClient.PollOnceInitializeEncryptionSpecAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        InitializeEncryptionSpecResponse retrievedResult = retrievedResponse.Result;
    }

### PollOnceInitializeEncryptionSpec(string, CallSettings)

    public virtual Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata> PollOnceInitializeEncryptionSpec(string operationName, CallSettings callSettings = null)

Poll an operation once, using an `operationName` from a previous invocation of
`InitializeEncryptionSpec`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecMetadata` | The result of polling the operation. |

### PollOnceInitializeEncryptionSpecAsync(string, CallSettings)

    public virtual Task<Operation<InitializeEncryptionSpecResponse, InitializeEncryptionSpecMetadata>> PollOnceInitializeEncryptionSpecAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an `operationName` from a previous invocation of
`InitializeEncryptionSpec`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.InitializeEncryptionSpecMetadata` | A task representing the result of polling the operation. |

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClient#Google_Cloud_Dialogflow_V2_EncryptionSpecServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClient#Google_Cloud_Dialogflow_V2_EncryptionSpecServiceClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClient#Google_Cloud_Dialogflow_V2_EncryptionSpecServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EncryptionSpecServiceClient#Google_Cloud_Dialogflow_V2_EncryptionSpecServiceClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.