Cloud Security Compliance v1 API - Class CmEnrollmentServiceClient (1.0.0-beta04)

public abstract class CmEnrollmentServiceClient

Reference documentation and code samples for the Cloud Security Compliance v1 API class CmEnrollmentServiceClient.

CmEnrollmentService client wrapper, for convenient use.

Inheritance

object > CmEnrollmentServiceClient

Namespace

Google.Cloud.CloudSecurityCompliance.V1

Assembly

Google.Cloud.CloudSecurityCompliance.V1.dll

Remarks

Service describing CmEnrollment related RPCs for complianceManager.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default CmEnrollmentService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default CmEnrollmentService scopes are:

GrpcClient

public virtual CmEnrollmentService.CmEnrollmentServiceClient GrpcClient { get; }

The underlying gRPC CmEnrollmentService client

Property Value
Type Description
CmEnrollmentServiceCmEnrollmentServiceClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

CalculateEffectiveCmEnrollment(CalculateEffectiveCmEnrollmentRequest, CallSettings)

public virtual CalculateEffectiveCmEnrollmentResponse CalculateEffectiveCmEnrollment(CalculateEffectiveCmEnrollmentRequest request, CallSettings callSettings = null)

Calculates the effective Compliance Manager enrollment for a resource. An effective enrollment is either a direct enrollment of a resource (if it exists), or an enrollment of the closest parent of a resource that's enrolled in Compliance Manager.

Parameters
Name Description
request CalculateEffectiveCmEnrollmentRequest

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
CalculateEffectiveCmEnrollmentResponse

The RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = CmEnrollmentServiceClient.Create();
// Initialize request argument(s)
CalculateEffectiveCmEnrollmentRequest request = new CalculateEffectiveCmEnrollmentRequest
{
    CmEnrollmentName = CmEnrollmentName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
};
// Make the request
CalculateEffectiveCmEnrollmentResponse response = cmEnrollmentServiceClient.CalculateEffectiveCmEnrollment(request);

CalculateEffectiveCmEnrollment(CmEnrollmentName, CallSettings)

public virtual CalculateEffectiveCmEnrollmentResponse CalculateEffectiveCmEnrollment(CmEnrollmentName name, CallSettings callSettings = null)

Calculates the effective Compliance Manager enrollment for a resource. An effective enrollment is either a direct enrollment of a resource (if it exists), or an enrollment of the closest parent of a resource that's enrolled in Compliance Manager.

Parameters
Name Description
name CmEnrollmentName

Required. The name of the Compliance Manager enrollment to calculate.

Supported formats are the following:

  • organizations/{organization_id}/locations/{location}/cmEnrollment
  • folders/{folder_id}/locations/{location}/cmEnrollment
  • projects/{project_id}/locations/{location}/cmEnrollment
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CalculateEffectiveCmEnrollmentResponse

The RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = CmEnrollmentServiceClient.Create();
// Initialize request argument(s)
CmEnrollmentName name = CmEnrollmentName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
CalculateEffectiveCmEnrollmentResponse response = cmEnrollmentServiceClient.CalculateEffectiveCmEnrollment(name);

CalculateEffectiveCmEnrollment(string, CallSettings)

public virtual CalculateEffectiveCmEnrollmentResponse CalculateEffectiveCmEnrollment(string name, CallSettings callSettings = null)

Calculates the effective Compliance Manager enrollment for a resource. An effective enrollment is either a direct enrollment of a resource (if it exists), or an enrollment of the closest parent of a resource that's enrolled in Compliance Manager.

Parameters
Name Description
name string

Required. The name of the Compliance Manager enrollment to calculate.

Supported formats are the following:

  • organizations/{organization_id}/locations/{location}/cmEnrollment
  • folders/{folder_id}/locations/{location}/cmEnrollment
  • projects/{project_id}/locations/{location}/cmEnrollment
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CalculateEffectiveCmEnrollmentResponse

The RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = CmEnrollmentServiceClient.Create();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/cmEnrollment";
// Make the request
CalculateEffectiveCmEnrollmentResponse response = cmEnrollmentServiceClient.CalculateEffectiveCmEnrollment(name);

CalculateEffectiveCmEnrollmentAsync(CalculateEffectiveCmEnrollmentRequest, CallSettings)

