Class: Google::Cloud::CommerceProducer::V1beta::CommerceTransaction::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb

Overview

REST client for the CommerceTransaction service.

APIs related to managing resources that model commercial transactions.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#billing_account_path, #location_path, #private_offer_document_path, #private_offer_path, #service_path, #sku_group_path, #sku_path, #standard_offer_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new CommerceTransaction REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::CommerceProducer::V1beta::CommerceTransaction::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::CommerceProducer::V1beta::CommerceTransaction::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the CommerceTransaction client.

Yield Parameters:



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 205

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @commerce_transaction_stub = ::Google::Cloud::CommerceProducer::V1beta::CommerceTransaction::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @commerce_transaction_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @commerce_transaction_stub.endpoint
    config.universe_domain = @commerce_transaction_stub.universe_domain
    config.bindings_override = @config.bindings_override
    config.logger = @commerce_transaction_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

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

Returns:

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


261
262
263
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 261

def location_client
  @location_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the CommerceTransaction Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all CommerceTransaction clients
::Google::Cloud::CommerceProducer::V1beta::CommerceTransaction::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 65

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "CommerceProducer", "V1beta"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.list_services.timeout = 60.0
    default_config.rpcs.list_services.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_service.timeout = 60.0
    default_config.rpcs.get_service.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_private_offers.timeout = 60.0
    default_config.rpcs.list_private_offers.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_private_offer.timeout = 60.0
    default_config.rpcs.get_private_offer.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.resolve_amendment_target.timeout = 60.0

    default_config.rpcs.create_private_offer.timeout = 60.0

    default_config.rpcs.update_private_offer.timeout = 60.0

    default_config.rpcs.publish_private_offer.timeout = 60.0

    default_config.rpcs.cancel_private_offer.timeout = 60.0

    default_config.rpcs.delete_private_offer.timeout = 60.0

    default_config.rpcs.list_private_offer_documents.timeout = 60.0
    default_config.rpcs.list_private_offer_documents.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_private_offer_document.timeout = 60.0
    default_config.rpcs.get_private_offer_document.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_private_offer_document.timeout = 60.0

    default_config.rpcs.update_private_offer_document.timeout = 60.0

    default_config.rpcs.delete_private_offer_document.timeout = 60.0

    default_config.rpcs.list_standard_offers.timeout = 60.0
    default_config.rpcs.list_standard_offers.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_standard_offer.timeout = 60.0
    default_config.rpcs.get_standard_offer.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_sku.timeout = 60.0
    default_config.rpcs.get_sku.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_skus.timeout = 60.0
    default_config.rpcs.list_skus.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_sku_group.timeout = 60.0
    default_config.rpcs.get_sku_group.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_sku_groups.timeout = 60.0
    default_config.rpcs.list_sku_groups.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#cancel_private_offer(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer #cancel_private_offer(name: nil, cancellation_note: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer

Cancels the target PrivateOffer.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::PrivateOffer.
p result

Overloads:

  • #cancel_private_offer(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer

    Pass arguments to cancel_private_offer via a request object, either of type Google::Cloud::CommerceProducer::V1beta::CancelPrivateOfferRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::CancelPrivateOfferRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #cancel_private_offer(name: nil, cancellation_note: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer

    Pass arguments to cancel_private_offer 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) (defaults to: nil)

      Required. Name of the resource

    • cancellation_note (::String) (defaults to: nil)

      Optional. Internal note relating to the cancellation. Stored on the cancelled offer. Not visible to customers.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1011

def cancel_private_offer request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::CancelPrivateOfferRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.cancel_private_offer..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.cancel_private_offer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.cancel_private_offer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.cancel_private_offer request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#configure {|config| ... } ⇒ Client::Configuration

Configure the CommerceTransaction 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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



175
176
177
178
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 175

def configure
  yield @config if block_given?
  @config
end

#create_private_offer(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer #create_private_offer(parent: nil, private_offer: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer

Creates a new PrivateOffer in a given project and location.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::PrivateOffer.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 766

