Billing V1 API - Class Google::Cloud::Billing::V1::CloudCatalog::Rest::Client (v0.15.1)

Reference documentation and code samples for the Billing V1 API class Google::Cloud::Billing::V1::CloudCatalog::Rest::Client.

REST client for the CloudCatalog service.

A catalog of Google Cloud Platform services and SKUs. Provides pricing information and metadata on Google Cloud Platform services and SKUs.

Inherits

  • Object

Methods

.configure

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

Configure the CloudCatalog 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 CloudCatalog clients
::Google::Cloud::Billing::V1::CloudCatalog::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the CloudCatalog 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 CloudCatalog REST client object.

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

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

#list_services

def list_services(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Billing::V1::Service>
def list_services(page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Billing::V1::Service>

Lists all public cloud services.

Overloads
def list_services(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Billing::V1::Service>
Pass arguments to list_services via a request object, either of type ListServicesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Billing::V1::ListServicesRequest, ::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_services(page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Billing::V1::Service>
Pass arguments to list_services 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
  • page_size (::Integer) — Requested page size. Defaults to 5000.
  • page_token (::String) — A token identifying a page of results to return. This should be a next_page_token value returned from a previous ListServices call. If unspecified, the first page of results is returned.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/billing/v1"

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

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

# Call the list_services method.
result = client.list_services 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::Billing::V1::Service.
  p item
end

#list_skus

def list_skus(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Billing::V1::Sku>
def list_skus(parent: nil, start_time: nil, end_time: nil, currency_code: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Billing::V1::Sku>

Lists all publicly available SKUs for a given cloud service.

Overloads
def list_skus(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Billing::V1::Sku>
Pass arguments to list_skus via a request object, either of type ListSkusRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Billing::V1::ListSkusRequest, ::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_skus(parent: nil, start_time: nil, end_time: nil, currency_code: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Billing::V1::Sku>
Pass arguments to list_skus 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 name of the service. Example: "services/DA34-426B-A397"
  • start_time (::Google::Protobuf::Timestamp, ::Hash) — Optional inclusive start time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. The time range has to be within a single calendar month in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most).
  • end_time (::Google::Protobuf::Timestamp, ::Hash) — Optional exclusive end time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. The time range has to be within a single calendar month in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most).
  • currency_code (::String) — The ISO 4217 currency code for the pricing info in the response proto. Will use the conversion rate as of start_time. Optional. If not specified USD will be used.
  • page_size (::Integer) — Requested page size. Defaults to 5000.
  • page_token (::String) — A token identifying a page of results to return. This should be a next_page_token value returned from a previous ListSkus call. If unspecified, the first page of results is returned.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/billing/v1"

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

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

# Call the list_skus method.
result = client.list_skus 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::Billing::V1::Sku.
  p item
end