Google Cloud Key Management Service v1 API - Class EkmServiceClient (3.1.0)

public abstract class EkmServiceClient

Reference documentation and code samples for the Google Cloud Key Management Service v1 API class EkmServiceClient.

EkmService client wrapper, for convenient use.

Inheritance

Object > EkmServiceClient

Derived Types

Namespace

Google.Cloud.Kms.V1

Assembly

Google.Cloud.Kms.V1.dll

Remarks

Google Cloud Key Management EKM Service

Manages external cryptographic keys and operations using those keys. Implements a REST model with the following objects:

  • [EkmConnection][google.cloud.kms.v1.EkmConnection]

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default EkmService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual EkmService.EkmServiceClient GrpcClient { get; }

The underlying gRPC EkmService client

Property Value
TypeDescription
EkmService.EkmServiceClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
TypeDescription
IAMPolicyClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static EkmServiceClient Create()

Synchronously creates a EkmServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use EkmServiceClientBuilder.

Returns
TypeDescription
EkmServiceClient

The created EkmServiceClient.

CreateAsync(CancellationToken)

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

Asynchronously creates a EkmServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use EkmServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<EkmServiceClient>

The task representing the created EkmServiceClient.

CreateEkmConnection(LocationName, String, EkmConnection, CallSettings)

public virtual EkmConnection CreateEkmConnection(LocationName parent, string ekmConnectionId, EkmConnection ekmConnection, CallSettings callSettings = null)

Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given Project and Location.

Parameters
NameDescription
parentLocationName

