# App Optimize V1BETA API - Class Google::Cloud::Appoptimize::V1beta::AppOptimize::Client (v0.2.0)

0.2.0 (latest) 0.1.0 Reference documentation and code samples for the App Optimize V1BETA API class Google::Cloud::Appoptimize::V1beta::AppOptimize::Client.

Client for the AppOptimize service.


<br />

Service for managing and querying optimization reports.

## Inherits

- Object

## Includes

- [Google::Cloud::Appoptimize::V1beta::AppOptimize::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-AppOptimize-Paths)

## Methods

### .configure

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

Configure the AppOptimize Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-AppOptimize-Client-Configuration "Google::Cloud::Appoptimize::V1beta::AppOptimize::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-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-AppOptimize-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-AppOptimize-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all AppOptimize clients
::Google::Cloud::Appoptimize::V1beta::AppOptimize::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

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

Configure the AppOptimize 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-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-AppOptimize-Client#Google__Cloud__Appoptimize__V1beta__AppOptimize__Client_configure_class_ "Google::Cloud::Appoptimize::V1beta::AppOptimize::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-AppOptimize-Client-Configuration "Google::Cloud::Appoptimize::V1beta::AppOptimize::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-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-AppOptimize-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-AppOptimize-Client-Configuration))

### #create_report

    def create_report(request, options = nil) -> ::Gapic::Operation
    def create_report(parent: nil, report_id: nil, report: nil) -> ::Gapic::Operation

Creates a new report.


<br />

This initiates a long-running operation that, upon completion, results
in a report resource. Once the report is created, its results can be read
via `ReadReport`.
**Overloads**

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

Pass arguments to `create_report` via a request object, either of type [CreateReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-CreateReportRequest "Google::Cloud::Appoptimize::V1beta::CreateReportRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Appoptimize::V1beta::CreateReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-CreateReportRequest), ::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_report(parent: nil, report_id: nil, report: nil) -> ::Gapic::Operation

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

- **parent** (::String) --- Required. The parent Google Cloud project that will own the report.


  This value does not define the scope of the report data. See `Report.scope`
  for setting the data scope.

  Format: `projects/{project}/locations/{location}`.
- **report_id** (::String) --- Required. The ID to use for this report. This ID must be unique within the parent project and should comply with RFC 1034 restrictions (letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum).
- **report** ([::Google::Cloud::Appoptimize::V1beta::Report](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-Report), ::Hash) --- Required. The report resource to create.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::Operation)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

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

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

Basic example

```ruby
require "google/cloud/appoptimize/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Appoptimize::V1beta::AppOptimize::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Appoptimize::V1beta::CreateReportRequest.new

# Call the create_report method.
result = client.create_report 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
```

