Reference documentation and code samples for the Cloud Security Compliance V1 API class Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Rest::Client.
REST client for the CmEnrollmentService service.
Service describing CmEnrollment related RPCs for complianceManager.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the CmEnrollmentService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all CmEnrollmentService clients ::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Rest::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::CalculateEffectiveCmEnrollmentResponseCalculates 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.
def calculate_effective_cm_enrollment(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentResponsecalculate_effective_cm_enrollment via a request object, either of type
Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentRequest or an equivalent Hash.
- request (::Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentRequest, ::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 calculate_effective_cm_enrollment(name: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentResponsecalculate_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).
-
name (::String) —
Required. The name of the Compliance Manager enrollment to calculate.
Supported formats are the following:
organizations/{organization_id}/locations/{location}/cmEnrollmentfolders/{folder_id}/locations/{location}/cmEnrollmentprojects/{project_id}/locations/{location}/cmEnrollment
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::CloudSecurityCompliance::V1::CalculateEffectiveCmEnrollmentResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#initialize
def initialize() { |config| ... } -> ClientCreate a new CmEnrollmentService REST client object.
- (config) — Configure the CmEnrollmentService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Rest::Client.new do |config| config.timeout = 10.0 end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (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::CmEnrollmentUpdates 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.
def update_cm_enrollment(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentupdate_cm_enrollment via a request object, either of type
UpdateCmEnrollmentRequest or an equivalent Hash.
- 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::CmEnrollmentupdate_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).
-
cm_enrollment (::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollment, ::Hash) — Required. The Compliance Manager enrollment to update.
The
namefield is used to identify the settings that you want to update. - update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. The list of fields that you want to update.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::CloudSecurityCompliance::V1::CmEnrollment)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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