xref: /aosp_15_r20/external/googleapis/google/ads/admanager/v1/user_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/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 = "UserServiceProto";
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 User objects.
33service UserService {
34  option (google.api.default_host) = "admanager.googleapis.com";
35
36  // API to retrieve a User object.
37  rpc GetUser(GetUserRequest) returns (User) {
38    option (google.api.http) = {
39      get: "/v1/{name=networks/*/users/*}"
40    };
41    option (google.api.method_signature) = "name";
42  }
43
44  // API to retrieve a list of User objects.
45  rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {
46    option (google.api.http) = {
47      get: "/v1/{parent=networks/*}/users"
48    };
49    option (google.api.method_signature) = "parent";
50  }
51}
52
53// The User resource.
54message User {
55  option (google.api.resource) = {
56    type: "admanager.googleapis.com/User"
57    pattern: "networks/{network_code}/users/{user}"
58    plural: "users"
59    singular: "user"
60  };
61
62  // Identifier. The resource name of the User.
63  // Format: `networks/{network_code}/users/{user_id}`
64  string name = 1 [(google.api.field_behavior) = IDENTIFIER];
65
66  // Output only. `User` ID.
67  int64 user_id = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
68
69  // Required. The name of the User. It has a maximum length of 128 characters.
70  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
71
72  // Required. The email or login of the User. In order to create a new user,
73  // you must already have a Google Account.
74  string email = 3 [(google.api.field_behavior) = REQUIRED];
75
76  // Required. The unique Role ID of the User. Roles that are created by Google
77  // will have negative IDs.
78  string role = 4 [
79    (google.api.field_behavior) = REQUIRED,
80    (google.api.resource_reference) = { type: "admanager.googleapis.com/Role" }
81  ];
82
83  // Output only. Specifies whether or not the User is active. An inactive user
84  // cannot log in to the system or perform any operations.
85  bool active = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
86
87  // Optional. An identifier for the User that is meaningful to the publisher.
88  // This attribute has a maximum length of 255 characters.
89  string external_id = 7 [(google.api.field_behavior) = OPTIONAL];
90
91  // Output only. Whether the user is an OAuth2 service account user.
92  // Service account users can only be added through the UI.
93  bool service_account = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
94
95  // Optional. The IANA Time Zone Database time zone, e.g. "America/New_York",
96  // used in the orders and line items UI for this User. If not provided, the UI
97  // then defaults to using the Network's timezone. This setting only affects
98  // the UI for this user and does not affect the timezone of any dates and
99  // times returned in API responses.
100  string orders_ui_local_time_zone = 9 [(google.api.field_behavior) = OPTIONAL];
101}
102
103// Request object for GetUser method.
104message GetUserRequest {
105  // Required. The resource name of the User.
106  // Format: `networks/{network_code}/users/{user_id}`
107  string name = 1 [
108    (google.api.field_behavior) = REQUIRED,
109    (google.api.resource_reference) = { type: "admanager.googleapis.com/User" }
110  ];
111}
112
113// Request object for ListUsers method.
114message ListUsersRequest {
115  // Required. The parent, which owns this collection of Users.
116  // Format: `networks/{network_code}`
117  string parent = 1 [
118    (google.api.field_behavior) = REQUIRED,
119    (google.api.resource_reference) = {
120      type: "admanager.googleapis.com/Network"
121    }
122  ];
123
124  // Optional. The maximum number of Users to return. The service may return
125  // fewer than this value. If unspecified, at most 50 users will be returned.
126  // The maximum value is 1000; values above 1000 will be coerced to 1000.
127  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
128
129  // Optional. A page token, received from a previous `ListUsers` call.
130  // Provide this to retrieve the subsequent page.
131  //
132  // When paginating, all other parameters provided to `ListUsers` must match
133  // the call that provided the page token.
134  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
135
136  // Optional. Expression to filter the response.
137  // See syntax details at
138  // https://developers.google.com/ad-manager/api/beta/filters
139  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
140
141  // Optional. Expression to specify sorting order.
142  // See syntax details at
143  // https://developers.google.com/ad-manager/api/beta/filters#order
144  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
145
146  // Optional. Number of individual resources to skip while paginating.
147  int32 skip = 6 [(google.api.field_behavior) = OPTIONAL];
148}
149
150// Response object for ListUsersRequest containing matching User resources.
151message ListUsersResponse {
152  // The User from the specified network.
153  repeated User users = 1;
154
155  // A token, which can be sent as `page_token` to retrieve the next page.
156  // If this field is omitted, there are no subsequent pages.
157  string next_page_token = 2;
158
159  // Total number of Users.
160  // If a filter was included in the request, this reflects the total number
161  // after the filtering is applied.
162  //
163  // `total_size` will not be calculated in the response unless it has been
164  // included in a response field mask. The response field mask can be provided
165  // to the method by using the URL parameter `$fields` or `fields`, or by using
166  // the HTTP/gRPC header `X-Goog-FieldMask`.
167  //
168  // For more information, see
169  // https://developers.google.com/ad-manager/api/beta/field-masks
170  int32 total_size = 3;
171}
172