### #delete_report

    def delete_report(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_report(name: nil, allow_missing: nil) -> ::Google::Protobuf::Empty

Deletes the specified report.
**Overloads**

    def delete_report(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_report` via a request object, either of type [DeleteReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-DeleteReportRequest "Google::Cloud::Appoptimize::V1beta::DeleteReportRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Appoptimize::V1beta::DeleteReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-DeleteReportRequest), ::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 delete_report(name: nil, allow_missing: nil) -> ::Google::Protobuf::Empty

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

- **name** (::String) --- Required. The name of the report to delete.


  Format: `projects/{project}/locations/{location}/reports/{report_id}`.
- **allow_missing** (::Boolean) --- Optional. If set to true, and the report is not found, the request will succeed but no action will be taken on the server.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Protobuf-Empty))
**Raises**

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

Basic example

```ruby
require "google/cloud/appoptimize/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Appoptimize::V1beta::AppOptimize::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Appoptimize::V1beta::DeleteReportRequest.new

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

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_report

    def get_report(request, options = nil) -> ::Google::Cloud::Appoptimize::V1beta::Report
    def get_report(name: nil) -> ::Google::Cloud::Appoptimize::V1beta::Report

Retrieves the details of a report configuration.
**Overloads**

    def get_report(request, options = nil) -> ::Google::Cloud::Appoptimize::V1beta::Report

Pass arguments to `get_report` via a request object, either of type [GetReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-GetReportRequest "Google::Cloud::Appoptimize::V1beta::GetReportRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Appoptimize::V1beta::GetReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-GetReportRequest), ::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_report(name: nil) -> ::Google::Cloud::Appoptimize::V1beta::Report

Pass arguments to `get_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). **Parameter**

- **name** (::String) --- Required. The name of the report to retrieve.


  Format: `projects/{project}/locations/{location}/reports/{report_id}`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Appoptimize::V1beta::Report](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-Report))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Appoptimize::V1beta::Report](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-Report))
**Raises**

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

Basic example

```ruby
require "google/cloud/appoptimize/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Appoptimize::V1beta::AppOptimize::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Appoptimize::V1beta::GetReportRequest.new

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

# The returned object is of type Google::Cloud::Appoptimize::V1beta::Report.
p result
```

### #initialize

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

Create a new AppOptimize client object.
**Yields**

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

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-AppOptimize-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-AppOptimize-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Appoptimize::V1beta::AppOptimize::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Appoptimize::V1beta::AppOptimize::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_reports

    def list_reports(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Appoptimize::V1beta::Report>
    def list_reports(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Appoptimize::V1beta::Report>

Lists reports within a given project.
**Overloads**

    def list_reports(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Appoptimize::V1beta::Report>

Pass arguments to `list_reports` via a request object, either of type [ListReportsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-ListReportsRequest "Google::Cloud::Appoptimize::V1beta::ListReportsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Appoptimize::V1beta::ListReportsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-ListReportsRequest), ::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_reports(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Appoptimize::V1beta::Report>

Pass arguments to `list_reports` 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 project whose reports are to be listed.


  Format: `projects/{project}/locations/{location}`.
- **page_size** (::Integer) --- Optional. The maximum number of reports to return. The service may return fewer than this value. If unspecified, the server will determine the number of results to return.
- **page_token** (::String) --- Optional. A page token, received from a previous `ListReports` call. Provide this to retrieve the subsequent page.


  When paginating, all other parameters provided to `ListReports` must match
  the call that provided the page token.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::Appoptimize::V1beta::Report](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-Report)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Appoptimize::V1beta::Report](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-Report)\>)
**Raises**

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

Basic example

```ruby
require "google/cloud/appoptimize/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Appoptimize::V1beta::AppOptimize::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Appoptimize::V1beta::ListReportsRequest.new

# Call the list_reports method.
result = client.list_reports 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::Appoptimize::V1beta::Report.
  p item
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)

### #operations_client

    def operations_client() -> ::Google::Cloud::Appoptimize::V1beta::AppOptimize::Operations

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

- ([::Google::Cloud::Appoptimize::V1beta::AppOptimize::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-AppOptimize-Operations))

### #read_report

    def read_report(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Protobuf::ListValue>
    def read_report(name: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Protobuf::ListValue>

Reads data within a specified report.
**Overloads**

    def read_report(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Protobuf::ListValue>

Pass arguments to `read_report` via a request object, either of type [ReadReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-ReadReportRequest "Google::Cloud::Appoptimize::V1beta::ReadReportRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Appoptimize::V1beta::ReadReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Cloud-Appoptimize-V1beta-ReadReportRequest), ::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 read_report(name: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Protobuf::ListValue>

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

- **name** (::String) --- Required. The resource name of the report to query.


  Format: `projects/{project}/locations/{location}/reports/{report_id}`.
- **page_size** (::Integer) --- Optional. The maximum number of rows to return. The service may return fewer than this value. If unspecified, at most 10,000 rows will be returned per page. The maximum allowed value is 25,000; values above 25,000 are coerced to 25,000.
- **page_token** (::String) --- Optional. A page token, received from a previous `ReadReport` call, to retrieve the subsequent page of results. When `page_token` is specified, `job_reference` must also be provided from the previous response, and the `statement` field must not be set.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Protobuf::ListValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Protobuf-ListValue)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Protobuf::ListValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_optimize-v1beta/latest/Google-Protobuf-ListValue)\>)
**Raises**

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

Basic example

```ruby
require "google/cloud/appoptimize/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Appoptimize::V1beta::AppOptimize::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Appoptimize::V1beta::ReadReportRequest.new

# Call the read_report method.
result = client.read_report 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::Protobuf::ListValue.
  p item
end
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)