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

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

Overview

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 client object.

Examples:


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

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

Yields:

  • (config)

    Configure the CommerceTransaction client.

Yield Parameters:



203
204
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
255
256
257
258
259
260
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 203

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/commerceproducer/v1beta/commerce_transaction_services_pb"

  # 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 = ::Gapic::ServiceStub.new(
    ::Google::Cloud::CommerceProducer::V1beta::CommerceTransaction::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool,
    logger: @config.logger
  )

  @commerce_transaction_stub.stub_logger&.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::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.logger = @commerce_transaction_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

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

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

Returns:

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


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

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::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



63
64
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
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 63

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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 1074

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :cancel_private_offer, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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:



173
174
175
176
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 173

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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 808

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :create_private_offer, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 1435

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :create_private_offer_document, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 1162

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :delete_private_offer, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1611
1612
1613
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
1650
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 1611

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :delete_private_offer_document, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 626

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_private_offer, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 1348

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_private_offer_document, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 424

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_service, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 1901

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_sku, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 2087

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_sku_group, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 1816

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_standard_offer, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_private_offer_documents(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::PrivateOfferDocument> #list_private_offer_documents(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::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::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::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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1261
1262
1263
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
1298
1299
1300
1301
1302
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 1261

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_private_offer_documents, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @commerce_transaction_stub, :list_private_offer_documents, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_private_offers(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::PrivateOffer> #list_private_offers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::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::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::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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 536

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_private_offers, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @commerce_transaction_stub, :list_private_offers, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
363
364
365
366
367
368
369
370
371
372
373
374
375
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 334

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_services, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @commerce_transaction_stub, :list_services, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_sku_groups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::SkuGroup> #list_sku_groups(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::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::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::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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 2186

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_sku_groups, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @commerce_transaction_stub, :list_sku_groups, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_skus(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::Sku> #list_skus(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::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::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::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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 2000

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_skus, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @commerce_transaction_stub, :list_skus, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_standard_offers(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::CommerceProducer::V1beta::StandardOffer> #list_standard_offers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::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::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::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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 1726

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_standard_offers, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @commerce_transaction_stub, :list_standard_offers, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


274
275
276
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 274

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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 986

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :publish_private_offer, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 721

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :resolve_amendment_target, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


183
184
185
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 183

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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 899

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.private_offer&.name
    header_params["private_offer.name"] = request.private_offer.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :update_private_offer, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
# File 'lib/google/cloud/commerce_producer/v1beta/commerce_transaction/client.rb', line 1526

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.private_offer_document&.name
    header_params["private_offer_document.name"] = request.private_offer_document.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :update_private_offer_document, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end