# Cloud Security Compliance V1 API - Class Google::Cloud::CloudSecurityCompliance::V1::Audit::Rest::Client (v0.5.0)

0.5.0 (latest) 0.4.1 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the Cloud Security Compliance V1 API class Google::Cloud::CloudSecurityCompliance::V1::Audit::Rest::Client.

REST client for the Audit service.


<br />

Service describing handlers for resources

## Inherits

- Object

## Includes

- [Google::Cloud::CloudSecurityCompliance::V1::Audit::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Paths)

## Methods

### .configure

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

Configure the Audit Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Rest-Client-Configuration "Google::Cloud::CloudSecurityCompliance::V1::Audit::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all Audit clients
::Google::Cloud::CloudSecurityCompliance::V1::Audit::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

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

Configure the Audit 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Rest-Client#Google__Cloud__CloudSecurityCompliance__V1__Audit__Rest__Client_configure_class_ "Google::Cloud::CloudSecurityCompliance::V1::Audit::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Rest-Client-Configuration "Google::Cloud::CloudSecurityCompliance::V1::Audit::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Rest-Client-Configuration))

### #create_framework_audit

    def create_framework_audit(request, options = nil) -> ::Gapic::Operation
    def create_framework_audit(parent: nil, framework_audit_id: nil, framework_audit: nil) -> ::Gapic::Operation

Creates an audit scope report for a framework.
**Overloads**

    def create_framework_audit(request, options = nil) -> ::Gapic::Operation

Pass arguments to `create_framework_audit` via a request object, either of type [CreateFrameworkAuditRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-CreateFrameworkAuditRequest "Google::Cloud::CloudSecurityCompliance::V1::CreateFrameworkAuditRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::CloudSecurityCompliance::V1::CreateFrameworkAuditRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-CreateFrameworkAuditRequest), ::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 create_framework_audit(parent: nil, framework_audit_id: nil, framework_audit: nil) -> ::Gapic::Operation

Pass arguments to `create_framework_audit` 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**

- **parent** (::String) ---

  Required. The parent resource where this framework audit is created.

  Supported formats are the following:
  - `organizations/{organization_id}/locations/{location}`
  - `folders/{folder_id}/locations/{location}`
  - `projects/{project_id}/locations/{location}`
- **framework_audit_id** (::String) --- Optional. The ID to use for the framework audit. The ID becomes the final component of the framework audit's full resource name.


  The ID must be between 4-63 characters, and valid characters
  are `\[a-z][0-9]-\`.
- **framework_audit** ([::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-FrameworkAudit), ::Hash) --- Required. The framework audit to create.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/cloud_security_compliance/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #generate_framework_audit_scope_report

    def generate_framework_audit_scope_report(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponse
    def generate_framework_audit_scope_report(scope: nil, report_format: nil, compliance_framework: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponse

Generates an audit scope report for a framework.
**Overloads**

    def generate_framework_audit_scope_report(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponse

Pass arguments to `generate_framework_audit_scope_report` via a request object, either of type [GenerateFrameworkAuditScopeReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-GenerateFrameworkAuditScopeReportRequest "Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-GenerateFrameworkAuditScopeReportRequest), ::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 generate_framework_audit_scope_report(scope: nil, report_format: nil, compliance_framework: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponse

Pass arguments to `generate_framework_audit_scope_report` 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**

- **scope** (::String) ---

  Required. The organization, folder or project for the audit report.

  Supported formats are the following:
  - `projects/{project_id}/locations/{location}`
  - `folders/{folder_id}/locations/{location}`
  - `organizations/{organization_id}/locations/{location}`
- **report_format** ([::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportRequest::Format](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-GenerateFrameworkAuditScopeReportRequest-Format)) --- Required. The format that the scope report bytes is returned in.
- **compliance_framework** (::String) --- Required. The compliance framework that the scope report is generated for.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-GenerateFrameworkAuditScopeReportResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-GenerateFrameworkAuditScopeReportResponse))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/cloud_security_compliance/v1"

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

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

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

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

### #get_framework_audit

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

Gets the details for a framework audit.
**Overloads**

    def get_framework_audit(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit

Pass arguments to `get_framework_audit` via a request object, either of type [GetFrameworkAuditRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-GetFrameworkAuditRequest "Google::Cloud::CloudSecurityCompliance::V1::GetFrameworkAuditRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::CloudSecurityCompliance::V1::GetFrameworkAuditRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-GetFrameworkAuditRequest), ::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 get_framework_audit(name: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit

Pass arguments to `get_framework_audit` 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 framework audit to retrieve.

  Supported formats are the following:
  - `organizations/{organization_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
  - `folders/{folder_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
  - `projects/{project_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-FrameworkAudit))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-FrameworkAudit))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/cloud_security_compliance/v1"

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

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

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

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

### #initialize

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

Create a new Audit REST client object.
**Yields**

- (config) --- Configure the Audit client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::CloudSecurityCompliance::V1::Audit::Rest::Client.new

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

### #list_framework_audits

    def list_framework_audits(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit>
    def list_framework_audits(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit>

Lists the framework audits for a given organization, folder, or project.
**Overloads**

    def list_framework_audits(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit>

Pass arguments to `list_framework_audits` via a request object, either of type [ListFrameworkAuditsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-ListFrameworkAuditsRequest "Google::Cloud::CloudSecurityCompliance::V1::ListFrameworkAuditsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::CloudSecurityCompliance::V1::ListFrameworkAuditsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-ListFrameworkAuditsRequest), ::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 list_framework_audits(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit>

Pass arguments to `list_framework_audits` 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**

- **parent** (::String) ---

  Required. The parent resource where the framework audits are listed.

  Supported formats are the following:
  - `organizations/{organization_id}/locations/{location}`
  - `folders/{folder_id}/locations/{location}`
  - `projects/{project_id}/locations/{location}`
- **page_size** (::Integer) --- Optional. The maximum number of framework audits to return. The service might return fewer audits than this value. If unspecified, a maximum of 10 framework audits are returned. The maximum value is 50; values above 50 are limited to 50.
- **page_token** (::String) --- Optional. The `next_page_token` value that's returned from a previous list request, if any.
- **filter** (::String) --- Optional. The filters to apply to the framework audits. Supported filters are `compliance_framework`, `compliance_state`, `create_time,` and `framework_audit_name`. If the filter is invalid, an invalid argument error is returned. For syntax details, see \[AIP-160\]\[https://google.aip.dev/160\].
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-FrameworkAudit)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-FrameworkAudit)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/cloud_security_compliance/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit.
  p item
end
```

### #location_client

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

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

- (Google::Cloud::Location::Locations::Rest::Client)

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::CloudSecurityCompliance::V1::Audit::Rest::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::CloudSecurityCompliance::V1::Audit::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Rest-Operations))

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)