Compute Engine v1 API - Class LicenseCodesClient (2.3.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
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default LicenseCodes scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual LicenseCodes.LicenseCodesClient GrpcClient { get; }

The underlying gRPC LicenseCodes client

Property Value
TypeDescription
LicenseCodes.LicenseCodesClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
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
TypeDescription
LicenseCodesClient

The created LicenseCodesClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<LicenseCodesClient>

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
NameDescription
requestGetLicenseCodeRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
projectString

Project ID for this request.

licenseCodeString

Number corresponding to the License code resource to return.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetLicenseCodeRequest

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<LicenseCode>

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
NameDescription
requestGetLicenseCodeRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<LicenseCode>

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
NameDescription
projectString

Project ID for this request.

licenseCodeString

Number corresponding to the License code resource to return.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<LicenseCode>

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
NameDescription
projectString

Project ID for this request.

licenseCodeString

Number corresponding to the License code resource to return.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<LicenseCode>

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

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
NameDescription
requestTestIamPermissionsLicenseCodeRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
projectString

Project ID for this request.

resourceString

Name or id of the resource for this request.

testPermissionsRequestResourceTestPermissionsRequest

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestTestIamPermissionsLicenseCodeRequest

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<TestPermissionsResponse>

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
NameDescription
requestTestIamPermissionsLicenseCodeRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<TestPermissionsResponse>

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
NameDescription
projectString

Project ID for this request.

resourceString

Name or id of the resource for this request.

testPermissionsRequestResourceTestPermissionsRequest

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<TestPermissionsResponse>

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
NameDescription
projectString

Project ID for this request.

resourceString

Name or id of the resource for this request.

testPermissionsRequestResourceTestPermissionsRequest

The body resource for this request

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<TestPermissionsResponse>

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);