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/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23 24option csharp_namespace = "Google.Ads.AdManager.V1"; 25option go_package = "google.golang.org/genproto/googleapis/ads/admanager/v1;admanager"; 26option java_multiple_files = true; 27option java_outer_classname = "LabelServiceProto"; 28option java_package = "com.google.ads.admanager.v1"; 29option objc_class_prefix = "GAA"; 30option php_namespace = "Google\\Ads\\AdManager\\V1"; 31 32// Provides methods for handling Label objects. 33service LabelService { 34 option (google.api.default_host) = "admanager.googleapis.com"; 35 36 // API to retrieve a Label object. 37 rpc GetLabel(GetLabelRequest) returns (Label) { 38 option (google.api.http) = { 39 get: "/v1/{name=networks/*/labels/*}" 40 }; 41 option (google.api.method_signature) = "name"; 42 } 43 44 // API to retrieve a list of Label objects. 45 rpc ListLabels(ListLabelsRequest) returns (ListLabelsResponse) { 46 option (google.api.http) = { 47 get: "/v1/{parent=networks/*}/labels" 48 }; 49 option (google.api.method_signature) = "parent"; 50 } 51} 52 53// The Label resource. 54message Label { 55 option (google.api.resource) = { 56 type: "admanager.googleapis.com/Label" 57 pattern: "networks/{network_code}/labels/{label}" 58 plural: "labels" 59 singular: "label" 60 }; 61 62 // Identifier. The resource name of the Label. 63 // Format: `networks/{network_code}/labels/{label_id}` 64 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 65} 66 67// Request object for GetLabel method. 68message GetLabelRequest { 69 // Required. The resource name of the Label. 70 // Format: `networks/{network_code}/labels/{label_id}` 71 string name = 1 [ 72 (google.api.field_behavior) = REQUIRED, 73 (google.api.resource_reference) = { type: "admanager.googleapis.com/Label" } 74 ]; 75} 76 77// Request object for ListLabels method. 78message ListLabelsRequest { 79 // Required. The parent, which owns this collection of Labels. 80 // Format: `networks/{network_code}` 81 string parent = 1 [ 82 (google.api.field_behavior) = REQUIRED, 83 (google.api.resource_reference) = { 84 type: "admanager.googleapis.com/Network" 85 } 86 ]; 87 88 // Optional. The maximum number of Labels to return. The service may return 89 // fewer than this value. If unspecified, at most 50 labels will be returned. 90 // The maximum value is 1000; values above 1000 will be coerced to 1000. 91 int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; 92 93 // Optional. A page token, received from a previous `ListLabels` call. 94 // Provide this to retrieve the subsequent page. 95 // 96 // When paginating, all other parameters provided to `ListLabels` must match 97 // the call that provided the page token. 98 string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; 99 100 // Optional. Expression to filter the response. 101 // See syntax details at 102 // https://developers.google.com/ad-manager/api/beta/filters 103 string filter = 4 [(google.api.field_behavior) = OPTIONAL]; 104 105 // Optional. Expression to specify sorting order. 106 // See syntax details at 107 // https://developers.google.com/ad-manager/api/beta/filters#order 108 string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; 109 110 // Optional. Number of individual resources to skip while paginating. 111 int32 skip = 6 [(google.api.field_behavior) = OPTIONAL]; 112} 113 114// Response object for ListLabelsRequest containing matching Label 115// resources. 116message ListLabelsResponse { 117 // The Label from the specified network. 118 repeated Label labels = 1; 119 120 // A token, which can be sent as `page_token` to retrieve the next page. 121 // If this field is omitted, there are no subsequent pages. 122 string next_page_token = 2; 123 124 // Total number of Labels. 125 // If a filter was included in the request, this reflects the total number 126 // after the filtering is applied. 127 // 128 // `total_size` will not be calculated in the response unless it has been 129 // included in a response field mask. The response field mask can be provided 130 // to the method by using the URL parameter `$fields` or `fields`, or by using 131 // the HTTP/gRPC header `X-Goog-FieldMask`. 132 // 133 // For more information, see 134 // https://developers.google.com/ad-manager/api/beta/field-masks 135 int32 total_size = 3; 136} 137