xref: /aosp_15_r20/external/googleapis/google/ads/admanager/v1/order_service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.ads.admanager.v1;
18
19import "google/ads/admanager/v1/applied_label.proto";
20import "google/api/annotations.proto";
21import "google/api/client.proto";
22import "google/api/field_behavior.proto";
23import "google/api/resource.proto";
24import "google/protobuf/timestamp.proto";
25
26option csharp_namespace = "Google.Ads.AdManager.V1";
27option go_package = "google.golang.org/genproto/googleapis/ads/admanager/v1;admanager";
28option java_multiple_files = true;
29option java_outer_classname = "OrderServiceProto";
30option java_package = "com.google.ads.admanager.v1";
31option objc_class_prefix = "GAA";
32option php_namespace = "Google\\Ads\\AdManager\\V1";
33
34// Provides methods for handling `Order` objects.
35service OrderService {
36  option (google.api.default_host) = "admanager.googleapis.com";
37
38  // API to retrieve an Order object.
39  rpc GetOrder(GetOrderRequest) returns (Order) {
40    option (google.api.http) = {
41      get: "/v1/{name=networks/*/orders/*}"
42    };
43    option (google.api.method_signature) = "name";
44  }
45
46  // API to retrieve a list of `Order` objects.
47  //
48  // Fields used for literal matching in filter string:
49  // * `order_id`
50  // * `display_name`
51  // * `external_order_id`
52  rpc ListOrders(ListOrdersRequest) returns (ListOrdersResponse) {
53    option (google.api.http) = {
54      get: "/v1/{parent=networks/*}/orders"
55    };
56    option (google.api.method_signature) = "parent";
57  }
58}
59
60// The `Order` resource.
61message Order {
62  option (google.api.resource) = {
63    type: "admanager.googleapis.com/Order"
64    pattern: "networks/{network_code}/orders/{order}"
65    plural: "orders"
66    singular: "order"
67  };
68
69  // The status of an Order.
70  enum Status {
71    // Default value. This value is unused.
72    STATUS_UNSPECIFIED = 0;
73
74    // Indicates that the Order has just been created but no approval has been
75    // requested yet.
76    DRAFT = 2;
77
78    // Indicates that a request for approval for the Order has been made.
79    PENDING_APPROVAL = 3;
80
81    // Indicates that the Order has been approved and is ready to serve.
82    APPROVED = 4;
83
84    // Indicates that the Order has been disapproved and is not eligible to
85    // serve.
86    DISAPPROVED = 5;
87
88    // This is a legacy state. Paused status should be checked on LineItems
89    // within the order.
90    PAUSED = 6;
91
92    // Indicates that the Order has been canceled and cannot serve.
93    CANCELED = 7;
94
95    // Indicates that the Order has been deleted.
96    DELETED = 8;
97  }
98
99  // Identifier. The resource name of the `Order`.
100  // Format: `networks/{network_code}/orders/{order_id}`
101  string name = 1 [(google.api.field_behavior) = IDENTIFIER];
102
103  // Output only. Order ID.
104  int64 order_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
105
106  // Required. The display name of the Order.  This value is required to create
107  // an order and has a maximum length of 255 characters.
108  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
109
110  // Optional. Specifies whether or not the Order is a programmatic order.
111  bool programmatic = 3 [(google.api.field_behavior) = OPTIONAL];
112
113  // Required. The resource name of the User responsible for trafficking the
114  // Order. Format: "networks/{network_code}/users/{user_id}"
115  string trafficker = 23 [
116    (google.api.field_behavior) = REQUIRED,
117    (google.api.resource_reference) = { type: "admanager.googleapis.com/User" }
118  ];
119
120  // Optional. The resource names of Contacts from the advertiser of this Order.
121  // Format: "networks/{network_code}/contacts/{contact_id}"
122  repeated string advertiser_contacts = 5 [
123    (google.api.field_behavior) = OPTIONAL,
124    (google.api.resource_reference) = {
125      type: "admanager.googleapis.com/Contact"
126    }
127  ];
128
129  // Required. The resource name of the Company, which is of type
130  // Company.Type.ADVERTISER, to which this order belongs. This attribute is
131  // required. Format: "networks/{network_code}/companies/{company_id}"
132  string advertiser = 6 [
133    (google.api.field_behavior) = REQUIRED,
134    (google.api.resource_reference) = {
135      type: "admanager.googleapis.com/Company"
136    }
137  ];
138
139  // Optional. The resource names of Contacts from the advertising Agency of
140  // this Order. Format: "networks/{network_code}/contacts/{contact_id}"
141  repeated string agency_contacts = 7 [
142    (google.api.field_behavior) = OPTIONAL,
143    (google.api.resource_reference) = {
144      type: "admanager.googleapis.com/Contact"
145    }
146  ];
147
148  // Optional. The resource name of the Company, which is of type
149  // Company.Type.AGENCY, with which this order is associated. Format:
150  // "networks/{network_code}/companies/{company_id}"
151  string agency = 8 [
152    (google.api.field_behavior) = OPTIONAL,
153    (google.api.resource_reference) = {
154      type: "admanager.googleapis.com/Company"
155    }
156  ];
157
158  // Optional. The resource names of Teams directly applied to this Order.
159  // Format: "networks/{network_code}/teams/{team_id}"
160  repeated string applied_teams = 9 [
161    (google.api.field_behavior) = OPTIONAL,
162    (google.api.resource_reference) = { type: "admanager.googleapis.com/Team" }
163  ];
164
165  // Output only. The resource names of Teams applied to this Order including
166  // inherited values. Format: "networks/{network_code}/teams/{team_id}"
167  repeated string effective_teams = 28 [
168    (google.api.field_behavior) = OUTPUT_ONLY,
169    (google.api.resource_reference) = { type: "admanager.googleapis.com/Team" }
170  ];
171
172  // Output only. The resource name of the User who created the Order on behalf
173  // of the advertiser. This value is assigned by Google. Format:
174  // "networks/{network_code}/users/{user_id}"
175  string creator = 10 [
176    (google.api.field_behavior) = OUTPUT_ONLY,
177    (google.api.resource_reference) = { type: "admanager.googleapis.com/User" }
178  ];
179
180  // Output only. The ISO 4217 3-letter currency code for the currency used by
181  // the Order. This value is the network's currency code.
182  string currency_code = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
183
184  // Output only. The instant at which the Order and its associated line items
185  // are eligible to begin serving. This attribute is derived from the line item
186  // of the order that has the earliest LineItem.start_time.
187  google.protobuf.Timestamp start_time = 19
188      [(google.api.field_behavior) = OUTPUT_ONLY];
189
190  // Output only. The instant at which the Order and its associated line items
191  // stop being served. This attribute is derived from the line item of the
192  // order that has the latest LineItem.end_time.
193  google.protobuf.Timestamp end_time = 12
194      [(google.api.field_behavior) = OUTPUT_ONLY];
195
196  // Optional. An arbitrary ID to associate to the Order, which can be used as a
197  // key to an external system.
198  int64 external_order_id = 13 [(google.api.field_behavior) = OPTIONAL];
199
200  // Output only. The archival status of the Order.
201  bool archived = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
202
203  // Output only. The application which modified this order. This attribute is
204  // assigned by Google.
205  string last_modified_by_app = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
206
207  // Output only. The instant this Order was last modified.
208  google.protobuf.Timestamp update_time = 16
209      [(google.api.field_behavior) = OUTPUT_ONLY];
210
211  // Optional. Provides any additional notes that may annotate the Order. This
212  // attribute has a maximum length of 65,535 characters.
213  string notes = 17 [(google.api.field_behavior) = OPTIONAL];
214
215  // Optional. The purchase order number for the Order. This value has a maximum
216  // length of 63 characters.
217  string po_number = 18 [(google.api.field_behavior) = OPTIONAL];
218
219  // Output only. The status of the Order.
220  Status status = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
221
222  // Optional. The resource name of the User responsible for the sales of the
223  // Order. Format: "networks/{network_code}/users/{user_id}"
224  string salesperson = 21 [
225    (google.api.field_behavior) = OPTIONAL,
226    (google.api.resource_reference) = { type: "admanager.googleapis.com/User" }
227  ];
228
229  // Optional. The resource names of the secondary salespeople associated with
230  // the order. Format: "networks/{network_code}/users/{user_id}"
231  repeated string secondary_salespeople = 22 [
232    (google.api.field_behavior) = OPTIONAL,
233    (google.api.resource_reference) = { type: "admanager.googleapis.com/User" }
234  ];
235
236  // Optional. The resource names of the secondary traffickers associated with
237  // the order. Format: "networks/{network_code}/users/{user_id}"
238  repeated string secondary_traffickers = 24 [
239    (google.api.field_behavior) = OPTIONAL,
240    (google.api.resource_reference) = { type: "admanager.googleapis.com/User" }
241  ];
242
243  // Optional. The set of labels applied directly to this order.
244  repeated AppliedLabel applied_labels = 25
245      [(google.api.field_behavior) = OPTIONAL];
246
247  // Output only. Contains the set of labels applied directly to the order as
248  // well as those inherited from the company that owns the order. If a label
249  // has been negated, only the negated label is returned. This field is
250  // assigned by Google.
251  repeated AppliedLabel effective_applied_labels = 26
252      [(google.api.field_behavior) = OUTPUT_ONLY];
253}
254
255// Request object for `GetOrder` method.
256message GetOrderRequest {
257  // Required. The resource name of the Order.
258  // Format: `networks/{network_code}/orders/{order_id}`
259  string name = 1 [
260    (google.api.field_behavior) = REQUIRED,
261    (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" }
262  ];
263}
264
265// Request object for `ListOrders` method.
266message ListOrdersRequest {
267  // Required. The parent, which owns this collection of Orders.
268  // Format: `networks/{network_code}`
269  string parent = 1 [
270    (google.api.field_behavior) = REQUIRED,
271    (google.api.resource_reference) = {
272      type: "admanager.googleapis.com/Network"
273    }
274  ];
275
276  // Optional. The maximum number of `Orders` to return. The service may return
277  // fewer than this value. If unspecified, at most 50 `Orders` will be
278  // returned. The maximum value is 1000; values above 1000 will be coerced to
279  // 1000.
280  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
281
282  // Optional. A page token, received from a previous `ListOrders` call.
283  // Provide this to retrieve the subsequent page.
284  //
285  // When paginating, all other parameters provided to `ListOrders` must match
286  // the call that provided the page token.
287  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
288
289  // Optional. Expression to filter the response.
290  // See syntax details at
291  // https://developers.google.com/ad-manager/api/beta/filters
292  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
293
294  // Optional. Expression to specify sorting order.
295  // See syntax details at
296  // https://developers.google.com/ad-manager/api/beta/filters#order
297  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
298
299  // Optional. Number of individual resources to skip while paginating.
300  int32 skip = 6 [(google.api.field_behavior) = OPTIONAL];
301}
302
303// Response object for `ListOrdersRequest` containing matching `Order`
304// resources.
305message ListOrdersResponse {
306  // The `Order` from the specified network.
307  repeated Order orders = 1;
308
309  // A token, which can be sent as `page_token` to retrieve the next page.
310  // If this field is omitted, there are no subsequent pages.
311  string next_page_token = 2;
312
313  // Total number of `Orders`.
314  // If a filter was included in the request, this reflects the total number
315  // after the filtering is applied.
316  //
317  // `total_size` will not be calculated in the response unless it has been
318  // included in a response field mask. The response field mask can be provided
319  // to the method by using the URL parameter `$fields` or `fields`, or by using
320  // the HTTP/gRPC header `X-Goog-FieldMask`.
321  //
322  // For more information, see
323  // https://developers.google.com/ad-manager/api/beta/field-masks
324  int32 total_size = 3;
325}
326