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/ad_unit_enums.proto"; 20import "google/ads/admanager/v1/ad_unit_size.proto"; 21import "google/ads/admanager/v1/applied_label.proto"; 22import "google/ads/admanager/v1/frequency_cap.proto"; 23import "google/api/annotations.proto"; 24import "google/api/client.proto"; 25import "google/api/field_behavior.proto"; 26import "google/api/resource.proto"; 27import "google/protobuf/duration.proto"; 28import "google/protobuf/timestamp.proto"; 29 30option csharp_namespace = "Google.Ads.AdManager.V1"; 31option go_package = "google.golang.org/genproto/googleapis/ads/admanager/v1;admanager"; 32option java_multiple_files = true; 33option java_outer_classname = "AdUnitServiceProto"; 34option java_package = "com.google.ads.admanager.v1"; 35option objc_class_prefix = "GAA"; 36option php_namespace = "Google\\Ads\\AdManager\\V1"; 37 38// Provides methods for handling AdUnit objects. 39service AdUnitService { 40 option (google.api.default_host) = "admanager.googleapis.com"; 41 42 // API to retrieve an AdUnit object. 43 rpc GetAdUnit(GetAdUnitRequest) returns (AdUnit) { 44 option (google.api.http) = { 45 get: "/v1/{name=networks/*/adUnits/*}" 46 }; 47 option (google.api.method_signature) = "name"; 48 } 49 50 // API to retrieve a list of AdUnit objects. 51 rpc ListAdUnits(ListAdUnitsRequest) returns (ListAdUnitsResponse) { 52 option (google.api.http) = { 53 get: "/v1/{parent=networks/*}/adUnits" 54 }; 55 option (google.api.method_signature) = "parent"; 56 } 57} 58 59// The AdUnit resource. 60message AdUnit { 61 option (google.api.resource) = { 62 type: "admanager.googleapis.com/AdUnit" 63 pattern: "networks/{network_code}/adUnits/{ad_unit}" 64 plural: "adUnits" 65 singular: "adUnit" 66 }; 67 68 // The status of an AdUnit. 69 enum Status { 70 // Default value. This value is unused. 71 STATUS_UNSPECIFIED = 0; 72 73 // The ad unit is active, available for targeting, and serving. 74 ACTIVE = 1; 75 76 // The ad unit will be visible in the UI, but ignored by serving. 77 INACTIVE = 2; 78 79 // The ad unit will be hidden in the UI and ignored by serving. 80 ARCHIVED = 3; 81 } 82 83 // Identifier. The resource name of the AdUnit. 84 // Format: `networks/{network_code}/adUnits/{ad_unit_id}` 85 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 86 87 // Output only. AdUnit ID. 88 int64 ad_unit_id = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; 89 90 // Required. Immutable. The AdUnit's parent. Every ad unit has a parent except 91 // for the root ad unit, which is created by Google. Format: 92 // "networks/{network_code}/adUnits/{ad_unit_id}" 93 string parent_ad_unit = 10 [ 94 (google.api.field_behavior) = REQUIRED, 95 (google.api.field_behavior) = IMMUTABLE, 96 (google.api.resource_reference) = { 97 type: "admanager.googleapis.com/AdUnit" 98 } 99 ]; 100 101 // Output only. The path to this AdUnit in the ad unit hierarchy represented 102 // as a list from the root to this ad unit's parent. For root ad units, this 103 // list is empty. 104 repeated AdUnitParent parent_path = 11 105 [(google.api.field_behavior) = OUTPUT_ONLY]; 106 107 // Required. The display name of the ad unit. Its maximum length is 255 108 // characters. 109 string display_name = 9 [(google.api.field_behavior) = REQUIRED]; 110 111 // Immutable. A string used to uniquely identify the ad unit for the purposes 112 // of serving the ad. This attribute is optional and can be set during ad unit 113 // creation. If it is not provided, it will be assigned by Google based off of 114 // the ad unit ID. 115 string ad_unit_code = 2 [(google.api.field_behavior) = IMMUTABLE]; 116 117 // Output only. The status of this ad unit. It defaults to ACTIVE. 118 Status status = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; 119 120 // Non-empty default. The value to use for the HTML link's target attribute. 121 // This value will be interpreted as TOP if left blank. 122 TargetWindowEnum.TargetWindow target_window = 12 123 [(google.api.field_behavior) = NON_EMPTY_DEFAULT]; 124 125 // Optional. The resource names of Teams directly applied to this AdUnit. 126 // Format: "networks/{network_code}/teams/{team_id}" 127 repeated string applied_teams = 3 [ 128 (google.api.field_behavior) = OPTIONAL, 129 (google.api.resource_reference) = { type: "admanager.googleapis.com/Team" } 130 ]; 131 132 // Output only. The resource names of all Teams that this AdUnit is on as well 133 // as those inherited from parent AdUnits. Format: 134 // "networks/{network_code}/teams/{team_id}" 135 repeated string teams = 4 [ 136 (google.api.field_behavior) = OUTPUT_ONLY, 137 (google.api.resource_reference) = { type: "admanager.googleapis.com/Team" } 138 ]; 139 140 // Optional. A description of the ad unit. The maximum length is 65,535 141 // characters. 142 string description = 5 [(google.api.field_behavior) = OPTIONAL]; 143 144 // Optional. If this field is set to true, then the AdUnit will not be 145 // implicitly targeted when its parent is. Traffickers must explicitly 146 // target such an AdUnit or else no line items will serve to it. This 147 // feature is only available for Ad Manager 360 accounts. 148 bool explicitly_targeted = 6 [(google.api.field_behavior) = OPTIONAL]; 149 150 // Output only. This field is set to true if the ad unit has any children. 151 bool has_children = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; 152 153 // Output only. The instant this AdUnit was last modified. 154 google.protobuf.Timestamp update_time = 8 155 [(google.api.field_behavior) = OUTPUT_ONLY]; 156 157 // Optional. The sizes that can be served inside this ad unit. 158 repeated AdUnitSize ad_unit_sizes = 14 159 [(google.api.field_behavior) = OPTIONAL]; 160 161 // Optional. Determines what set top box video on demand channel this ad unit 162 // corresponds to in an external set top box ad campaign system. 163 string external_set_top_box_channel_id = 17 164 [(google.api.field_behavior) = OPTIONAL]; 165 166 // Optional. The duration after which an Ad Unit will automatically refresh. 167 // This is only valid for ad units in mobile apps. If not set, the ad unit 168 // will not refresh. 169 google.protobuf.Duration refresh_delay = 19 170 [(google.api.field_behavior) = OPTIONAL]; 171 172 // Optional. The ID of the CTV application that this ad unit is within. 173 int64 ctv_application_id = 20 [(google.api.field_behavior) = OPTIONAL]; 174 175 // Optional. The set of labels applied directly to this ad unit. 176 repeated AppliedLabel applied_labels = 21 177 [(google.api.field_behavior) = OPTIONAL]; 178 179 // Output only. Contains the set of labels applied directly to the ad unit as 180 // well as those inherited from the parent ad units. If a label has been 181 // negated, only the negated label is returned. This field is readonly and is 182 // assigned by Google. 183 repeated AppliedLabel effective_applied_labels = 22 184 [(google.api.field_behavior) = OUTPUT_ONLY]; 185 186 // Optional. The set of label frequency caps applied directly to this ad unit. 187 // There is a limit of 10 label frequency caps per ad unit. 188 repeated LabelFrequencyCap applied_label_frequency_caps = 23 189 [(google.api.field_behavior) = OPTIONAL]; 190 191 // Output only. The label frequency caps applied directly to the ad unit as 192 // well as those inherited from parent ad units. 193 repeated LabelFrequencyCap effective_label_frequency_caps = 24 194 [(google.api.field_behavior) = OUTPUT_ONLY]; 195 196 // Optional. The smart size mode for this ad unit. This attribute is optional 197 // and defaults to SmartSizeMode.NONE for fixed sizes. 198 SmartSizeModeEnum.SmartSizeMode smart_size_mode = 25 199 [(google.api.field_behavior) = OPTIONAL]; 200 201 // Optional. The value of AdSense enabled directly applied to this ad unit. 202 // This attribute is optional and if not specified this ad unit will inherit 203 // the value of effectiveAdsenseEnabled from its ancestors. 204 AppliedAdsenseEnabledEnum.AppliedAdsenseEnabled applied_adsense_enabled = 26 205 [(google.api.field_behavior) = OPTIONAL]; 206 207 // Output only. Specifies whether or not the AdUnit is enabled for serving ads 208 // from the AdSense content network. This attribute defaults to the ad unit's 209 // parent or ancestor's setting if one has been set. If no ancestor of the ad 210 // unit has set appliedAdsenseEnabled, the attribute is defaulted to true. 211 bool effective_adsense_enabled = 27 212 [(google.api.field_behavior) = OUTPUT_ONLY]; 213} 214 215// The summary of a parent AdUnit. 216message AdUnitParent { 217 // Output only. The parent of the current AdUnit 218 // Format: `networks/{network_code}/adUnits/{ad_unit_id}` 219 string parent_ad_unit = 1 [ 220 (google.api.field_behavior) = OUTPUT_ONLY, 221 (google.api.resource_reference) = { 222 type: "admanager.googleapis.com/AdUnit" 223 } 224 ]; 225 226 // Output only. The display name of the parent AdUnit. 227 string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 228 229 // Output only. A string used to uniquely identify the ad unit for the 230 // purposes of serving the ad. 231 string ad_unit_code = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 232} 233 234// Wrapper message for 235// [TargetWindow][google.ads.admanager.v1.TargetWindowEnum.TargetWindow]. 236message TargetWindowEnum { 237 // Corresponds to an HTML link's target attribute. 238 // See http://www.w3.org/TR/html401/present/frames.html#adef-target 239 enum TargetWindow { 240 // Default value. This value is unused. 241 TARGET_WINDOW_UNSPECIFIED = 0; 242 243 // Specifies that the link should open in the full body of the page. 244 TOP = 1; 245 246 // Specifies that the link should open in a new window. 247 BLANK = 2; 248 } 249} 250 251// Frequency cap using a label. 252message LabelFrequencyCap { 253 // The label to used for frequency capping. 254 // Format: "networks/{network_code}/labels/{label_id}" 255 string label = 1; 256 257 // The frequency cap. 258 FrequencyCap frequency_cap = 2; 259} 260 261// Wrapper message for 262// [SmartSizeMode][google.ads.admanager.v1.SmartSizeModeEnum.SmartSizeMode]. 263message SmartSizeModeEnum { 264 // The smart size mode for this ad unit. This attribute is optional and 265 // defaults to SmartSizeMode.NONE for fixed sizes. 266 enum SmartSizeMode { 267 // Default value. This value is unused. 268 SMART_SIZE_MODE_UNSPECIFIED = 0; 269 270 // Fixed size mode (default). 271 NONE = 1; 272 273 // The height is fixed for the request, the width is a range. 274 SMART_BANNER = 2; 275 276 // Height and width are ranges. 277 DYNAMIC_SIZE = 3; 278 } 279} 280 281// Request object for GetAdUnit method. 282message GetAdUnitRequest { 283 // Required. The resource name of the AdUnit. 284 // Format: `networks/{network_code}/adUnits/{ad_unit_id}` 285 string name = 1 [ 286 (google.api.field_behavior) = REQUIRED, 287 (google.api.resource_reference) = { 288 type: "admanager.googleapis.com/AdUnit" 289 } 290 ]; 291} 292 293// Request object for ListAdUnits method. 294message ListAdUnitsRequest { 295 // Required. The parent, which owns this collection of AdUnits. 296 // Format: `networks/{network_code}` 297 string parent = 1 [ 298 (google.api.field_behavior) = REQUIRED, 299 (google.api.resource_reference) = { 300 type: "admanager.googleapis.com/Network" 301 } 302 ]; 303 304 // Optional. The maximum number of AdUnits to return. The service may return 305 // fewer than this value. If unspecified, at most 50 ad units will be 306 // returned. The maximum value is 1000; values above 1000 will be coerced to 307 // 1000. 308 int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; 309 310 // Optional. A page token, received from a previous `ListAdUnits` call. 311 // Provide this to retrieve the subsequent page. 312 // 313 // When paginating, all other parameters provided to `ListAdUnits` must match 314 // the call that provided the page token. 315 string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; 316 317 // Optional. Expression to filter the response. 318 // See syntax details at 319 // https://developers.google.com/ad-manager/api/beta/filters 320 string filter = 4 [(google.api.field_behavior) = OPTIONAL]; 321 322 // Optional. Expression to specify sorting order. 323 // See syntax details at 324 // https://developers.google.com/ad-manager/api/beta/filters#order 325 string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; 326 327 // Optional. Number of individual resources to skip while paginating. 328 int32 skip = 6 [(google.api.field_behavior) = OPTIONAL]; 329} 330 331// Response object for ListAdUnitsRequest containing matching AdUnit resources. 332message ListAdUnitsResponse { 333 // The AdUnit from the specified network. 334 repeated AdUnit ad_units = 1; 335 336 // A token, which can be sent as `page_token` to retrieve the next page. 337 // If this field is omitted, there are no subsequent pages. 338 string next_page_token = 2; 339 340 // Total number of AdUnits. 341 // If a filter was included in the request, this reflects the total number 342 // after the filtering is applied. 343 // 344 // `total_size` will not be calculated in the response unless it has been 345 // included in a response field mask. The response field mask can be provided 346 // to the method by using the URL parameter `$fields` or `fields`, or by using 347 // the HTTP/gRPC header `X-Goog-FieldMask`. 348 // 349 // For more information, see 350 // https://developers.google.com/ad-manager/api/beta/field-masks 351 int32 total_size = 3; 352} 353