Cloud Security Compliance V1 API - Class Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Client (v0.2.0)

Reference documentation and code samples for the Cloud Security Compliance V1 API class Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Client.

Client for the CmEnrollmentService service.

Service describing CmEnrollment related RPCs for complianceManager.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the CmEnrollmentService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all CmEnrollmentService clients
::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Client.configure do |config|
  config.timeout = 10.0
end

#calculate_effective_cm_enrollment

def calculate_effective_cm_enrollment(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentResponse
def calculate_effective_cm_enrollment(name: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentResponse

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.

Overloads
def calculate_effective_cm_enrollment(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentResponse
Pass arguments to calculate_effective_cm_enrollment via a request object, either of type Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentRequest or an equivalent Hash.
Parameters
def calculate_effective_cm_enrollment(name: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentResponse
Pass arguments to calculate_effective_cm_enrollment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • 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
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_security_compliance/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentRequest.new

# Call the calculate_effective_cm_enrollment method.
result = client.calculate_effective_cm_enrollment request

# The returned object is of type Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentResponse.
p result

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the CmEnrollmentService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#initialize

def initialize() { |config| ... } -> Client

Create a new CmEnrollmentService client object.

Yields
  • (config) — Configure the CmEnrollmentService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Client.new do |config|
  config.timeout = 10.0
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_cm_enrollment

def update_cm_enrollment(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollment
def update_cm_enrollment(cm_enrollment: nil, update_mask: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollment

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.

Overloads
def update_cm_enrollment(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollment
Pass arguments to update_cm_enrollment via a request object, either of type UpdateCmEnrollmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudSecurityCompliance::V1::UpdateCmEnrollmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_cm_enrollment(cm_enrollment: nil, update_mask: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollment
Pass arguments to update_cm_enrollment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_security_compliance/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::CloudSecurityCompliance::V1::UpdateCmEnrollmentRequest.new

# Call the update_cm_enrollment method.
result = client.update_cm_enrollment request

# The returned object is of type Google::Cloud::CloudSecurityCompliance::V1::CmEnrollment.
p result