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/computed_status_enum.proto"; 20import "google/ads/admanager/v1/creative_placeholder.proto"; 21import "google/ads/admanager/v1/environment_type_enum.proto"; 22import "google/ads/admanager/v1/goal.proto"; 23import "google/ads/admanager/v1/line_item_enums.proto"; 24import "google/api/annotations.proto"; 25import "google/api/client.proto"; 26import "google/api/field_behavior.proto"; 27import "google/api/resource.proto"; 28import "google/protobuf/timestamp.proto"; 29import "google/type/money.proto"; 30 31option csharp_namespace = "Google.Ads.AdManager.V1"; 32option go_package = "google.golang.org/genproto/googleapis/ads/admanager/v1;admanager"; 33option java_multiple_files = true; 34option java_outer_classname = "LineItemServiceProto"; 35option java_package = "com.google.ads.admanager.v1"; 36option objc_class_prefix = "GAA"; 37option php_namespace = "Google\\Ads\\AdManager\\V1"; 38 39// Provides methods for handling LineItem objects. 40service LineItemService { 41 option (google.api.default_host) = "admanager.googleapis.com"; 42 43 // API to retrieve a LineItem object. 44 rpc GetLineItem(GetLineItemRequest) returns (LineItem) { 45 option (google.api.http) = { 46 get: "/v1/{name=networks/*/orders/*/lineItems/*}" 47 }; 48 option (google.api.method_signature) = "name"; 49 } 50 51 // API to retrieve a list of LineItem objects. 52 rpc ListLineItems(ListLineItemsRequest) returns (ListLineItemsResponse) { 53 option (google.api.http) = { 54 get: "/v1/{parent=networks/*/orders/*}/lineItems" 55 }; 56 option (google.api.method_signature) = "parent"; 57 } 58} 59 60// The LineItem resource. 61message LineItem { 62 option (google.api.resource) = { 63 type: "admanager.googleapis.com/LineItem" 64 pattern: "networks/{network_code}/orders/{order}/lineItems/{line_item}" 65 plural: "lineItems" 66 singular: "lineItem" 67 }; 68 69 // Identifier. The resource name of the LineItem. 70 // Format: 71 // `networks/{network_code}/orders/{order_id}/lineItems/{line_item_id}` 72 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 73 74 // Optional. Display name of the LineItem. This attribute has a maximum length 75 // of 255 characters. 76 string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; 77 78 // Output only. The archival status of the LineItem. 79 bool archived = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; 80 81 // Optional. This attribute is only applicable for certain 82 // [line item types][LineItemType] and acts as an "FYI" or note, which does 83 // not impact ad-serving or other backend systems. 84 // 85 // For [SPONSORSHIP][LineItemType.SPONSORSHIP] line items, this represents 86 // the minimum quantity, which is a lifetime impression volume goal for 87 // reporting purposes. 88 // 89 // For [STANDARD][LineItemType.STANDARD] line items, this represents the 90 // contracted quantity, which is the number of units specified in the contract 91 // that the advertiser has bought for this line item. This attribute is only 92 // available if you have this feature enabled on your network. 93 int64 contracted_units_bought = 18 [(google.api.field_behavior) = OPTIONAL]; 94 95 // Required. The amount of money to spend per impression or click. 96 google.type.Money cost_per_unit = 15 [(google.api.field_behavior) = REQUIRED]; 97 98 // Required. The method used for billing this line item. 99 LineItemCostTypeEnum.LineItemCostType cost_type = 19 100 [(google.api.field_behavior) = REQUIRED]; 101 102 // Output only. The instant at which the LineItem was created. This attribute 103 // may be null for line items created before this feature was introduced. 104 google.protobuf.Timestamp create_time = 12 105 [(google.api.field_behavior) = OUTPUT_ONLY]; 106 107 // Output only. The instant at which the LineItem was last updated 108 google.protobuf.Timestamp update_time = 31 109 [(google.api.field_behavior) = OUTPUT_ONLY]; 110 111 // Required. The strategy used for displaying multiple 112 // [creatives][google.ads.admanager.v1.Creative] that are associated with the 113 // line item. 114 CreativeRotationTypeEnum.CreativeRotationType creative_rotation_type = 22 115 [(google.api.field_behavior) = REQUIRED]; 116 117 // Non-empty default. The strategy for delivering ads over the duration of the 118 // line item. Defaults to [EVENLY][DeliveryRateType.EVENLY] or 119 // [FRONTLOADED][DeliveryRatetype.FRONTLOADED] depending on the network's 120 // configuration. 121 DeliveryRateTypeEnum.DeliveryRateType delivery_rate_type = 23 122 [(google.api.field_behavior) = NON_EMPTY_DEFAULT]; 123 124 // Optional. The number here is either a percentage or an absolute value 125 // depending on the 126 // [discount_type][google.ads.admanager.v1.LineItem.discount_type]. If it is 127 // [PERCENTAGE][LineItemDiscountType.PERCENTAGE], then only non-fractional 128 // values are supported. 129 double discount = 13 [(google.api.field_behavior) = OPTIONAL]; 130 131 // Non-empty default. The type of discount applied to the line item. Defaults 132 // to [PERCENTAGE][LineItemDiscountType.PERCENTAGE]. 133 LineItemDiscountTypeEnum.LineItemDiscountType discount_type = 24 134 [(google.api.field_behavior) = NON_EMPTY_DEFAULT]; 135 136 // Non-empty default. The environment that the line item is targeting. The 137 // default value is [BROWSER][EnvironmentType.BROWSER]. If this value is 138 // [VIDEO_PLAYER][EnvironmentType.VIDEO_PLAYER], then this line item can only 139 // target [AdUnits][google.ads.admanager.v1.AdUnit] that have `AdUnitSizes` 140 // whose `environment_type` is also `VIDEO_PLAYER`. 141 EnvironmentTypeEnum.EnvironmentType environment_type = 25 142 [(google.api.field_behavior) = NON_EMPTY_DEFAULT]; 143 144 // Optional. Identifier for the LineItem that is meaningful to the publisher. 145 // This attribute has a maximum length of 255 characters. 146 string external_id = 5 [(google.api.field_behavior) = OPTIONAL]; 147 148 // Required. Time at which the LineItem will begin serving. This attribute 149 // must be in the future when creating a LineItem. 150 google.protobuf.Timestamp start_time = 6 151 [(google.api.field_behavior) = REQUIRED]; 152 153 // Optional. Time at which the LineItem will stop serving. This attribute is 154 // ignored when 155 // [unlimited_end_time][google.ads.admanager.v1.LineItem.unlimited_end_time] 156 // is `true`. If specified, it must be after 157 // [start_time][google.ads.admanager.v1.LineItem.start_time]. This end time 158 // does not include 159 // [auto_extension_days][google.ads.admanager.v1.LineItem.auto_extension_days]. 160 google.protobuf.Timestamp end_time = 7 161 [(google.api.field_behavior) = OPTIONAL]; 162 163 // Optional. Number of days to allow a LineItem to deliver past its 164 // [end_time][google.ads.admanager.v1.LineItem.end_time]. A maximum of 7 days 165 // is allowed. This feature is only available for Ad Manager 360 accounts. 166 int32 auto_extension_days = 8 [(google.api.field_behavior) = OPTIONAL]; 167 168 // Optional. Whether the LineItem has an 169 // [end_time][google.ads.admanager.v1.LineItem.end_time]. This attribute can 170 // be set to `true` for only LineItems with 171 // [line_item_type][google.ads.admanager.v1.LineItem.line_item_type] 172 // [SPONSORSHIP][LineItemType.SPONSORSHIP], [NETWORK][LineItemType.NETWORK], 173 // [PRICE_PRIORITY][LineItemType.PRICE_PRIORITY] and 174 // [HOUSE][LineItemType.HOUSE]. 175 bool unlimited_end_time = 9 [(google.api.field_behavior) = OPTIONAL]; 176 177 // Output only. The application that last modified this line item. 178 string last_modified_by_app = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; 179 180 // Required. Determines the default priority of the LineItem for delivery. 181 // More information can be found on the [Ad Manager Help 182 // Center](https://support.google.com/dfp_premium/answer/177279). 183 LineItemTypeEnum.LineItemType line_item_type = 10 184 [(google.api.field_behavior) = REQUIRED]; 185 186 // Output only. Indicates if a line item is missing any 187 // [creatives][google.ads.admanager.v1.Creative] for the 188 // [creative_placeholders][google.ads.admanager.v1.LineItem.creative_placeholders] 189 // specified. 190 // 191 // [Creatives][google.ads.admanager.v1.Creative] can be considered missing for 192 // several reasons: 193 // 194 // * Not enough [creatives][google.ads.admanager.v1.Creative] of a certain 195 // size have been uploaded, 196 // as determined by 197 // [expectedCreativeCount][google.ads.admanager.v1.CreativePlaceholder.expected_creative_count]. 198 // For example a line item specifies 750x350, 400x200, but only a 750x350 199 // was uploaded. Or line item specifies 750x350 with an expected count of 2, 200 // but only one was uploaded. 201 // * The [appliedLabels][Creative.applied_labels] of an associated 202 // [Creative][google.ads.admanager.v1.Creative] 203 // do not match the 204 // [effectiveAppliedLabels][CreativePlaceholder.effective_applied_labels] of 205 // the line item. For example if a line item specifies 750x350 with a foo 206 // applied label, but a 750x350 creative without an applied label was 207 // uploaded. 208 bool missing_creatives = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; 209 210 // Optional. Provides any additional notes that may annotate LineItem. This 211 // field has a maximum length of 65,535 characters. 212 string notes = 20 [(google.api.field_behavior) = OPTIONAL]; 213 214 // Optional. Priority of the LineItem for delivery. Valid values range from 1 215 // to 16. This field can only be changed by certain networks, otherwise a 216 // `PERMISSION_DENIED` error will occur. 217 // 218 // The following list shows the default, minimum, and maximum priority values 219 // for each [LineItemType][LineItemType]: formatted as `LineItemType`: default 220 // priority (minimum priority, maximum priority): 221 // 222 // * `SPONSORSHIP`: 4 (2,5) 223 // * `STANDARD`: 8 (6,10) 224 // * `NETWORK`: 12 (11, 14) 225 // * `BULK`: 12 (11, 14) 226 // * `PRICE_PRIORITY`: 12 (11, 14) 227 // * `HOUSE`: 16 (15, 16) 228 // * `CLICK_TRACKING`: 16 (1, 16) 229 // * `AD_EXCHANGE`: 12 (1, 16) 230 // * `ADSENSE`: 12 (1, 16) 231 // * `BUMPER`: 16 (15, 16) 232 int64 priority = 11 [(google.api.field_behavior) = OPTIONAL]; 233 234 // Output only. Describes whether or not inventory has been reserved for the 235 // line item. 236 ReservationStatusEnum.ReservationStatus reservation_status = 26 237 [(google.api.field_behavior) = OUTPUT_ONLY]; 238 239 // Optional. The web property code used for dynamic allocation line items. 240 // This web property is only required with line item types 241 // [AD_EXCHANGE][LineItemType.AD_EXCHANGE] and 242 // [ADSENSE][LineItemType.ADSENSE]. 243 string web_property_code = 21 [(google.api.field_behavior) = OPTIONAL]; 244 245 // Required. Details about the creatives that are expected to serve through 246 // this LineItem. 247 repeated CreativePlaceholder creative_placeholders = 27 248 [(google.api.field_behavior) = REQUIRED]; 249 250 // Output only. The status of the LineItem. 251 ComputedStatusEnum.ComputedStatus status = 28 252 [(google.api.field_behavior) = OUTPUT_ONLY]; 253 254 // Required. The primary goal that this LineItem is associated with, which is 255 // used in its pacing and budgeting. 256 Goal primary_goal = 29 [(google.api.field_behavior) = REQUIRED]; 257 258 // Optional. The impression limit for the LineItem. This field is meaningful 259 // only if the 260 // [LineItem.line_item_type][google.ads.admanager.v1.LineItem.line_item_type] 261 // is [LineItemType.SPONSORSHIP][] and 262 // [LineItem.cost_type][google.ads.admanager.v1.LineItem.cost_type] is 263 // [CostType.CPM][]. 264 Goal impression_limit = 30 [(google.api.field_behavior) = OPTIONAL]; 265} 266 267// Request object for GetLineItem method. 268message GetLineItemRequest { 269 // Required. The resource name of the LineItem. 270 // Format: 271 // `networks/{network_code}/orders/{order_id}/lineItems/{line_item_id}` 272 string name = 1 [ 273 (google.api.field_behavior) = REQUIRED, 274 (google.api.resource_reference) = { 275 type: "admanager.googleapis.com/LineItem" 276 } 277 ]; 278} 279 280// Request object for ListLineItems method. 281message ListLineItemsRequest { 282 // Required. The parent, which owns this collection of LineItems. 283 // Format: networks/{network_code}/orders/{order_id} 284 string parent = 1 [ 285 (google.api.field_behavior) = REQUIRED, 286 (google.api.resource_reference) = { type: "admanager.googleapis.com/Order" } 287 ]; 288 289 // Optional. The maximum number of LineItems to return. The service may return 290 // fewer than this value. If unspecified, at most 50 line items will be 291 // returned. The maximum value is 1000; values above 1000 will be coerced to 292 // 1000. 293 int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; 294 295 // Optional. A page token, received from a previous `ListLineItems` call. 296 // Provide this to retrieve the subsequent page. 297 // 298 // When paginating, all other parameters provided to `ListLineItems` must 299 // match the call that provided the page token. 300 string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; 301 302 // Optional. Expression to filter the response. 303 // See syntax details at 304 // https://developers.google.com/ad-manager/api/beta/filters 305 string filter = 4 [(google.api.field_behavior) = OPTIONAL]; 306 307 // Optional. Expression to specify sorting order. 308 // See syntax details at 309 // https://developers.google.com/ad-manager/api/beta/filters#order 310 string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; 311 312 // Optional. Number of individual resources to skip while paginating. 313 int32 skip = 6 [(google.api.field_behavior) = OPTIONAL]; 314} 315 316// Response object for ListLineItemsRequest containing matching LineItem 317// resources. 318message ListLineItemsResponse { 319 // The LineItem from the specified network. 320 repeated LineItem line_items = 1; 321 322 // A token, which can be sent as `page_token` to retrieve the next page. 323 // If this field is omitted, there are no subsequent pages. 324 string next_page_token = 2; 325 326 // Total number of LineItems. 327 // If a filter was included in the request, this reflects the total number 328 // after the filtering is applied. 329 // 330 // `total_size` will not be calculated in the response unless it has been 331 // included in a response field mask. The response field mask can be provided 332 // to the method by using the URL parameter `$fields` or `fields`, or by using 333 // the HTTP/gRPC header `X-Goog-FieldMask`. 334 // 335 // For more information, see 336 // https://developers.google.com/ad-manager/api/beta/field-masks 337 int32 total_size = 3; 338} 339