// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.ads.admanager.v1;

import "google/ads/admanager/v1/order_messages.proto";
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";

option csharp_namespace = "Google.Ads.AdManager.V1";
option go_package = "google.golang.org/genproto/googleapis/ads/admanager/v1;admanager";
option java_multiple_files = true;
option java_outer_classname = "OrderServiceProto";
option java_package = "com.google.ads.admanager.v1";
option php_namespace = "Google\\Ads\\AdManager\\V1";
option ruby_package = "Google::Ads::AdManager::V1";

// Provides methods for handling `Order` objects.
service OrderService {
  option (google.api.default_host) = "admanager.googleapis.com";
  option (google.api.oauth_scopes) =
      "https://www.googleapis.com/auth/admanager,"
      "https://www.googleapis.com/auth/admanager.readonly";

  // Retrieves an `Order` object.
  rpc GetOrder(GetOrderRequest) returns (Order) {
    option (google.api.http) = {
      get: "/v1/{name=networks/*/orders/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Lists `Order` objects.
  //
  // Fields used for literal matching in filter string:
  // * `order_id`
  // * `display_name`
  // * `external_order_id`
  rpc ListOrders(ListOrdersRequest) returns (ListOrdersResponse) {
    option (google.api.http) = {
      get: "/v1/{parent=networks/*}/orders"
    };
    option (google.api.method_signature) = "parent";
  }

  // Creates `Order` objects.
  rpc BatchCreateOrders(BatchCreateOrdersRequest)
      returns (BatchCreateOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchCreate"
      body: "*"
    };
    option (google.api.method_signature) = "parent,requests";
  }

  // Batch updates `Order` objects.
  rpc BatchUpdateOrders(BatchUpdateOrdersRequest)
      returns (BatchUpdateOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchUpdate"
      body: "*"
    };
    option (google.api.method_signature) = "parent,requests";
  }

  // Approves a list of `Order` objects.
  rpc BatchApproveOrders(BatchApproveOrdersRequest)
      returns (BatchApproveOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchApprove"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Approves and overbooks a list of `Order` objects.
  rpc BatchApproveAndOverbookOrders(BatchApproveAndOverbookOrdersRequest)
      returns (BatchApproveAndOverbookOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchApproveAndOverbook"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Submits a list of `Order` objects for approval.
  rpc BatchSubmitOrdersForApproval(BatchSubmitOrdersForApprovalRequest)
      returns (BatchSubmitOrdersForApprovalResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchSubmitForApproval"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Submits and overbooks a list of `Order` objects for approval.
  rpc BatchSubmitOrdersForApprovalAndOverbook(
      BatchSubmitOrdersForApprovalAndOverbookRequest)
      returns (BatchSubmitOrdersForApprovalAndOverbookResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchSubmitForApprovalAndOverbook"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Submits a list of `Order` objects for approval without changing reservation
  // status.
  rpc BatchSubmitOrdersForApprovalWithoutReservationChanges(
      BatchSubmitOrdersForApprovalWithoutReservationChangesRequest)
      returns (BatchSubmitOrdersForApprovalWithoutReservationChangesResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchSubmitForApprovalWithoutReservationChanges"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Pauses a list of `Order` objects.
  rpc BatchPauseOrders(BatchPauseOrdersRequest)
      returns (BatchPauseOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchPause"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Resumes a list of `Order` objects.
  rpc BatchResumeOrders(BatchResumeOrdersRequest)
      returns (BatchResumeOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchResume"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Resumes and overbooks a list of `Order` objects.
  rpc BatchResumeAndOverbookOrders(BatchResumeAndOverbookOrdersRequest)
      returns (BatchResumeAndOverbookOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchResumeAndOverbook"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Approves a list of `Order` objects without changing reservation status.
  rpc BatchApproveOrdersWithoutReservation(
      BatchApproveOrdersWithoutReservationRequest)
      returns (BatchApproveOrdersWithoutReservationResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchApproveWithoutReservation"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Archives a list of `Order` objects.
  rpc BatchArchiveOrders(BatchArchiveOrdersRequest)
      returns (BatchArchiveOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchArchive"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Unarchives a list of `Order` objects.
  rpc BatchUnarchiveOrders(BatchUnarchiveOrdersRequest)
      returns (BatchUnarchiveOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchUnarchive"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Deletes a list of `Order` objects.
  rpc BatchDeleteOrders(BatchDeleteOrdersRequest)
      returns (BatchDeleteOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchDelete"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Disapproves a list of `Order` objects.
  rpc BatchDisapproveOrders(BatchDisapproveOrdersRequest)
      returns (BatchDisapproveOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchDisapprove"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Disapproves a list of `Order` objects without changing reservation status.
  rpc BatchDisapproveOrdersWithoutReservationChanges(
      BatchDisapproveOrdersWithoutReservationChangesRequest)
      returns (BatchDisapproveOrdersWithoutReservationChangesResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchDisapproveWithoutReservationChanges"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Retracts a list of `Order` objects.
  rpc BatchRetractOrders(BatchRetractOrdersRequest)
      returns (BatchRetractOrdersResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchRetract"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }

  // Retracts a list of `Order` objects without changing reservation status.
  rpc BatchRetractOrdersWithoutReservationChanges(
      BatchRetractOrdersWithoutReservationChangesRequest)
      returns (BatchRetractOrdersWithoutReservationChangesResponse) {
    option (google.api.http) = {
      post: "/v1/{parent=networks/*}/orders:batchRetractWithoutReservationChanges"
      body: "*"
    };
    option (google.api.method_signature) = "parent,names";
  }
}

// Request message for `BatchApproveAndOverbookOrders` method.
message BatchApproveAndOverbookOrdersRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to approve and overbook.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];

  // Optional. Indicates whether the inventory check should be skipped when
  // performing this action.
  bool skip_inventory_check = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Response object for `BatchApproveAndOverbookOrders` method.
message BatchApproveAndOverbookOrdersResponse {}

// Request message for `BatchApproveOrders` method.
message BatchApproveOrdersRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to approve.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];

  // Optional. Indicates whether the inventory check should be skipped when
  // performing this action.
  bool skip_inventory_check = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Response object for `BatchApproveOrders` method.
message BatchApproveOrdersResponse {}

// Request message for `BatchSubmitOrdersForApproval` method.
message BatchSubmitOrdersForApprovalRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to submit for approval.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];

  // Optional. Indicates whether the inventory check should be skipped when
  // performing this action.
  bool skip_inventory_check = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Response object for `BatchSubmitOrdersForApproval` method.
message BatchSubmitOrdersForApprovalResponse {}

// Request message for `BatchSubmitOrdersForApprovalAndOverbook` method.
message BatchSubmitOrdersForApprovalAndOverbookRequest {
  // Required. Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to submit for approval and
  // overbook. Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for `BatchSubmitOrdersForApprovalAndOverbook` method.
message BatchSubmitOrdersForApprovalAndOverbookResponse {}

// Request message for `BatchPauseOrders` method.
message BatchPauseOrdersRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to pause.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for `BatchPauseOrders` method.
message BatchPauseOrdersResponse {}

// Request message for `BatchResumeOrders` method.
message BatchResumeOrdersRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to resume.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];

  // Optional. Indicates whether the inventory check should be skipped when
  // performing this action.
  bool skip_inventory_check = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Response object for `BatchResumeOrders` method.
message BatchResumeOrdersResponse {}

// Request message for `BatchResumeAndOverbookOrders` method.
message BatchResumeAndOverbookOrdersRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to resume and overbook.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for `BatchResumeAndOverbookOrders` method.
message BatchResumeAndOverbookOrdersResponse {}

// Request message for `BatchApproveOrdersWithoutReservation` method.
message BatchApproveOrdersWithoutReservationRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to approve.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for `BatchApproveOrdersWithoutReservation` method.
message BatchApproveOrdersWithoutReservationResponse {}

// Request message for `BatchArchiveOrders` method.
message BatchArchiveOrdersRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to archive.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for `BatchArchiveOrders` method.
message BatchArchiveOrdersResponse {}

// Request message for `BatchUnarchiveOrders` method.
message BatchUnarchiveOrdersRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to extract.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for `BatchUnarchiveOrders` method.
message BatchUnarchiveOrdersResponse {}

// Request message for `BatchDeleteOrders` method.
message BatchDeleteOrdersRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to delete.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for `BatchDeleteOrders` method.
message BatchDeleteOrdersResponse {}

// Request message for `BatchDisapproveOrders` method.
message BatchDisapproveOrdersRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to disapprove.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for `BatchDisapproveOrders` method.
message BatchDisapproveOrdersResponse {}

// Request message for `BatchDisapproveOrdersWithoutReservationChanges` method.
message BatchDisapproveOrdersWithoutReservationChangesRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to disapprove without
  // reservation changes. Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for `BatchDisapproveOrdersWithoutReservationChanges` method.
message BatchDisapproveOrdersWithoutReservationChangesResponse {}

// Request message for `BatchRetractOrders` method.
message BatchRetractOrdersRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to retract.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for `BatchRetractOrders` method.
message BatchRetractOrdersResponse {}

// Request message for `BatchRetractOrdersWithoutReservationChanges` method.
message BatchRetractOrdersWithoutReservationChangesRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to retract.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for `BatchRetractOrdersWithoutReservationChanges` method.
message BatchRetractOrdersWithoutReservationChangesResponse {}

// Request message for
// `BatchSubmitOrdersForApprovalWithoutReservationChanges` method.
message BatchSubmitOrdersForApprovalWithoutReservationChangesRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The resource names of the orders to submit for approval.
  // Format: `networks/{network_code}/orders/{order_id}`
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Response object for
// `BatchSubmitOrdersForApprovalWithoutReservationChanges` method.
message BatchSubmitOrdersForApprovalWithoutReservationChangesResponse {}

// Request object for `GetOrder` method.
message GetOrderRequest {
  // Required. The resource name of the Order.
  // Format: `networks/{network_code}/orders/{order_id}`
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
  ];
}

// Request object for `ListOrders` method.
message ListOrdersRequest {
  // Required. The parent, which owns this collection of Orders.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // 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.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // 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.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // 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`
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Expression to specify sorting order.
  // See syntax details at
  // https://developers.google.com/ad-manager/api/beta/filters#order
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Number of individual resources to skip while paginating.
  int32 skip = 6 [(google.api.field_behavior) = OPTIONAL];
}

// Response object for `ListOrdersRequest` containing matching `Order`
// resources.
message ListOrdersResponse {
  // The `Order` from the specified network.
  repeated Order orders = 1;

  // A token, which can be sent as `page_token` to retrieve the next page.
  // If this field is omitted, there are no subsequent pages.
  string next_page_token = 2;

  // Total number of `Orders`.
  // If a filter was included in the request, this reflects the total number
  // after the filtering is applied.
  //
  // `total_size` won't be calculated in the response unless it has been
  // included in a response field mask. The response field mask can be provided
  // to the method by using the URL parameter `$fields` or `fields`, or by using
  // the HTTP/gRPC header `X-Goog-FieldMask`.
  //
  // For more information, see
  // https://developers.google.com/ad-manager/api/beta/field-masks
  int32 total_size = 3;
}

// Request object for `CreateOrder` method.
message CreateOrderRequest {
  // Required. The parent resource where this Order will be created.
  // Format: `networks/{network_code}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The `Order` to create.
  Order order = 2 [(google.api.field_behavior) = REQUIRED];
}

// Request object for `UpdateOrder` method.
message UpdateOrderRequest {
  // Required. The `Order` to update.
  //
  // The Order's name is used to identify the order to update.
  // Format: `networks/{network_code}/orders/{order_id}`
  Order order = 1 [(google.api.field_behavior) = REQUIRED];

  // Optional. The list of fields to update.
  google.protobuf.FieldMask update_mask = 2
      [(google.api.field_behavior) = OPTIONAL];
}

// Request object for `BatchCreateOrders` method.
message BatchCreateOrdersRequest {
  // Required. The parent resource where `Orders` will be created.
  // Format: `networks/{network_code}`
  // The parent field in the CreateOrderRequest must match this
  // field.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The `Order` objects to create.
  // A maximum of 100 objects can be created in a batch.
  repeated CreateOrderRequest requests = 2
      [(google.api.field_behavior) = REQUIRED];
}

// Response object for `BatchCreateOrders` method.
message BatchCreateOrdersResponse {
  // The `Order` objects created.
  repeated Order orders = 1;
}

// Request object for `BatchUpdateOrders` method.
message BatchUpdateOrdersRequest {
  // Required. The parent resource where `Orders` will be updated.
  // Format: `networks/{network_code}`
  // The parent field in the UpdateOrderRequest must match this
  // field.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The `Order` objects to update.
  // A maximum of 100 objects can be updated in a batch.
  repeated UpdateOrderRequest requests = 2
      [(google.api.field_behavior) = REQUIRED];
}

// Response object for `BatchUpdateOrders` method.
message BatchUpdateOrdersResponse {
  // The `Order` objects updated.
  repeated Order orders = 1;
}
