xref: /aosp_15_r20/external/googleapis/google/ads/admanager/v1/custom_field_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/custom_field_enums.proto";
20import "google/api/annotations.proto";
21import "google/api/client.proto";
22import "google/api/field_behavior.proto";
23import "google/api/resource.proto";
24
25option csharp_namespace = "Google.Ads.AdManager.V1";
26option go_package = "google.golang.org/genproto/googleapis/ads/admanager/v1;admanager";
27option java_multiple_files = true;
28option java_outer_classname = "CustomFieldServiceProto";
29option java_package = "com.google.ads.admanager.v1";
30option objc_class_prefix = "GAA";
31option php_namespace = "Google\\Ads\\AdManager\\V1";
32
33// Provides methods for handling `CustomField` objects.
34service CustomFieldService {
35  option (google.api.default_host) = "admanager.googleapis.com";
36
37  // API to retrieve a `CustomField` object.
38  rpc GetCustomField(GetCustomFieldRequest) returns (CustomField) {
39    option (google.api.http) = {
40      get: "/v1/{name=networks/*/customFields/*}"
41    };
42    option (google.api.method_signature) = "name";
43  }
44
45  // API to retrieve a list of `CustomField` objects.
46  rpc ListCustomFields(ListCustomFieldsRequest)
47      returns (ListCustomFieldsResponse) {
48    option (google.api.http) = {
49      get: "/v1/{parent=networks/*}/customFields"
50    };
51    option (google.api.method_signature) = "parent";
52  }
53}
54
55// The `CustomField` resource.
56message CustomField {
57  option (google.api.resource) = {
58    type: "admanager.googleapis.com/CustomField"
59    pattern: "networks/{network_code}/customFields/{custom_field}"
60    plural: "customFields"
61    singular: "customField"
62  };
63
64  // Identifier. The resource name of the `CustomField`.
65  // Format: `networks/{network_code}/customFields/{custom_field_id}`
66  string name = 1 [(google.api.field_behavior) = IDENTIFIER];
67
68  // Output only. `CustomField` ID.
69  int64 custom_field_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
70
71  // Required. The display name of the `CustomField`.
72  //
73  // This value has a maximum length of 127 characters.
74  string display_name = 3 [(google.api.field_behavior) = REQUIRED];
75
76  // Optional. The description of the `CustomField`.
77  //
78  // This value has a maximum length of 511 characters.
79  string description = 4 [(google.api.field_behavior) = OPTIONAL];
80
81  // Output only. The status of the `CustomField`.
82  CustomFieldStatusEnum.CustomFieldStatus status = 5
83      [(google.api.field_behavior) = OUTPUT_ONLY];
84
85  // Required. The type of entity the `CustomField` can be applied to.
86  CustomFieldEntityTypeEnum.CustomFieldEntityType entity_type = 7
87      [(google.api.field_behavior) = REQUIRED];
88
89  // Required. The data type of the `CustomField`.
90  CustomFieldDataTypeEnum.CustomFieldDataType data_type = 8
91      [(google.api.field_behavior) = REQUIRED];
92
93  // Required. The visibility of the `CustomField`.
94  CustomFieldVisibilityEnum.CustomFieldVisibility visibility = 9
95      [(google.api.field_behavior) = REQUIRED];
96
97  // Optional. The drop-down options for the `CustomField`.
98  //
99  // Only applicable for `CustomField` with the drop-down data type.
100  repeated CustomFieldOption options = 10
101      [(google.api.field_behavior) = OPTIONAL];
102}
103
104// An option for a drop-down `CustomField`.
105message CustomFieldOption {
106  // Output only. `CustomFieldOption` ID.
107  int64 custom_field_option_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
108
109  // Required. The display name of the `CustomFieldOption`.
110  //
111  // This value has a maximum length of 127 characters.
112  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
113}
114
115// Request object for `GetCustomField` method.
116message GetCustomFieldRequest {
117  // Required. The resource name of the CustomField.
118  // Format: `networks/{network_code}/customFields/{custom_field_id}`
119  string name = 1 [
120    (google.api.field_behavior) = REQUIRED,
121    (google.api.resource_reference) = {
122      type: "admanager.googleapis.com/CustomField"
123    }
124  ];
125}
126
127// Request object for `ListCustomFields` method.
128message ListCustomFieldsRequest {
129  // Required. The parent, which owns this collection of CustomFields.
130  // Format: `networks/{network_code}`
131  string parent = 1 [
132    (google.api.field_behavior) = REQUIRED,
133    (google.api.resource_reference) = {
134      type: "admanager.googleapis.com/Network"
135    }
136  ];
137
138  // Optional. The maximum number of `CustomFields` to return. The service may
139  // return fewer than this value. If unspecified, at most 50 `CustomFields`
140  // will be returned. The maximum value is 1000; values above 1000 will be
141  // coerced to 1000.
142  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
143
144  // Optional. A page token, received from a previous `ListCustomFields` call.
145  // Provide this to retrieve the subsequent page.
146  //
147  // When paginating, all other parameters provided to `ListCustomFields` must
148  // match the call that provided the page token.
149  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
150
151  // Optional. Expression to filter the response.
152  // See syntax details at https://google.aip.dev/160
153  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
154
155  // Optional. Expression to specify sorting order.
156  // See syntax details at https://google.aip.dev/132#ordering
157  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
158
159  // Optional. Number of individual resources to skip while paginating.
160  int32 skip = 6 [(google.api.field_behavior) = OPTIONAL];
161}
162
163// Response object for `ListCustomFieldsRequest` containing matching
164// `CustomField` objects.
165message ListCustomFieldsResponse {
166  // The `CustomField` objects from the specified network.
167  repeated CustomField custom_fields = 1;
168
169  // A token, which can be sent as `page_token` to retrieve the next page.
170  // If this field is omitted, there are no subsequent pages.
171  string next_page_token = 2;
172
173  // Total number of `CustomField` objects.
174  // If a filter was included in the request, this reflects the total number
175  // after the filtering is applied.
176  //
177  // `total_size` will not be calculated in the response unless it has been
178  // included in a response field mask. The response field mask can be provided
179  // to the method by using the URL parameter `$fields` or `fields`, or by using
180  // the HTTP/gRPC header `X-Goog-FieldMask`.
181  //
182  // For more information, see
183  // [System Parameters](https://cloud.google.com/apis/docs/system-parameters).
184  int32 total_size = 3;
185}
186