Reference documentation and code samples for the Locations API class Google::Cloud::Location::Locations::Rest::Client.
REST client for the Locations service.
An abstract interface that provides location-related information for a service. Service-specific metadata is provided through the Location.metadata field.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the Locations Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all Locations clients ::Google::Cloud::Location::Locations::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the Locations 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)
#get_location
def get_location(request, options = nil) -> ::Google::Cloud::Location::Location
def get_location(name: nil) -> ::Google::Cloud::Location::Location
Gets information about a location.
def get_location(request, options = nil) -> ::Google::Cloud::Location::Location
get_location
via a request object, either of type
GetLocationRequest or an equivalent Hash.
- request (::Google::Cloud::Location::GetLocationRequest, ::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_location(name: nil) -> ::Google::Cloud::Location::Location
get_location
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) — Resource name for the location.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Location::Location)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/location" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Location::Locations::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Location::GetLocationRequest.new # Call the get_location method. result = client.get_location request # The returned object is of type Google::Cloud::Location::Location. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new Locations REST client object.
- (config) — Configure the Locations client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Location::Locations::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Location::Locations::Rest::Client.new do |config| config.timeout = 10.0 end
#list_locations
def list_locations(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Location::Location>
def list_locations(name: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Location::Location>
Lists information about the supported locations for this service.
def list_locations(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Location::Location>
list_locations
via a request object, either of type
Google::Cloud::Location::ListLocationsRequest or an equivalent Hash.
- request (::Google::Cloud::Location::ListLocationsRequest, ::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_locations(name: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Location::Location>
list_locations
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) — The resource that owns the locations collection, if applicable.
- filter (::String) — The standard list filter.
- page_size (::Integer) — The standard list page size.
- page_token (::String) — The standard list page token.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Location::Location>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Location::Location>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/location" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Location::Locations::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Location::ListLocationsRequest.new # Call the list_locations method. result = client.list_locations 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::Location::Location. p item end
#logger
def logger() -> Logger
The logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)