def create_private_offer request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::CreatePrivateOfferRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_private_offer..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_private_offer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_private_offer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.create_private_offer request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_private_offer_document(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument #create_private_offer_document(parent: nil, private_offer_document: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument

Creates a new PrivateOfferDocument in a given project and location.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1344

def create_private_offer_document request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::CreatePrivateOfferDocumentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_private_offer_document..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_private_offer_document.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_private_offer_document.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.create_private_offer_document request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_private_offer(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_private_offer(name: nil, force: nil) ⇒ ::Google::Protobuf::Empty

Deletes the target PrivateOffer.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

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

Overloads:

  • #delete_private_offer(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_private_offer via a request object, either of type DeletePrivateOfferRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::DeletePrivateOfferRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_private_offer(name: nil, force: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_private_offer 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) (defaults to: nil)

      Required. Name of the resource

    • force (::Boolean) (defaults to: nil)

      Optional. Indicates whether to cascade the delete to child resources. If false, the request fails if child resources exist.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1092

def delete_private_offer request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::DeletePrivateOfferRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_private_offer..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_private_offer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_private_offer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.delete_private_offer request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_private_offer_document(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_private_offer_document(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes the target PrivateOfferDocument.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

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

Overloads:

  • #delete_private_offer_document(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_private_offer_document via a request object, either of type DeletePrivateOfferDocumentRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::DeletePrivateOfferDocumentRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_private_offer_document(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_private_offer_document 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) (defaults to: nil)

      Required. Name of the resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1506

def delete_private_offer_document request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::DeletePrivateOfferDocumentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_private_offer_document..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_private_offer_document.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_private_offer_document.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.delete_private_offer_document request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_private_offer(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer #get_private_offer(name: nil, view: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer

Gets details of a single PrivateOffer.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::PrivateOffer.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 598

def get_private_offer request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::GetPrivateOfferRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_private_offer..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_private_offer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_private_offer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.get_private_offer request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_private_offer_document(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument #get_private_offer_document(name: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument

Gets details of a single PrivateOfferDocument.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1264

def get_private_offer_document request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::GetPrivateOfferDocumentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_private_offer_document..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_private_offer_document.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_private_offer_document.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.get_private_offer_document request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_service(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::Service #get_service(name: nil, view: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::Service

Gets details of a single Service.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::Service.
p result

Overloads:

  • #get_service(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::Service

    Pass arguments to get_service via a request object, either of type GetServiceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::GetServiceRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_service(name: nil, view: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::Service

    Pass arguments to get_service 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:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 410

def get_service request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::GetServiceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_service..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_service.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_service.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.get_service request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_sku(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::Sku #get_sku(name: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::Sku

Gets details of a single Sku.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::Sku.
p result

Overloads:

  • #get_sku(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::Sku

    Pass arguments to get_sku via a request object, either of type GetSkuRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::GetSkuRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_sku(name: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::Sku

    Pass arguments to get_sku 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) (defaults to: nil)

      Required. Name of the resource

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1775

def get_sku request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::GetSkuRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_sku..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_sku.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_sku.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.get_sku request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_sku_group(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::SkuGroup #get_sku_group(name: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::SkuGroup

Gets details of a single SkuGroup.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::SkuGroup.
p result

Overloads:

  • #get_sku_group(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::SkuGroup

    Pass arguments to get_sku_group via a request object, either of type GetSkuGroupRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::GetSkuGroupRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_sku_group(name: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::SkuGroup

    Pass arguments to get_sku_group 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) (defaults to: nil)

      Required. Name of the resource

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1947

def get_sku_group request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::GetSkuGroupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_sku_group..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_sku_group.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_sku_group.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.get_sku_group request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_standard_offer(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::StandardOffer #get_standard_offer(name: nil, view: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::StandardOffer

Gets details of a single StandardOffer.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::StandardOffer.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1697

def get_standard_offer request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::GetStandardOfferRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_standard_offer..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_standard_offer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_standard_offer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.get_standard_offer request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_private_offer_documents(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument> #list_private_offer_documents(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument>

Lists PrivateOfferDocuments for the given parent.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

# Call the list_private_offer_documents method.
result = client.list_private_offer_documents 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::CommerceProducer::V1beta::PrivateOfferDocument.
  p item
end

Overloads:

  • #list_private_offer_documents(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument>

    Pass arguments to list_private_offer_documents via a request object, either of type ListPrivateOfferDocumentsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::ListPrivateOfferDocumentsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_private_offer_documents(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument>

    Pass arguments to list_private_offer_documents 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) (defaults to: nil)

      Required. Parent value for ListPrivateOfferDocumentsRequest.

    • page_size (::Integer) (defaults to: nil)

      Optional. Maximum results to return. The service may return fewer than this value. The maximum value is 500; values above 500 will be coerced to 500. If unspecified, the server will default to the maximum.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous list response message. Provide this to retrieve the subsequent page.

      When paginating, all other parameters of the list request must match the request that returned the page token.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1184

def list_private_offer_documents request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::ListPrivateOfferDocumentsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_private_offer_documents..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_private_offer_documents.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_private_offer_documents.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.list_private_offer_documents request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @commerce_transaction_stub, :list_private_offer_documents, "private_offer_documents", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_private_offers(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::PrivateOffer> #list_private_offers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::PrivateOffer>

Lists PrivateOffers for the given parent.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

# Call the list_private_offers method.
result = client.list_private_offers 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::CommerceProducer::V1beta::PrivateOffer.
  p item
end

Overloads:

  • #list_private_offers(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::PrivateOffer>

    Pass arguments to list_private_offers via a request object, either of type ListPrivateOffersRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::ListPrivateOffersRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_private_offers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::PrivateOffer>

    Pass arguments to list_private_offers 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) (defaults to: nil)

      Required. Parent value for ListPrivateOffersRequest

    • page_size (::Integer) (defaults to: nil)

      Optional. Maximum results to return. The service may return fewer than this value. The maximum value is 500; values above 500 will be coerced to 500. If unspecified, the server will default to the maximum.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous list response message. Provide this to retrieve the subsequent page.

      When paginating, all other parameters of the list request must match the request that returned the page token.

    • filter (::String) (defaults to: nil)

      Optional. Filter expression that matches a subset of resources to show. See https://google.aip.dev/160 for more details. Only supports filtering by:

      • update_time. Example: update_time > "2012-04-21T11:30:00-04:00".
    • order_by (::String) (defaults to: nil)

      Optional. Ordering expression for sorting the results. See https://google.aip.dev/132#ordering for more details. If no value is present the default ordering is unspecified. Only supports ordering by:

      • update_time

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 515

def list_private_offers request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::ListPrivateOffersRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_private_offers..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_private_offers.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_private_offers.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.list_private_offers request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @commerce_transaction_stub, :list_private_offers, "private_offers", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_services(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::Service> #list_services(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::Service>

Lists Services in a given project and location.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::CommerceProducer::V1beta::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::CommerceProducer::V1beta::Service.
  p item
end

Overloads:

  • #list_services(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::Service>

    Pass arguments to list_services via a request object, either of type ListServicesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_services(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::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:

    • parent (::String) (defaults to: nil)

      Required. Parent value for ListServicesRequest

    • page_size (::Integer) (defaults to: nil)

      Optional. Maximum results to return. The service may return fewer than this value. The maximum value is 500; values above 500 will be coerced to 500. If unspecified, the server will default to the maximum.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 327

def list_services request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::ListServicesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_services..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_services.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_services.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.list_services request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @commerce_transaction_stub, :list_services, "services", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_sku_groups(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::SkuGroup> #list_sku_groups(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::SkuGroup>

Lists SkuGroups for the given parent.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

# Call the list_sku_groups method.
result = client.list_sku_groups 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::CommerceProducer::V1beta::SkuGroup.
  p item
end

Overloads:

  • #list_sku_groups(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::SkuGroup>

    Pass arguments to list_sku_groups via a request object, either of type ListSkuGroupsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::ListSkuGroupsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_sku_groups(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::SkuGroup>

    Pass arguments to list_sku_groups 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) (defaults to: nil)

      Required. Parent value for ListSkuGroupsRequest

    • page_size (::Integer) (defaults to: nil)

      Optional. Maximum results to return. The service may return fewer than this value. The maximum value is 500; values above 500 will be coerced to 500. If unspecified, the server will default to the maximum.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous list response message. Provide this to retrieve the subsequent page.

      When paginating, all other parameters of the list request must match the request that returned the page token.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 2039

def list_sku_groups request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::ListSkuGroupsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_sku_groups..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_sku_groups.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_sku_groups.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.list_sku_groups request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @commerce_transaction_stub, :list_sku_groups, "sku_groups", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_skus(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::Sku> #list_skus(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::Sku>

Lists Skus for the given parent.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::CommerceProducer::V1beta::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::CommerceProducer::V1beta::Sku.
  p item
end

Overloads:

  • #list_skus(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::Sku>

    Pass arguments to list_skus via a request object, either of type ListSkusRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_skus(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::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) (defaults to: nil)

      Required. Parent value for ListSkusRequest

    • page_size (::Integer) (defaults to: nil)

      Optional. Maximum results to return. The service may return fewer than this value. The maximum value is 500; values above 500 will be coerced to 500. If unspecified, the server will default to the maximum.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous list response message. Provide this to retrieve the subsequent page.

      When paginating, all other parameters of the list request must match the request that returned the page token.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1867

def list_skus request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::ListSkusRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_skus..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_skus.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_skus.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.list_skus request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @commerce_transaction_stub, :list_skus, "skus", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_standard_offers(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::StandardOffer> #list_standard_offers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::StandardOffer>

Lists StandardOffers for the given parent.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

# Call the list_standard_offers method.
result = client.list_standard_offers 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::CommerceProducer::V1beta::StandardOffer.
  p item
end

Overloads:

  • #list_standard_offers(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::StandardOffer>

    Pass arguments to list_standard_offers via a request object, either of type ListStandardOffersRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::ListStandardOffersRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_standard_offers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::StandardOffer>

    Pass arguments to list_standard_offers 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) (defaults to: nil)

      Required. Parent value for ListStandardOffersRequest

    • page_size (::Integer) (defaults to: nil)

      Optional. Maximum results to return. The service may return fewer than this value. The maximum value is 500; values above 500 will be coerced to 500. If unspecified, the server will default to the maximum.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous list response message. Provide this to retrieve the subsequent page.

      When paginating, all other parameters of the list request must match the request that returned the page token.

    • filter (::String) (defaults to: nil)

      Optional. Filter expression that matches a subset of resources to show. See https://google.aip.dev/160 for more details. Supports filtering by:

      • effective_time. Example: effective_time > "2012-04-21T11:30:00-04:00".
      • expire_time. Example: expire_time < "2026-05-06T00:00:00Z".
    • order_by (::String) (defaults to: nil)

      Optional. Ordering expression for sorting the results. See https://google.aip.dev/132#ordering for more details. If no value is present the default ordering is unspecified. Supports ordering by:

      • effective_time
      • expire_time

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1614

def list_standard_offers request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::ListStandardOffersRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_standard_offers..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_standard_offers.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_standard_offers.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.list_standard_offers request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @commerce_transaction_stub, :list_standard_offers, "standard_offers", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


268
269
270
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 268

def logger
  @commerce_transaction_stub.logger
end

#publish_private_offer(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer #publish_private_offer(name: nil, validate_only: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer

Publishes the target PrivateOffer.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::PrivateOffer.
p result

Overloads:

  • #publish_private_offer(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer

    Pass arguments to publish_private_offer via a request object, either of type PublishPrivateOfferRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::PublishPrivateOfferRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #publish_private_offer(name: nil, validate_only: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer

    Pass arguments to publish_private_offer 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) (defaults to: nil)

      Required. Name of the resource

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set to true, validates the request but does not execute it.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 930

def publish_private_offer request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::PublishPrivateOfferRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.publish_private_offer..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.publish_private_offer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.publish_private_offer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.publish_private_offer request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#resolve_amendment_target(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::ResolveAmendmentTargetResponse #resolve_amendment_target(parent: nil, target_billing_account: nil, base_standard_offer: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::ResolveAmendmentTargetResponse

Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::ResolveAmendmentTargetResponse.
p result

Overloads:

  • #resolve_amendment_target(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::ResolveAmendmentTargetResponse

    Pass arguments to resolve_amendment_target via a request object, either of type ResolveAmendmentTargetRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::ResolveAmendmentTargetRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #resolve_amendment_target(parent: nil, target_billing_account: nil, base_standard_offer: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::ResolveAmendmentTargetResponse

    Pass arguments to resolve_amendment_target 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) (defaults to: nil)

      Required. Parent value for ResolveAmendmentTargetRequest

    • target_billing_account (::String) (defaults to: nil)

      Required. The customer's billing account targeted by the offer. This is the billing account for which the new private offer will be created on. Format: billingAccounts/{billing_account}.

    • base_standard_offer (::String) (defaults to: nil)

      Required. The base standard offer that the private offer will be based on. Format: projects/{project}/locations/{location}/services/{service}/standardOffers/{standard_offer}.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 686

def resolve_amendment_target request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::ResolveAmendmentTargetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.resolve_amendment_target..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.resolve_amendment_target.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.resolve_amendment_target.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.resolve_amendment_target request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


185
186
187
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 185

def universe_domain
  @commerce_transaction_stub.universe_domain
end

#update_private_offer(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer #update_private_offer(update_mask: nil, private_offer: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer

Updates the target PrivateOffer.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::PrivateOffer.
p result

Overloads:

  • #update_private_offer(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer

    Pass arguments to update_private_offer via a request object, either of type UpdatePrivateOfferRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::CommerceProducer::V1beta::UpdatePrivateOfferRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_private_offer(update_mask: nil, private_offer: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOffer

    Pass arguments to update_private_offer 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:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Optional. The list of fields to update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. The special value "*" means full replacement. If unspecified, all fields present in the request will be overwritten.

    • private_offer (::Google::Cloud::CommerceProducer::V1beta::PrivateOffer, ::Hash) (defaults to: nil)

      Required. The resource being updated

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 850

def update_private_offer request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::UpdatePrivateOfferRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_private_offer..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_private_offer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_private_offer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.update_private_offer request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_private_offer_document(request, options = nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument #update_private_offer_document(private_offer_document: nil, update_mask: nil) ⇒ ::Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument

Updates the target PrivateOfferDocument.

Examples:

Basic example

require "google/cloud/commerce_producer/v1beta"

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

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

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

# The returned object is of type Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/rest/client.rb', line 1428

def update_private_offer_document request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CommerceProducer::V1beta::UpdatePrivateOfferDocumentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_private_offer_document..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::CommerceProducer::V1beta::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_private_offer_document.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_private_offer_document.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @commerce_transaction_stub.update_private_offer_document request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end