Class: Google::Ads::AdManager::V1::OrderService::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/ads/ad_manager/v1/order_service/rest/client.rb

Overview

REST client for the OrderService service.

Provides methods for handling Order objects.

Defined Under Namespace

Classes: Configuration

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#company_path, #contact_path, #custom_field_path, #label_path, #network_path, #order_path, #team_path, #user_path

Constructor Details

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

Create a new OrderService REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Ads::AdManager::V1::OrderService::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the OrderService client.

Yield Parameters:



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 131

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

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

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

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

  @order_service_stub = ::Google::Ads::AdManager::V1::OrderService::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

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

Class Method Details

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

Configure the OrderService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all OrderService clients
::Google::Ads::AdManager::V1::OrderService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 64

def self.configure
  @configure ||= begin
    namespace = ["Google", "Ads", "AdManager", "V1"]
    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.timeout = 60.0
    default_config.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

#batch_approve_and_overbook_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveAndOverbookOrdersResponse #batch_approve_and_overbook_orders(parent: nil, names: nil, skip_inventory_check: nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveAndOverbookOrdersResponse

Approves and overbooks a list of Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchApproveAndOverbookOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchApproveAndOverbookOrdersResponse.
p result

Overloads:

  • #batch_approve_and_overbook_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveAndOverbookOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchApproveAndOverbookOrdersRequest, ::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.

  • #batch_approve_and_overbook_orders(parent: nil, names: nil, skip_inventory_check: nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveAndOverbookOrdersResponse

    Pass arguments to batch_approve_and_overbook_orders 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to approve and overbook. Format: networks/{network_code}/orders/{order_id}

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

      Optional. Indicates whether the inventory check should be skipped when performing this action.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 703

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchApproveAndOverbookOrdersRequest

  # 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.batch_approve_and_overbook_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_approve_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveOrdersResponse #batch_approve_orders(parent: nil, names: nil, skip_inventory_check: nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveOrdersResponse

Approves a list of Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchApproveOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchApproveOrdersResponse.
p result

Overloads:

  • #batch_approve_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchApproveOrdersRequest, ::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.

  • #batch_approve_orders(parent: nil, names: nil, skip_inventory_check: nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveOrdersResponse

    Pass arguments to batch_approve_orders 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to approve. Format: networks/{network_code}/orders/{order_id}

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

      Optional. Indicates whether the inventory check should be skipped when performing this action.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



618
619
620
621
622
623
624
625
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
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 618

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchApproveOrdersRequest

  # 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.batch_approve_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_approve_orders_without_reservation(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveOrdersWithoutReservationResponse #batch_approve_orders_without_reservation(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveOrdersWithoutReservationResponse

Approves a list of Order objects without changing reservation status.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchApproveOrdersWithoutReservationRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchApproveOrdersWithoutReservationResponse.
p result

Overloads:

  • #batch_approve_orders_without_reservation(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveOrdersWithoutReservationResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchApproveOrdersWithoutReservationRequest, ::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.

  • #batch_approve_orders_without_reservation(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchApproveOrdersWithoutReservationResponse

    Pass arguments to batch_approve_orders_without_reservation 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to approve. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 1283

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchApproveOrdersWithoutReservationRequest

  # 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.batch_approve_orders_without_reservation..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_archive_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchArchiveOrdersResponse #batch_archive_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchArchiveOrdersResponse

Archives a list of Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchArchiveOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchArchiveOrdersResponse.
p result

Overloads:

  • #batch_archive_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchArchiveOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchArchiveOrdersRequest, ::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.

  • #batch_archive_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchArchiveOrdersResponse

    Pass arguments to batch_archive_orders 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to archive. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 1365

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchArchiveOrdersRequest

  # 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.batch_archive_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_create_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchCreateOrdersResponse #batch_create_orders(parent: nil, requests: nil) ⇒ ::Google::Ads::AdManager::V1::BatchCreateOrdersResponse

Creates Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchCreateOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchCreateOrdersResponse.
p result