public virtual Task<CalculateEffectiveCmEnrollmentResponse> CalculateEffectiveCmEnrollmentAsync(CalculateEffectiveCmEnrollmentRequest request, CallSettings callSettings = null)

Calculates the effective Compliance Manager enrollment for a resource. An effective enrollment is either a direct enrollment of a resource (if it exists), or an enrollment of the closest parent of a resource that's enrolled in Compliance Manager.

Parameters
Name Description
request CalculateEffectiveCmEnrollmentRequest

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
TaskCalculateEffectiveCmEnrollmentResponse

A Task containing the RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = await CmEnrollmentServiceClient.CreateAsync();
// Initialize request argument(s)
CalculateEffectiveCmEnrollmentRequest request = new CalculateEffectiveCmEnrollmentRequest
{
    CmEnrollmentName = CmEnrollmentName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
};
// Make the request
CalculateEffectiveCmEnrollmentResponse response = await cmEnrollmentServiceClient.CalculateEffectiveCmEnrollmentAsync(request);

CalculateEffectiveCmEnrollmentAsync(CalculateEffectiveCmEnrollmentRequest, CancellationToken)

public virtual Task<CalculateEffectiveCmEnrollmentResponse> CalculateEffectiveCmEnrollmentAsync(CalculateEffectiveCmEnrollmentRequest request, CancellationToken cancellationToken)

Calculates the effective Compliance Manager enrollment for a resource. An effective enrollment is either a direct enrollment of a resource (if it exists), or an enrollment of the closest parent of a resource that's enrolled in Compliance Manager.

Parameters
Name Description
request CalculateEffectiveCmEnrollmentRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskCalculateEffectiveCmEnrollmentResponse

A Task containing the RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = await CmEnrollmentServiceClient.CreateAsync();
// Initialize request argument(s)
CalculateEffectiveCmEnrollmentRequest request = new CalculateEffectiveCmEnrollmentRequest
{
    CmEnrollmentName = CmEnrollmentName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
};
// Make the request
CalculateEffectiveCmEnrollmentResponse response = await cmEnrollmentServiceClient.CalculateEffectiveCmEnrollmentAsync(request);

CalculateEffectiveCmEnrollmentAsync(CmEnrollmentName, CallSettings)

public virtual Task<CalculateEffectiveCmEnrollmentResponse> CalculateEffectiveCmEnrollmentAsync(CmEnrollmentName name, CallSettings callSettings = null)

Calculates the effective Compliance Manager enrollment for a resource. An effective enrollment is either a direct enrollment of a resource (if it exists), or an enrollment of the closest parent of a resource that's enrolled in Compliance Manager.

Parameters
Name Description
name CmEnrollmentName

Required. The name of the Compliance Manager enrollment to calculate.

Supported formats are the following:

  • organizations/{organization_id}/locations/{location}/cmEnrollment
  • folders/{folder_id}/locations/{location}/cmEnrollment
  • projects/{project_id}/locations/{location}/cmEnrollment
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCalculateEffectiveCmEnrollmentResponse

A Task containing the RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = await CmEnrollmentServiceClient.CreateAsync();
// Initialize request argument(s)
CmEnrollmentName name = CmEnrollmentName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
CalculateEffectiveCmEnrollmentResponse response = await cmEnrollmentServiceClient.CalculateEffectiveCmEnrollmentAsync(name);

CalculateEffectiveCmEnrollmentAsync(CmEnrollmentName, CancellationToken)

public virtual Task<CalculateEffectiveCmEnrollmentResponse> CalculateEffectiveCmEnrollmentAsync(CmEnrollmentName name, CancellationToken cancellationToken)

Calculates the effective Compliance Manager enrollment for a resource. An effective enrollment is either a direct enrollment of a resource (if it exists), or an enrollment of the closest parent of a resource that's enrolled in Compliance Manager.

Parameters
Name Description
name CmEnrollmentName

Required. The name of the Compliance Manager enrollment to calculate.

Supported formats are the following:

  • organizations/{organization_id}/locations/{location}/cmEnrollment
  • folders/{folder_id}/locations/{location}/cmEnrollment
  • projects/{project_id}/locations/{location}/cmEnrollment
cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskCalculateEffectiveCmEnrollmentResponse

A Task containing the RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = await CmEnrollmentServiceClient.CreateAsync();
// Initialize request argument(s)
CmEnrollmentName name = CmEnrollmentName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
CalculateEffectiveCmEnrollmentResponse response = await cmEnrollmentServiceClient.CalculateEffectiveCmEnrollmentAsync(name);

CalculateEffectiveCmEnrollmentAsync(string, CallSettings)

public virtual Task<CalculateEffectiveCmEnrollmentResponse> CalculateEffectiveCmEnrollmentAsync(string name, CallSettings callSettings = null)

Calculates the effective Compliance Manager enrollment for a resource. An effective enrollment is either a direct enrollment of a resource (if it exists), or an enrollment of the closest parent of a resource that's enrolled in Compliance Manager.

Parameters
Name Description
name string

Required. The name of the Compliance Manager enrollment to calculate.

Supported formats are the following:

  • organizations/{organization_id}/locations/{location}/cmEnrollment
  • folders/{folder_id}/locations/{location}/cmEnrollment
  • projects/{project_id}/locations/{location}/cmEnrollment
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCalculateEffectiveCmEnrollmentResponse

A Task containing the RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = await CmEnrollmentServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/cmEnrollment";
// Make the request
CalculateEffectiveCmEnrollmentResponse response = await cmEnrollmentServiceClient.CalculateEffectiveCmEnrollmentAsync(name);

CalculateEffectiveCmEnrollmentAsync(string, CancellationToken)

public virtual Task<CalculateEffectiveCmEnrollmentResponse> CalculateEffectiveCmEnrollmentAsync(string name, CancellationToken cancellationToken)

Calculates the effective Compliance Manager enrollment for a resource. An effective enrollment is either a direct enrollment of a resource (if it exists), or an enrollment of the closest parent of a resource that's enrolled in Compliance Manager.

Parameters
Name Description
name string

Required. The name of the Compliance Manager enrollment to calculate.

Supported formats are the following:

  • organizations/{organization_id}/locations/{location}/cmEnrollment
  • folders/{folder_id}/locations/{location}/cmEnrollment
  • projects/{project_id}/locations/{location}/cmEnrollment
cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskCalculateEffectiveCmEnrollmentResponse

A Task containing the RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = await CmEnrollmentServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/cmEnrollment";
// Make the request
CalculateEffectiveCmEnrollmentResponse response = await cmEnrollmentServiceClient.CalculateEffectiveCmEnrollmentAsync(name);

Create()

public static CmEnrollmentServiceClient Create()

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

Returns
Type Description
CmEnrollmentServiceClient

The created CmEnrollmentServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskCmEnrollmentServiceClient

The task representing the created CmEnrollmentServiceClient.

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.

UpdateCmEnrollment(CmEnrollment, FieldMask, CallSettings)

public virtual CmEnrollment UpdateCmEnrollment(CmEnrollment cmEnrollment, FieldMask updateMask, CallSettings callSettings = null)

Updates the Compliance Manager enrollment for a resource to facilitate an audit. Use this method to enroll a resource in Compliance Manager or to create or update feature-specific configurations.

Parameters
Name Description
cmEnrollment CmEnrollment

Required. The Compliance Manager enrollment to update. The name field is used to identify the settings that you want to update.

updateMask FieldMask

Optional. The list of fields that you want to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CmEnrollment

The RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = CmEnrollmentServiceClient.Create();
// Initialize request argument(s)
CmEnrollment cmEnrollment = new CmEnrollment();
FieldMask updateMask = new FieldMask();
// Make the request
CmEnrollment response = cmEnrollmentServiceClient.UpdateCmEnrollment(cmEnrollment, updateMask);

UpdateCmEnrollment(UpdateCmEnrollmentRequest, CallSettings)

public virtual CmEnrollment UpdateCmEnrollment(UpdateCmEnrollmentRequest request, CallSettings callSettings = null)

Updates the Compliance Manager enrollment for a resource to facilitate an audit. Use this method to enroll a resource in Compliance Manager or to create or update feature-specific configurations.

Parameters
Name Description
request UpdateCmEnrollmentRequest

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
CmEnrollment

The RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = CmEnrollmentServiceClient.Create();
// Initialize request argument(s)
UpdateCmEnrollmentRequest request = new UpdateCmEnrollmentRequest
{
    CmEnrollment = new CmEnrollment(),
    UpdateMask = new FieldMask(),
};
// Make the request
CmEnrollment response = cmEnrollmentServiceClient.UpdateCmEnrollment(request);

UpdateCmEnrollmentAsync(CmEnrollment, FieldMask, CallSettings)

public virtual Task<CmEnrollment> UpdateCmEnrollmentAsync(CmEnrollment cmEnrollment, FieldMask updateMask, CallSettings callSettings = null)

Updates the Compliance Manager enrollment for a resource to facilitate an audit. Use this method to enroll a resource in Compliance Manager or to create or update feature-specific configurations.

Parameters
Name Description
cmEnrollment CmEnrollment

Required. The Compliance Manager enrollment to update. The name field is used to identify the settings that you want to update.

updateMask FieldMask

Optional. The list of fields that you want to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCmEnrollment

A Task containing the RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = await CmEnrollmentServiceClient.CreateAsync();
// Initialize request argument(s)
CmEnrollment cmEnrollment = new CmEnrollment();
FieldMask updateMask = new FieldMask();
// Make the request
CmEnrollment response = await cmEnrollmentServiceClient.UpdateCmEnrollmentAsync(cmEnrollment, updateMask);

UpdateCmEnrollmentAsync(CmEnrollment, FieldMask, CancellationToken)

public virtual Task<CmEnrollment> UpdateCmEnrollmentAsync(CmEnrollment cmEnrollment, FieldMask updateMask, CancellationToken cancellationToken)

Updates the Compliance Manager enrollment for a resource to facilitate an audit. Use this method to enroll a resource in Compliance Manager or to create or update feature-specific configurations.

Parameters
Name Description
cmEnrollment CmEnrollment

Required. The Compliance Manager enrollment to update. The name field is used to identify the settings that you want to update.

updateMask FieldMask

Optional. The list of fields that you want to update.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskCmEnrollment

A Task containing the RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = await CmEnrollmentServiceClient.CreateAsync();
// Initialize request argument(s)
CmEnrollment cmEnrollment = new CmEnrollment();
FieldMask updateMask = new FieldMask();
// Make the request
CmEnrollment response = await cmEnrollmentServiceClient.UpdateCmEnrollmentAsync(cmEnrollment, updateMask);

UpdateCmEnrollmentAsync(UpdateCmEnrollmentRequest, CallSettings)

public virtual Task<CmEnrollment> UpdateCmEnrollmentAsync(UpdateCmEnrollmentRequest request, CallSettings callSettings = null)

Updates the Compliance Manager enrollment for a resource to facilitate an audit. Use this method to enroll a resource in Compliance Manager or to create or update feature-specific configurations.

Parameters
Name Description
request UpdateCmEnrollmentRequest

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
TaskCmEnrollment

A Task containing the RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = await CmEnrollmentServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateCmEnrollmentRequest request = new UpdateCmEnrollmentRequest
{
    CmEnrollment = new CmEnrollment(),
    UpdateMask = new FieldMask(),
};
// Make the request
CmEnrollment response = await cmEnrollmentServiceClient.UpdateCmEnrollmentAsync(request);

UpdateCmEnrollmentAsync(UpdateCmEnrollmentRequest, CancellationToken)

public virtual Task<CmEnrollment> UpdateCmEnrollmentAsync(UpdateCmEnrollmentRequest request, CancellationToken cancellationToken)

Updates the Compliance Manager enrollment for a resource to facilitate an audit. Use this method to enroll a resource in Compliance Manager or to create or update feature-specific configurations.

Parameters
Name Description
request UpdateCmEnrollmentRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskCmEnrollment

A Task containing the RPC response.

Example
// Create client
CmEnrollmentServiceClient cmEnrollmentServiceClient = await CmEnrollmentServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateCmEnrollmentRequest request = new UpdateCmEnrollmentRequest
{
    CmEnrollment = new CmEnrollment(),
    UpdateMask = new FieldMask(),
};
// Make the request
CmEnrollment response = await cmEnrollmentServiceClient.UpdateCmEnrollmentAsync(request);