Required. The resource name of the location associated with the [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format projects/*/locations/*.

ekmConnectionIdString

Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}.

ekmConnectionEkmConnection

Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with initial field values.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
EkmConnection

The RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = EkmServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string ekmConnectionId = "";
EkmConnection ekmConnection = new EkmConnection();
// Make the request
EkmConnection response = ekmServiceClient.CreateEkmConnection(parent, ekmConnectionId, ekmConnection);

CreateEkmConnection(CreateEkmConnectionRequest, CallSettings)

public virtual EkmConnection CreateEkmConnection(CreateEkmConnectionRequest request, CallSettings callSettings = null)

Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given Project and Location.

Parameters
NameDescription
requestCreateEkmConnectionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
EkmConnection

The RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = EkmServiceClient.Create();
// Initialize request argument(s)
CreateEkmConnectionRequest request = new CreateEkmConnectionRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    EkmConnectionId = "",
    EkmConnection = new EkmConnection(),
};
// Make the request
EkmConnection response = ekmServiceClient.CreateEkmConnection(request);

CreateEkmConnection(String, String, EkmConnection, CallSettings)

public virtual EkmConnection CreateEkmConnection(string parent, string ekmConnectionId, EkmConnection ekmConnection, CallSettings callSettings = null)

Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given Project and Location.

Parameters
NameDescription
parentString

Required. The resource name of the location associated with the [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format projects/*/locations/*.

ekmConnectionIdString

Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}.

ekmConnectionEkmConnection

Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with initial field values.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
EkmConnection

The RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = EkmServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string ekmConnectionId = "";
EkmConnection ekmConnection = new EkmConnection();
// Make the request
EkmConnection response = ekmServiceClient.CreateEkmConnection(parent, ekmConnectionId, ekmConnection);

CreateEkmConnectionAsync(LocationName, String, EkmConnection, CallSettings)

public virtual Task<EkmConnection> CreateEkmConnectionAsync(LocationName parent, string ekmConnectionId, EkmConnection ekmConnection, CallSettings callSettings = null)

Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given Project and Location.

Parameters
NameDescription
parentLocationName

Required. The resource name of the location associated with the [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format projects/*/locations/*.

ekmConnectionIdString

Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}.

ekmConnectionEkmConnection

Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with initial field values.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string ekmConnectionId = "";
EkmConnection ekmConnection = new EkmConnection();
// Make the request
EkmConnection response = await ekmServiceClient.CreateEkmConnectionAsync(parent, ekmConnectionId, ekmConnection);

CreateEkmConnectionAsync(LocationName, String, EkmConnection, CancellationToken)

public virtual Task<EkmConnection> CreateEkmConnectionAsync(LocationName parent, string ekmConnectionId, EkmConnection ekmConnection, CancellationToken cancellationToken)

Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given Project and Location.

Parameters
NameDescription
parentLocationName

Required. The resource name of the location associated with the [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format projects/*/locations/*.

ekmConnectionIdString

Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}.

ekmConnectionEkmConnection

Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with initial field values.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string ekmConnectionId = "";
EkmConnection ekmConnection = new EkmConnection();
// Make the request
EkmConnection response = await ekmServiceClient.CreateEkmConnectionAsync(parent, ekmConnectionId, ekmConnection);

CreateEkmConnectionAsync(CreateEkmConnectionRequest, CallSettings)

public virtual Task<EkmConnection> CreateEkmConnectionAsync(CreateEkmConnectionRequest request, CallSettings callSettings = null)

Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given Project and Location.

Parameters
NameDescription
requestCreateEkmConnectionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
CreateEkmConnectionRequest request = new CreateEkmConnectionRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    EkmConnectionId = "",
    EkmConnection = new EkmConnection(),
};
// Make the request
EkmConnection response = await ekmServiceClient.CreateEkmConnectionAsync(request);

CreateEkmConnectionAsync(CreateEkmConnectionRequest, CancellationToken)

public virtual Task<EkmConnection> CreateEkmConnectionAsync(CreateEkmConnectionRequest request, CancellationToken cancellationToken)

Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given Project and Location.

Parameters
NameDescription
requestCreateEkmConnectionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
CreateEkmConnectionRequest request = new CreateEkmConnectionRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    EkmConnectionId = "",
    EkmConnection = new EkmConnection(),
};
// Make the request
EkmConnection response = await ekmServiceClient.CreateEkmConnectionAsync(request);

CreateEkmConnectionAsync(String, String, EkmConnection, CallSettings)

public virtual Task<EkmConnection> CreateEkmConnectionAsync(string parent, string ekmConnectionId, EkmConnection ekmConnection, CallSettings callSettings = null)

Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given Project and Location.

Parameters
NameDescription
parentString

Required. The resource name of the location associated with the [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format projects/*/locations/*.

ekmConnectionIdString

Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}.

ekmConnectionEkmConnection

Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with initial field values.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string ekmConnectionId = "";
EkmConnection ekmConnection = new EkmConnection();
// Make the request
EkmConnection response = await ekmServiceClient.CreateEkmConnectionAsync(parent, ekmConnectionId, ekmConnection);

CreateEkmConnectionAsync(String, String, EkmConnection, CancellationToken)

public virtual Task<EkmConnection> CreateEkmConnectionAsync(string parent, string ekmConnectionId, EkmConnection ekmConnection, CancellationToken cancellationToken)

Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given Project and Location.

Parameters
NameDescription
parentString

Required. The resource name of the location associated with the [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format projects/*/locations/*.

ekmConnectionIdString

Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}.

ekmConnectionEkmConnection

Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with initial field values.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string ekmConnectionId = "";
EkmConnection ekmConnection = new EkmConnection();
// Make the request
EkmConnection response = await ekmServiceClient.CreateEkmConnectionAsync(parent, ekmConnectionId, ekmConnection);

GetEkmConnection(EkmConnectionName, CallSettings)

public virtual EkmConnection GetEkmConnection(EkmConnectionName name, CallSettings callSettings = null)

Returns metadata for a given [EkmConnection][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
nameEkmConnectionName

Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the [EkmConnection][google.cloud.kms.v1.EkmConnection] to get.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
EkmConnection

The RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = EkmServiceClient.Create();
// Initialize request argument(s)
EkmConnectionName name = EkmConnectionName.FromProjectLocationEkmConnection("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]");
// Make the request
EkmConnection response = ekmServiceClient.GetEkmConnection(name);

GetEkmConnection(GetEkmConnectionRequest, CallSettings)

public virtual EkmConnection GetEkmConnection(GetEkmConnectionRequest request, CallSettings callSettings = null)

Returns metadata for a given [EkmConnection][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
requestGetEkmConnectionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
EkmConnection

The RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = EkmServiceClient.Create();
// Initialize request argument(s)
GetEkmConnectionRequest request = new GetEkmConnectionRequest
{
    EkmConnectionName = EkmConnectionName.FromProjectLocationEkmConnection("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]"),
};
// Make the request
EkmConnection response = ekmServiceClient.GetEkmConnection(request);

GetEkmConnection(String, CallSettings)

public virtual EkmConnection GetEkmConnection(string name, CallSettings callSettings = null)

Returns metadata for a given [EkmConnection][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
nameString

Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the [EkmConnection][google.cloud.kms.v1.EkmConnection] to get.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
EkmConnection

The RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = EkmServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/ekmConnections/[EKM_CONNECTION]";
// Make the request
EkmConnection response = ekmServiceClient.GetEkmConnection(name);

GetEkmConnectionAsync(EkmConnectionName, CallSettings)

public virtual Task<EkmConnection> GetEkmConnectionAsync(EkmConnectionName name, CallSettings callSettings = null)

Returns metadata for a given [EkmConnection][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
nameEkmConnectionName

Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the [EkmConnection][google.cloud.kms.v1.EkmConnection] to get.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
EkmConnectionName name = EkmConnectionName.FromProjectLocationEkmConnection("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]");
// Make the request
EkmConnection response = await ekmServiceClient.GetEkmConnectionAsync(name);

GetEkmConnectionAsync(EkmConnectionName, CancellationToken)

public virtual Task<EkmConnection> GetEkmConnectionAsync(EkmConnectionName name, CancellationToken cancellationToken)

Returns metadata for a given [EkmConnection][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
nameEkmConnectionName

Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the [EkmConnection][google.cloud.kms.v1.EkmConnection] to get.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
EkmConnectionName name = EkmConnectionName.FromProjectLocationEkmConnection("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]");
// Make the request
EkmConnection response = await ekmServiceClient.GetEkmConnectionAsync(name);

GetEkmConnectionAsync(GetEkmConnectionRequest, CallSettings)

public virtual Task<EkmConnection> GetEkmConnectionAsync(GetEkmConnectionRequest request, CallSettings callSettings = null)

Returns metadata for a given [EkmConnection][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
requestGetEkmConnectionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
GetEkmConnectionRequest request = new GetEkmConnectionRequest
{
    EkmConnectionName = EkmConnectionName.FromProjectLocationEkmConnection("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]"),
};
// Make the request
EkmConnection response = await ekmServiceClient.GetEkmConnectionAsync(request);

GetEkmConnectionAsync(GetEkmConnectionRequest, CancellationToken)

public virtual Task<EkmConnection> GetEkmConnectionAsync(GetEkmConnectionRequest request, CancellationToken cancellationToken)

Returns metadata for a given [EkmConnection][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
requestGetEkmConnectionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
GetEkmConnectionRequest request = new GetEkmConnectionRequest
{
    EkmConnectionName = EkmConnectionName.FromProjectLocationEkmConnection("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]"),
};
// Make the request
EkmConnection response = await ekmServiceClient.GetEkmConnectionAsync(request);

GetEkmConnectionAsync(String, CallSettings)

public virtual Task<EkmConnection> GetEkmConnectionAsync(string name, CallSettings callSettings = null)

Returns metadata for a given [EkmConnection][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
nameString

Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the [EkmConnection][google.cloud.kms.v1.EkmConnection] to get.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/ekmConnections/[EKM_CONNECTION]";
// Make the request
EkmConnection response = await ekmServiceClient.GetEkmConnectionAsync(name);

GetEkmConnectionAsync(String, CancellationToken)

public virtual Task<EkmConnection> GetEkmConnectionAsync(string name, CancellationToken cancellationToken)

Returns metadata for a given [EkmConnection][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
nameString

Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the [EkmConnection][google.cloud.kms.v1.EkmConnection] to get.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/ekmConnections/[EKM_CONNECTION]";
// Make the request
EkmConnection response = await ekmServiceClient.GetEkmConnectionAsync(name);

ListEkmConnections(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListEkmConnectionsResponse, EkmConnection> ListEkmConnections(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [EkmConnections][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
parentLocationName

Required. The resource name of the location associated with the [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format projects/*/locations/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListEkmConnectionsResponse, EkmConnection>

A pageable sequence of EkmConnection resources.

Example
// Create client
EkmServiceClient ekmServiceClient = EkmServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListEkmConnectionsResponse, EkmConnection> response = ekmServiceClient.ListEkmConnections(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (EkmConnection item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListEkmConnectionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (EkmConnection item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<EkmConnection> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (EkmConnection item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListEkmConnections(ListEkmConnectionsRequest, CallSettings)

public virtual PagedEnumerable<ListEkmConnectionsResponse, EkmConnection> ListEkmConnections(ListEkmConnectionsRequest request, CallSettings callSettings = null)

Lists [EkmConnections][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
requestListEkmConnectionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListEkmConnectionsResponse, EkmConnection>

A pageable sequence of EkmConnection resources.

Example
// Create client
EkmServiceClient ekmServiceClient = EkmServiceClient.Create();
// Initialize request argument(s)
ListEkmConnectionsRequest request = new ListEkmConnectionsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedEnumerable<ListEkmConnectionsResponse, EkmConnection> response = ekmServiceClient.ListEkmConnections(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (EkmConnection item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListEkmConnectionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (EkmConnection item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<EkmConnection> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (EkmConnection item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListEkmConnections(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListEkmConnectionsResponse, EkmConnection> ListEkmConnections(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [EkmConnections][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
parentString

Required. The resource name of the location associated with the [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format projects/*/locations/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListEkmConnectionsResponse, EkmConnection>

A pageable sequence of EkmConnection resources.

Example
// Create client
EkmServiceClient ekmServiceClient = EkmServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListEkmConnectionsResponse, EkmConnection> response = ekmServiceClient.ListEkmConnections(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (EkmConnection item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListEkmConnectionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (EkmConnection item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<EkmConnection> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (EkmConnection item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListEkmConnectionsAsync(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListEkmConnectionsResponse, EkmConnection> ListEkmConnectionsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [EkmConnections][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
parentLocationName

Required. The resource name of the location associated with the [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format projects/*/locations/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListEkmConnectionsResponse, EkmConnection>

A pageable asynchronous sequence of EkmConnection resources.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListEkmConnectionsResponse, EkmConnection> response = ekmServiceClient.ListEkmConnectionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((EkmConnection item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListEkmConnectionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (EkmConnection item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<EkmConnection> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (EkmConnection item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListEkmConnectionsAsync(ListEkmConnectionsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListEkmConnectionsResponse, EkmConnection> ListEkmConnectionsAsync(ListEkmConnectionsRequest request, CallSettings callSettings = null)

Lists [EkmConnections][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
requestListEkmConnectionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListEkmConnectionsResponse, EkmConnection>

A pageable asynchronous sequence of EkmConnection resources.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
ListEkmConnectionsRequest request = new ListEkmConnectionsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListEkmConnectionsResponse, EkmConnection> response = ekmServiceClient.ListEkmConnectionsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((EkmConnection item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListEkmConnectionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (EkmConnection item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<EkmConnection> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (EkmConnection item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListEkmConnectionsAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListEkmConnectionsResponse, EkmConnection> ListEkmConnectionsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [EkmConnections][google.cloud.kms.v1.EkmConnection].

Parameters
NameDescription
parentString

Required. The resource name of the location associated with the [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format projects/*/locations/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListEkmConnectionsResponse, EkmConnection>

A pageable asynchronous sequence of EkmConnection resources.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListEkmConnectionsResponse, EkmConnection> response = ekmServiceClient.ListEkmConnectionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((EkmConnection item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListEkmConnectionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (EkmConnection item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<EkmConnection> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (EkmConnection item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateEkmConnection(EkmConnection, FieldMask, CallSettings)

public virtual EkmConnection UpdateEkmConnection(EkmConnection ekmConnection, FieldMask updateMask, CallSettings callSettings = null)

Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata.

Parameters
NameDescription
ekmConnectionEkmConnection

Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated values.

updateMaskFieldMask

Required. List of fields to be updated in this request.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
EkmConnection

The RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = EkmServiceClient.Create();
// Initialize request argument(s)
EkmConnection ekmConnection = new EkmConnection();
FieldMask updateMask = new FieldMask();
// Make the request
EkmConnection response = ekmServiceClient.UpdateEkmConnection(ekmConnection, updateMask);

UpdateEkmConnection(UpdateEkmConnectionRequest, CallSettings)

public virtual EkmConnection UpdateEkmConnection(UpdateEkmConnectionRequest request, CallSettings callSettings = null)

Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata.

Parameters
NameDescription
requestUpdateEkmConnectionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
EkmConnection

The RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = EkmServiceClient.Create();
// Initialize request argument(s)
UpdateEkmConnectionRequest request = new UpdateEkmConnectionRequest
{
    EkmConnection = new EkmConnection(),
    UpdateMask = new FieldMask(),
};
// Make the request
EkmConnection response = ekmServiceClient.UpdateEkmConnection(request);

UpdateEkmConnectionAsync(EkmConnection, FieldMask, CallSettings)

public virtual Task<EkmConnection> UpdateEkmConnectionAsync(EkmConnection ekmConnection, FieldMask updateMask, CallSettings callSettings = null)

Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata.

Parameters
NameDescription
ekmConnectionEkmConnection

Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated values.

updateMaskFieldMask

Required. List of fields to be updated in this request.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
EkmConnection ekmConnection = new EkmConnection();
FieldMask updateMask = new FieldMask();
// Make the request
EkmConnection response = await ekmServiceClient.UpdateEkmConnectionAsync(ekmConnection, updateMask);

UpdateEkmConnectionAsync(EkmConnection, FieldMask, CancellationToken)

public virtual Task<EkmConnection> UpdateEkmConnectionAsync(EkmConnection ekmConnection, FieldMask updateMask, CancellationToken cancellationToken)

Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata.

Parameters
NameDescription
ekmConnectionEkmConnection

Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated values.

updateMaskFieldMask

Required. List of fields to be updated in this request.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
EkmConnection ekmConnection = new EkmConnection();
FieldMask updateMask = new FieldMask();
// Make the request
EkmConnection response = await ekmServiceClient.UpdateEkmConnectionAsync(ekmConnection, updateMask);

UpdateEkmConnectionAsync(UpdateEkmConnectionRequest, CallSettings)

public virtual Task<EkmConnection> UpdateEkmConnectionAsync(UpdateEkmConnectionRequest request, CallSettings callSettings = null)

Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata.

Parameters
NameDescription
requestUpdateEkmConnectionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateEkmConnectionRequest request = new UpdateEkmConnectionRequest
{
    EkmConnection = new EkmConnection(),
    UpdateMask = new FieldMask(),
};
// Make the request
EkmConnection response = await ekmServiceClient.UpdateEkmConnectionAsync(request);

UpdateEkmConnectionAsync(UpdateEkmConnectionRequest, CancellationToken)

public virtual Task<EkmConnection> UpdateEkmConnectionAsync(UpdateEkmConnectionRequest request, CancellationToken cancellationToken)

Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata.

Parameters
NameDescription
requestUpdateEkmConnectionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<EkmConnection>

A Task containing the RPC response.

Example
// Create client
EkmServiceClient ekmServiceClient = await EkmServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateEkmConnectionRequest request = new UpdateEkmConnectionRequest
{
    EkmConnection = new EkmConnection(),
    UpdateMask = new FieldMask(),
};
// Make the request
EkmConnection response = await ekmServiceClient.UpdateEkmConnectionAsync(request);