Overloads:

  • #batch_create_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchCreateOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchCreateOrdersRequest, ::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.

  • #batch_create_orders(parent: nil, requests: nil) ⇒ ::Google::Ads::AdManager::V1::BatchCreateOrdersResponse

    Pass arguments to batch_create_orders 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. The parent resource where Orders will be created. Format: networks/{network_code} The parent field in the CreateOrderRequest must match this field.

    • requests (::Array<::Google::Ads::AdManager::V1::CreateOrderRequest, ::Hash>) (defaults to: nil)

      Required. The Order objects to create. A maximum of 100 objects can be created in a batch.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 449

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchCreateOrdersRequest

  # 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.batch_create_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_delete_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchDeleteOrdersResponse #batch_delete_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchDeleteOrdersResponse

Deletes a list of Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchDeleteOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchDeleteOrdersResponse.
p result

Overloads:

  • #batch_delete_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchDeleteOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchDeleteOrdersRequest, ::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.

  • #batch_delete_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchDeleteOrdersResponse

    Pass arguments to batch_delete_orders 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to delete. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 1529

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchDeleteOrdersRequest

  # 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.batch_delete_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_disapprove_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchDisapproveOrdersResponse #batch_disapprove_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchDisapproveOrdersResponse

Disapproves a list of Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchDisapproveOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchDisapproveOrdersResponse.
p result

Overloads:

  • #batch_disapprove_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchDisapproveOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchDisapproveOrdersRequest, ::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.

  • #batch_disapprove_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchDisapproveOrdersResponse

    Pass arguments to batch_disapprove_orders 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to disapprove. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call 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
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 1611

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchDisapproveOrdersRequest

  # 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.batch_disapprove_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_disapprove_orders_without_reservation_changes(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchDisapproveOrdersWithoutReservationChangesResponse #batch_disapprove_orders_without_reservation_changes(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchDisapproveOrdersWithoutReservationChangesResponse

Disapproves a list of Order objects without changing reservation status.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchDisapproveOrdersWithoutReservationChangesRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchDisapproveOrdersWithoutReservationChangesResponse.
p result

Overloads:

  • #batch_disapprove_orders_without_reservation_changes(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchDisapproveOrdersWithoutReservationChangesResponse

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

    Parameters:

  • #batch_disapprove_orders_without_reservation_changes(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchDisapproveOrdersWithoutReservationChangesResponse

    Pass arguments to batch_disapprove_orders_without_reservation_changes 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to disapprove without reservation changes. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 1693

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchDisapproveOrdersWithoutReservationChangesRequest

  # 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.batch_disapprove_orders_without_reservation_changes..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_pause_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchPauseOrdersResponse #batch_pause_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchPauseOrdersResponse

Pauses a list of Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchPauseOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchPauseOrdersResponse.
p result

Overloads:

  • #batch_pause_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchPauseOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchPauseOrdersRequest, ::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.

  • #batch_pause_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchPauseOrdersResponse

    Pass arguments to batch_pause_orders 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to pause. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 1034

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchPauseOrdersRequest

  # 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.batch_pause_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_resume_and_overbook_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchResumeAndOverbookOrdersResponse #batch_resume_and_overbook_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchResumeAndOverbookOrdersResponse

Resumes and overbooks a list of Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchResumeAndOverbookOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchResumeAndOverbookOrdersResponse.
p result

Overloads:

  • #batch_resume_and_overbook_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchResumeAndOverbookOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchResumeAndOverbookOrdersRequest, ::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.

  • #batch_resume_and_overbook_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchResumeAndOverbookOrdersResponse

    Pass arguments to batch_resume_and_overbook_orders 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to resume and overbook. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 1201

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchResumeAndOverbookOrdersRequest

  # 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.batch_resume_and_overbook_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_resume_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchResumeOrdersResponse #batch_resume_orders(parent: nil, names: nil, skip_inventory_check: nil) ⇒ ::Google::Ads::AdManager::V1::BatchResumeOrdersResponse

Resumes a list of Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchResumeOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchResumeOrdersResponse.
p result

Overloads:

  • #batch_resume_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchResumeOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchResumeOrdersRequest, ::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.

  • #batch_resume_orders(parent: nil, names: nil, skip_inventory_check: nil) ⇒ ::Google::Ads::AdManager::V1::BatchResumeOrdersResponse

    Pass arguments to batch_resume_orders 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to resume. Format: networks/{network_code}/orders/{order_id}

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

      Optional. Indicates whether the inventory check should be skipped when performing this action.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 1119

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchResumeOrdersRequest

  # 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.batch_resume_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_retract_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchRetractOrdersResponse #batch_retract_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchRetractOrdersResponse

Retracts a list of Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchRetractOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchRetractOrdersResponse.
p result

Overloads:

  • #batch_retract_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchRetractOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchRetractOrdersRequest, ::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.

  • #batch_retract_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchRetractOrdersResponse

    Pass arguments to batch_retract_orders 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to retract. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchRetractOrdersRequest

  # 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.batch_retract_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_retract_orders_without_reservation_changes(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchRetractOrdersWithoutReservationChangesResponse #batch_retract_orders_without_reservation_changes(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchRetractOrdersWithoutReservationChangesResponse

Retracts a list of Order objects without changing reservation status.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchRetractOrdersWithoutReservationChangesRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchRetractOrdersWithoutReservationChangesResponse.
p result

Overloads:

  • #batch_retract_orders_without_reservation_changes(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchRetractOrdersWithoutReservationChangesResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchRetractOrdersWithoutReservationChangesRequest, ::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.

  • #batch_retract_orders_without_reservation_changes(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchRetractOrdersWithoutReservationChangesResponse

    Pass arguments to batch_retract_orders_without_reservation_changes 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to retract. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 1857

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchRetractOrdersWithoutReservationChangesRequest

  # 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.batch_retract_orders_without_reservation_changes..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_submit_orders_for_approval(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalResponse #batch_submit_orders_for_approval(parent: nil, names: nil, skip_inventory_check: nil) ⇒ ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalResponse

Submits a list of Order objects for approval.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalResponse.
p result

Overloads:

  • #batch_submit_orders_for_approval(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalRequest, ::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.

  • #batch_submit_orders_for_approval(parent: nil, names: nil, skip_inventory_check: nil) ⇒ ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalResponse

    Pass arguments to batch_submit_orders_for_approval 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to submit for approval. Format: networks/{network_code}/orders/{order_id}

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

      Optional. Indicates whether the inventory check should be skipped when performing this action.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 788

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalRequest

  # 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.batch_submit_orders_for_approval..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_submit_orders_for_approval_and_overbook(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalAndOverbookResponse #batch_submit_orders_for_approval_and_overbook(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalAndOverbookResponse

Submits and overbooks a list of Order objects for approval.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalAndOverbookRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalAndOverbookResponse.
p result

Overloads:

  • #batch_submit_orders_for_approval_and_overbook(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalAndOverbookResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalAndOverbookRequest, ::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.

  • #batch_submit_orders_for_approval_and_overbook(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalAndOverbookResponse

    Pass arguments to batch_submit_orders_for_approval_and_overbook 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. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to submit for approval and overbook. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 869

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalAndOverbookRequest

  # 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.batch_submit_orders_for_approval_and_overbook..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_submit_orders_for_approval_without_reservation_changes(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalWithoutReservationChangesResponse #batch_submit_orders_for_approval_without_reservation_changes(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalWithoutReservationChangesResponse

Submits a list of Order objects for approval without changing reservation status.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalWithoutReservationChangesRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalWithoutReservationChangesResponse.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 952

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchSubmitOrdersForApprovalWithoutReservationChangesRequest

  # 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.batch_submit_orders_for_approval_without_reservation_changes..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_unarchive_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchUnarchiveOrdersResponse #batch_unarchive_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchUnarchiveOrdersResponse

Unarchives a list of Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchUnarchiveOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchUnarchiveOrdersResponse.
p result

Overloads:

  • #batch_unarchive_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchUnarchiveOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchUnarchiveOrdersRequest, ::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.

  • #batch_unarchive_orders(parent: nil, names: nil) ⇒ ::Google::Ads::AdManager::V1::BatchUnarchiveOrdersResponse

    Pass arguments to batch_unarchive_orders 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

    • names (::Array<::String>) (defaults to: nil)

      Required. The resource names of the orders to extract. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
1475
1476
1477
1478
1479
1480
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 1447

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchUnarchiveOrdersRequest

  # 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.batch_unarchive_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#batch_update_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchUpdateOrdersResponse #batch_update_orders(parent: nil, requests: nil) ⇒ ::Google::Ads::AdManager::V1::BatchUpdateOrdersResponse

