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