Compute Engine v1 API - Class LicenseCodesClient (2.16.0)

public abstract class LicenseCodesClient

Reference documentation and code samples for the Compute Engine v1 API class LicenseCodesClient.

LicenseCodes client wrapper, for convenient use.

Inheritance

object > LicenseCodesClient

Derived Types

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The LicenseCodes API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default LicenseCodes scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual LicenseCodes.LicenseCodesClient GrpcClient { get; }

The underlying gRPC LicenseCodes client

Property Value
Type Description
LicenseCodesLicenseCodesClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static LicenseCodesClient Create()

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

Returns
Type Description
LicenseCodesClient

The created LicenseCodesClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskLicenseCodesClient

The task representing the created LicenseCodesClient.

Get(GetLicenseCodeRequest, CallSettings)

public virtual LicenseCode Get(GetLicenseCodeRequest request, CallSettings callSettings = null)

Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
request GetLicenseCodeRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
LicenseCode

The RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = LicenseCodesClient.Create();
// Initialize request argument(s)
GetLicenseCodeRequest request = new GetLicenseCodeRequest
{
    LicenseCode = "",
    Project = "",
};
// Make the request
LicenseCode response = licenseCodesClient.Get(request);

Get(string, string, CallSettings)

public virtual LicenseCode Get(string project, string licenseCode, CallSettings callSettings = null)

Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
project string

Project ID for this request.

licenseCode string

Number corresponding to the License code resource to return.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
LicenseCode

The RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = LicenseCodesClient.Create();
// Initialize request argument(s)
string project = "";
string licenseCode = "";
// Make the request
LicenseCode response = licenseCodesClient.Get(project, licenseCode);

GetAsync(GetLicenseCodeRequest, CallSettings)

public virtual Task<LicenseCode> GetAsync(GetLicenseCodeRequest request, CallSettings callSettings = null)

Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
request GetLicenseCodeRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskLicenseCode

A Task containing the RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = await LicenseCodesClient.CreateAsync();
// Initialize request argument(s)
GetLicenseCodeRequest request = new GetLicenseCodeRequest
{
    LicenseCode = "",
    Project = "",
};
// Make the request
LicenseCode response = await licenseCodesClient.GetAsync(request);

GetAsync(GetLicenseCodeRequest, CancellationToken)

public virtual Task<LicenseCode> GetAsync(GetLicenseCodeRequest request, CancellationToken cancellationToken)

Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
request GetLicenseCodeRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskLicenseCode

A Task containing the RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = await LicenseCodesClient.CreateAsync();
// Initialize request argument(s)
GetLicenseCodeRequest request = new GetLicenseCodeRequest
{
    LicenseCode = "",
    Project = "",
};
// Make the request
LicenseCode response = await licenseCodesClient.GetAsync(request);

GetAsync(string, string, CallSettings)

public virtual Task<LicenseCode> GetAsync(string project, string licenseCode, CallSettings callSettings = null)

Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
project string

Project ID for this request.

licenseCode string

Number corresponding to the License code resource to return.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskLicenseCode

A Task containing the RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = await LicenseCodesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string licenseCode = "";
// Make the request
LicenseCode response = await licenseCodesClient.GetAsync(project, licenseCode);

GetAsync(string, string, CancellationToken)

public virtual Task<LicenseCode> GetAsync(string project, string licenseCode, CancellationToken cancellationToken)

Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
project string

Project ID for this request.

licenseCode string

Number corresponding to the License code resource to return.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskLicenseCode

A Task containing the RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = await LicenseCodesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string licenseCode = "";
// Make the request
LicenseCode response = await licenseCodesClient.GetAsync(project, licenseCode);

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
Type Description
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.

TestIamPermissions(TestIamPermissionsLicenseCodeRequest, CallSettings)

public virtual TestPermissionsResponse TestIamPermissions(TestIamPermissionsLicenseCodeRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
request TestIamPermissionsLicenseCodeRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TestPermissionsResponse

The RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = LicenseCodesClient.Create();
// Initialize request argument(s)
TestIamPermissionsLicenseCodeRequest request = new TestIamPermissionsLicenseCodeRequest
{
    Resource = "",
    Project = "",
    TestPermissionsRequestResource = new TestPermissionsRequest(),
};
// Make the request
TestPermissionsResponse response = licenseCodesClient.TestIamPermissions(request);

TestIamPermissions(string, string, TestPermissionsRequest, CallSettings)

public virtual TestPermissionsResponse TestIamPermissions(string project, string resource, TestPermissionsRequest testPermissionsRequestResource, CallSettings callSettings = null)

Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

testPermissionsRequestResource TestPermissionsRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TestPermissionsResponse

The RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = LicenseCodesClient.Create();
// Initialize request argument(s)
string project = "";
string resource = "";
TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
// Make the request
TestPermissionsResponse response = licenseCodesClient.TestIamPermissions(project, resource, testPermissionsRequestResource);

TestIamPermissionsAsync(TestIamPermissionsLicenseCodeRequest, CallSettings)

public virtual Task<TestPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsLicenseCodeRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
request TestIamPermissionsLicenseCodeRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTestPermissionsResponse

A Task containing the RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = await LicenseCodesClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsLicenseCodeRequest request = new TestIamPermissionsLicenseCodeRequest
{
    Resource = "",
    Project = "",
    TestPermissionsRequestResource = new TestPermissionsRequest(),
};
// Make the request
TestPermissionsResponse response = await licenseCodesClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsLicenseCodeRequest, CancellationToken)

public virtual Task<TestPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsLicenseCodeRequest request, CancellationToken cancellationToken)

Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
request TestIamPermissionsLicenseCodeRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTestPermissionsResponse

A Task containing the RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = await LicenseCodesClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsLicenseCodeRequest request = new TestIamPermissionsLicenseCodeRequest
{
    Resource = "",
    Project = "",
    TestPermissionsRequestResource = new TestPermissionsRequest(),
};
// Make the request
TestPermissionsResponse response = await licenseCodesClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(string, string, TestPermissionsRequest, CallSettings)

public virtual Task<TestPermissionsResponse> TestIamPermissionsAsync(string project, string resource, TestPermissionsRequest testPermissionsRequestResource, CallSettings callSettings = null)

Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

testPermissionsRequestResource TestPermissionsRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTestPermissionsResponse

A Task containing the RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = await LicenseCodesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
// Make the request
TestPermissionsResponse response = await licenseCodesClient.TestIamPermissionsAsync(project, resource, testPermissionsRequestResource);

TestIamPermissionsAsync(string, string, TestPermissionsRequest, CancellationToken)

public virtual Task<TestPermissionsResponse> TestIamPermissionsAsync(string project, string resource, TestPermissionsRequest testPermissionsRequestResource, CancellationToken cancellationToken)

Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

Parameters
Name Description
project string

Project ID for this request.

resource string

Name or id of the resource for this request.

testPermissionsRequestResource TestPermissionsRequest

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTestPermissionsResponse

A Task containing the RPC response.

Example
// Create client
LicenseCodesClient licenseCodesClient = await LicenseCodesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string resource = "";
TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
// Make the request
TestPermissionsResponse response = await licenseCodesClient.TestIamPermissionsAsync(project, resource, testPermissionsRequestResource);