Batch updates Order objects.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::BatchUpdateOrdersRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::BatchUpdateOrdersResponse.
p result

Overloads:

  • #batch_update_orders(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::BatchUpdateOrdersResponse

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::BatchUpdateOrdersRequest, ::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.

  • #batch_update_orders(parent: nil, requests: nil) ⇒ ::Google::Ads::AdManager::V1::BatchUpdateOrdersResponse

    Pass arguments to batch_update_orders 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. The parent resource where Orders will be updated. Format: networks/{network_code} The parent field in the UpdateOrderRequest must match this field.

    • requests (::Array<::Google::Ads::AdManager::V1::UpdateOrderRequest, ::Hash>) (defaults to: nil)

      Required. The Order objects to update. A maximum of 100 objects can be updated in a batch.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



533
534
535
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
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 533

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::BatchUpdateOrdersRequest

  # 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.batch_update_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

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

Configure the OrderService 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:



101
102
103
104
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 101

def configure
  yield @config if block_given?
  @config
end

#get_order(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::Order #get_order(name: nil) ⇒ ::Google::Ads::AdManager::V1::Order

Retrieves an Order object.

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::GetOrderRequest.new

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

# The returned object is of type Google::Ads::AdManager::V1::Order.
p result

Overloads:

  • #get_order(request, options = nil) ⇒ ::Google::Ads::AdManager::V1::Order

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::GetOrderRequest, ::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_order(name: nil) ⇒ ::Google::Ads::AdManager::V1::Order

    Pass arguments to get_order 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. The resource name of the Order. Format: networks/{network_code}/orders/{order_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
261
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 228

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::GetOrderRequest

  # 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_order..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#list_orders(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Ads::AdManager::V1::Order> #list_orders(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, skip: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Ads::AdManager::V1::Order>

Lists Order objects.

Fields used for literal matching in filter string:

  • order_id
  • display_name
  • external_order_id

Examples:

Basic example

require "google/ads/ad_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Ads::AdManager::V1::OrderService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Ads::AdManager::V1::ListOrdersRequest.new

# Call the list_orders method.
result = client.list_orders 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::Ads::AdManager::V1::Order.
  p item
end

Overloads:

  • #list_orders(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Ads::AdManager::V1::Order>

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

    Parameters:

    • request (::Google::Ads::AdManager::V1::ListOrdersRequest, ::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_orders(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, skip: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Ads::AdManager::V1::Order>

    Pass arguments to list_orders 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. The parent, which owns this collection of Orders. Format: networks/{network_code}

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

      Optional. The maximum number of Orders to return. The service may return fewer than this value. If unspecified, at most 50 Orders will be returned. The maximum value is 1000; values greater than 1000 will be coerced to 1000.

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

      Optional. A page token, received from a previous ListOrders call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to ListOrders must match the call that provided the page token.

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

      Optional. Expression to filter the response. See syntax details at https://developers.google.com/ad-manager/api/beta/filters

      Filterable fields:

      • advertiser
      • agency
      • appliedTeams
      • archived
      • creator
      • displayName
      • endTime
      • externalOrderId
      • impressionsDelivered
      • name
      • orderId
      • poNumber
      • programmatic
      • salesperson
      • secondarySalespeople
      • secondaryTraffickers
      • startTime
      • status
      • totalClicksDelivered
      • totalViewableImpressionsDelivered
      • trafficker
      • updateTime
    • order_by (::String) (defaults to: nil)

      Optional. Expression to specify sorting order. See syntax details at https://developers.google.com/ad-manager/api/beta/filters#order

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

      Optional. Number of individual resources to skip while paginating.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 363

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::AdManager::V1::ListOrdersRequest

  # 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_orders..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::Ads::AdManager::V1::VERSION,
    transports_version_send: [:rest]

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

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

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

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

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


178
179
180
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 178

def logger
  @order_service_stub.logger
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


111
112
113
# File 'lib/google/ads/ad_manager/v1/order_service/rest/client.rb', line 111

def universe_domain
  @order_service_stub.universe_domain
end