google_cloud_resource_manager/types.rs
1//! The data types sent to and returned from the API client.
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4
5/// Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
6#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
7pub struct AuditConfig {
8 /**
9 * Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
10 */
11 #[serde(
12 default,
13 skip_serializing_if = "Vec::is_empty",
14 deserialize_with = "crate::utils::deserialize_null_vector::deserialize",
15 rename = "auditLogConfigs"
16 )]
17 pub audit_log_configs: Vec<AuditLogConfig>,
18 /**
19 * Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
20 */
21 #[serde(
22 default,
23 skip_serializing_if = "String::is_empty",
24 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
25 )]
26 pub service: String,
27}
28
29/**
30 * The log type that this config enables.
31 */
32#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
33pub enum LogType {
34 #[serde(rename = "ADMIN_READ")]
35 AdminRead,
36 #[serde(rename = "DATA_READ")]
37 DataRead,
38 #[serde(rename = "DATA_WRITE")]
39 DataWrite,
40 #[serde(rename = "LOG_TYPE_UNSPECIFIED")]
41 LogTypeUnspecified,
42 #[serde(rename = "")]
43 #[default]
44 Noop,
45 #[serde(other)]
46 FallthroughString,
47}
48
49impl std::fmt::Display for LogType {
50 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
51 match self {
52 LogType::AdminRead => "ADMIN_READ",
53 LogType::DataRead => "DATA_READ",
54 LogType::DataWrite => "DATA_WRITE",
55 LogType::LogTypeUnspecified => "LOG_TYPE_UNSPECIFIED",
56 LogType::Noop => "",
57 LogType::FallthroughString => "*",
58 }
59 .fmt(f)
60 }
61}
62
63impl LogType {
64 pub fn is_noop(&self) -> bool {
65 matches!(self, LogType::Noop)
66 }
67}
68
69/// Provides the configuration for logging a type of permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
70#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
71pub struct AuditLogConfig {
72 /**
73 * Provides the configuration for logging a type of permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
74 */
75 #[serde(
76 default,
77 skip_serializing_if = "Vec::is_empty",
78 deserialize_with = "crate::utils::deserialize_null_vector::deserialize",
79 rename = "exemptedMembers"
80 )]
81 pub exempted_members: Vec<String>,
82 /**
83 * Provides the configuration for logging a type of permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
84 */
85 #[serde(default, skip_serializing_if = "Option::is_none", rename = "logType")]
86 pub log_type: Option<LogType>,
87}
88
89/// Associates `members` with a `role`.
90#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
91pub struct Binding {
92 /**
93 * Associates `members` with a `role`.
94 */
95 #[serde(default, skip_serializing_if = "Option::is_none")]
96 pub condition: Option<Expr>,
97 /**
98 * Associates `members` with a `role`.
99 */
100 #[serde(
101 default,
102 skip_serializing_if = "Vec::is_empty",
103 deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
104 )]
105 pub members: Vec<String>,
106 /**
107 * Associates `members` with a `role`.
108 */
109 #[serde(
110 default,
111 skip_serializing_if = "String::is_empty",
112 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
113 )]
114 pub role: String,
115}
116
117/**
118 * The type of this operation.
119 */
120#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
121pub enum OperationType {
122 #[serde(rename = "CREATE")]
123 Create,
124 #[serde(rename = "MOVE")]
125 Move,
126 #[serde(rename = "OPERATION_TYPE_UNSPECIFIED")]
127 OperationTypeUnspecified,
128 #[serde(rename = "")]
129 #[default]
130 Noop,
131 #[serde(other)]
132 FallthroughString,
133}
134
135impl std::fmt::Display for OperationType {
136 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
137 match self {
138 OperationType::Create => "CREATE",
139 OperationType::Move => "MOVE",
140 OperationType::OperationTypeUnspecified => "OPERATION_TYPE_UNSPECIFIED",
141 OperationType::Noop => "",
142 OperationType::FallthroughString => "*",
143 }
144 .fmt(f)
145 }
146}
147
148impl OperationType {
149 pub fn is_noop(&self) -> bool {
150 matches!(self, OperationType::Noop)
151 }
152}
153
154/// Metadata describing a long running folder operation
155#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
156pub struct FolderOperation {
157 /**
158 * Metadata describing a long running folder operation
159 */
160 #[serde(
161 default,
162 skip_serializing_if = "String::is_empty",
163 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
164 rename = "destinationParent"
165 )]
166 pub destination_parent: String,
167 /**
168 * Metadata describing a long running folder operation
169 */
170 #[serde(
171 default,
172 skip_serializing_if = "String::is_empty",
173 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
174 rename = "displayName"
175 )]
176 pub display_name: String,
177 /**
178 * Metadata describing a long running folder operation
179 */
180 #[serde(
181 default,
182 skip_serializing_if = "Option::is_none",
183 rename = "operationType"
184 )]
185 pub operation_type: Option<OperationType>,
186 /**
187 * Metadata describing a long running folder operation
188 */
189 #[serde(
190 default,
191 skip_serializing_if = "String::is_empty",
192 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
193 rename = "sourceParent"
194 )]
195 pub source_parent: String,
196}
197
198/// Metadata pertaining to the Folder creation process.
199#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
200pub struct CreateFolderMetadata {
201 /**
202 * Metadata pertaining to the Folder creation process.
203 */
204 #[serde(
205 default,
206 skip_serializing_if = "String::is_empty",
207 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
208 rename = "displayName"
209 )]
210 pub display_name: String,
211 /**
212 * Metadata pertaining to the Folder creation process.
213 */
214 #[serde(
215 default,
216 skip_serializing_if = "String::is_empty",
217 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
218 )]
219 pub parent: String,
220}
221
222/// A status object which is used as the `metadata` field for the Operation returned by CreateProject. It provides insight for when significant phases of Project creation have completed.
223#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
224pub struct CreateProjectMetadata {
225 /**
226 * A status object which is used as the `metadata` field for the Operation returned by CreateProject. It provides insight for when significant phases of Project creation have completed.
227 */
228 #[serde(
229 default,
230 skip_serializing_if = "Option::is_none",
231 deserialize_with = "crate::utils::date_time_format::deserialize",
232 rename = "createTime"
233 )]
234 pub create_time: Option<chrono::DateTime<chrono::Utc>>,
235 /**
236 * A status object which is used as the `metadata` field for the Operation returned by CreateProject. It provides insight for when significant phases of Project creation have completed.
237 */
238 #[serde(
239 default,
240 deserialize_with = "crate::utils::deserialize_null_boolean::deserialize"
241 )]
242 pub gettable: bool,
243 /**
244 * A status object which is used as the `metadata` field for the Operation returned by CreateProject. It provides insight for when significant phases of Project creation have completed.
245 */
246 #[serde(
247 default,
248 deserialize_with = "crate::utils::deserialize_null_boolean::deserialize"
249 )]
250 pub ready: bool,
251}
252
253/// A status object which is used as the `metadata` field for the Operation returned by MoveProject.
254#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
255pub struct MoveProjectMetadata {}
256
257/// Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
258#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
259pub struct Expr {
260 /**
261 * Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
262 */
263 #[serde(
264 default,
265 skip_serializing_if = "String::is_empty",
266 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
267 )]
268 pub description: String,
269 /**
270 * Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
271 */
272 #[serde(
273 default,
274 skip_serializing_if = "String::is_empty",
275 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
276 )]
277 pub expression: String,
278 /**
279 * Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
280 */
281 #[serde(
282 default,
283 skip_serializing_if = "String::is_empty",
284 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
285 )]
286 pub location: String,
287 /**
288 * Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
289 */
290 #[serde(
291 default,
292 skip_serializing_if = "String::is_empty",
293 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
294 )]
295 pub title: String,
296}
297
298/**
299 * Output only. The lifecycle state of the folder. Updates to the lifecycle_state must be performed via DeleteFolder and UndeleteFolder.
300 */
301#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
302pub enum LifecycleState {
303 #[serde(rename = "ACTIVE")]
304 Active,
305 #[serde(rename = "DELETE_REQUESTED")]
306 DeleteRequested,
307 #[serde(rename = "LIFECYCLE_STATE_UNSPECIFIED")]
308 LifecycleStateUnspecified,
309 #[serde(rename = "")]
310 #[default]
311 Noop,
312 #[serde(other)]
313 FallthroughString,
314}
315
316impl std::fmt::Display for LifecycleState {
317 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
318 match self {
319 LifecycleState::Active => "ACTIVE",
320 LifecycleState::DeleteRequested => "DELETE_REQUESTED",
321 LifecycleState::LifecycleStateUnspecified => "LIFECYCLE_STATE_UNSPECIFIED",
322 LifecycleState::Noop => "",
323 LifecycleState::FallthroughString => "*",
324 }
325 .fmt(f)
326 }
327}
328
329impl LifecycleState {
330 pub fn is_noop(&self) -> bool {
331 matches!(self, LifecycleState::Noop)
332 }
333}
334
335/// A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
336#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
337pub struct Folder {
338 /**
339 * A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
340 */
341 #[serde(
342 default,
343 skip_serializing_if = "Option::is_none",
344 deserialize_with = "crate::utils::date_time_format::deserialize",
345 rename = "createTime"
346 )]
347 pub create_time: Option<chrono::DateTime<chrono::Utc>>,
348 /**
349 * A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
350 */
351 #[serde(
352 default,
353 skip_serializing_if = "String::is_empty",
354 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
355 rename = "displayName"
356 )]
357 pub display_name: String,
358 /**
359 * A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
360 */
361 #[serde(
362 default,
363 skip_serializing_if = "Option::is_none",
364 rename = "lifecycleState"
365 )]
366 pub lifecycle_state: Option<LifecycleState>,
367 /**
368 * A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
369 */
370 #[serde(
371 default,
372 skip_serializing_if = "String::is_empty",
373 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
374 )]
375 pub name: String,
376 /**
377 * A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
378 */
379 #[serde(
380 default,
381 skip_serializing_if = "String::is_empty",
382 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
383 )]
384 pub parent: String,
385}
386
387/**
388 * The type of operation error experienced.
389 */
390#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
391pub enum ErrorMessageId {
392 #[serde(rename = "ACTIVE_FOLDER_HEIGHT_VIOLATION")]
393 ActiveFolderHeightViolation,
394 #[serde(rename = "CYCLE_INTRODUCED_VIOLATION")]
395 CycleIntroducedViolation,
396 #[serde(rename = "DELETED_FOLDER_HEIGHT_VIOLATION")]
397 DeletedFolderHeightViolation,
398 #[serde(rename = "ERROR_TYPE_UNSPECIFIED")]
399 ErrorTypeUnspecified,
400 #[serde(rename = "FOLDER_BEING_MOVED_VIOLATION")]
401 FolderBeingMovedViolation,
402 #[serde(rename = "FOLDER_NAME_UNIQUENESS_VIOLATION")]
403 FolderNameUniquenessViolation,
404 #[serde(rename = "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION")]
405 FolderToDeleteNonEmptyViolation,
406 #[serde(rename = "MAX_CHILD_FOLDERS_VIOLATION")]
407 MaxChildFoldersViolation,
408 #[serde(rename = "PARENT_DELETED_VIOLATION")]
409 ParentDeletedViolation,
410 #[serde(rename = "RESOURCE_DELETED_VIOLATION")]
411 ResourceDeletedViolation,
412 #[serde(rename = "")]
413 #[default]
414 Noop,
415 #[serde(other)]
416 FallthroughString,
417}
418
419impl std::fmt::Display for ErrorMessageId {
420 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
421 match self {
422 ErrorMessageId::ActiveFolderHeightViolation => "ACTIVE_FOLDER_HEIGHT_VIOLATION",
423 ErrorMessageId::CycleIntroducedViolation => "CYCLE_INTRODUCED_VIOLATION",
424 ErrorMessageId::DeletedFolderHeightViolation => "DELETED_FOLDER_HEIGHT_VIOLATION",
425 ErrorMessageId::ErrorTypeUnspecified => "ERROR_TYPE_UNSPECIFIED",
426 ErrorMessageId::FolderBeingMovedViolation => "FOLDER_BEING_MOVED_VIOLATION",
427 ErrorMessageId::FolderNameUniquenessViolation => "FOLDER_NAME_UNIQUENESS_VIOLATION",
428 ErrorMessageId::FolderToDeleteNonEmptyViolation => {
429 "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION"
430 }
431 ErrorMessageId::MaxChildFoldersViolation => "MAX_CHILD_FOLDERS_VIOLATION",
432 ErrorMessageId::ParentDeletedViolation => "PARENT_DELETED_VIOLATION",
433 ErrorMessageId::ResourceDeletedViolation => "RESOURCE_DELETED_VIOLATION",
434 ErrorMessageId::Noop => "",
435 ErrorMessageId::FallthroughString => "*",
436 }
437 .fmt(f)
438 }
439}
440
441impl ErrorMessageId {
442 pub fn is_noop(&self) -> bool {
443 matches!(self, ErrorMessageId::Noop)
444 }
445}
446
447/// A classification of the Folder Operation error.
448#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
449pub struct FolderOperationError {
450 /**
451 * A classification of the Folder Operation error.
452 */
453 #[serde(
454 default,
455 skip_serializing_if = "Option::is_none",
456 rename = "errorMessageId"
457 )]
458 pub error_message_id: Option<ErrorMessageId>,
459}
460
461/// Request message for `GetIamPolicy` method.
462#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
463pub struct GetIamPolicyRequest {
464 /**
465 * Request message for `GetIamPolicy` method.
466 */
467 #[serde(default, skip_serializing_if = "Option::is_none")]
468 pub options: Option<GetPolicyOptions>,
469}
470
471/// Encapsulates settings provided to GetIamPolicy.
472#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
473pub struct GetPolicyOptions {
474 /**
475 * Encapsulates settings provided to GetIamPolicy.
476 */
477 #[serde(
478 default,
479 skip_serializing_if = "crate::utils::zero_i64",
480 deserialize_with = "crate::utils::deserialize_null_i64::deserialize",
481 rename = "requestedPolicyVersion"
482 )]
483 pub requested_policy_version: i64,
484}
485
486/// The ListFolders response message.
487#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
488pub struct ListFoldersResponse {
489 /**
490 * The ListFolders response message.
491 */
492 #[serde(
493 default,
494 skip_serializing_if = "Vec::is_empty",
495 deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
496 )]
497 pub folders: Vec<Folder>,
498 /**
499 * The ListFolders response message.
500 */
501 #[serde(
502 default,
503 skip_serializing_if = "String::is_empty",
504 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
505 rename = "nextPageToken"
506 )]
507 pub next_page_token: String,
508}
509
510/// Metadata pertaining to the folder move process.
511#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
512pub struct MoveFolderMetadata {
513 /**
514 * Metadata pertaining to the folder move process.
515 */
516 #[serde(
517 default,
518 skip_serializing_if = "String::is_empty",
519 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
520 rename = "destinationParent"
521 )]
522 pub destination_parent: String,
523 /**
524 * Metadata pertaining to the folder move process.
525 */
526 #[serde(
527 default,
528 skip_serializing_if = "String::is_empty",
529 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
530 rename = "displayName"
531 )]
532 pub display_name: String,
533 /**
534 * Metadata pertaining to the folder move process.
535 */
536 #[serde(
537 default,
538 skip_serializing_if = "String::is_empty",
539 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
540 rename = "sourceParent"
541 )]
542 pub source_parent: String,
543}
544
545/// The MoveFolder request message.
546#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
547pub struct MoveFolderRequest {
548 /**
549 * The MoveFolder request message.
550 */
551 #[serde(
552 default,
553 skip_serializing_if = "String::is_empty",
554 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
555 rename = "destinationParent"
556 )]
557 pub destination_parent: String,
558}
559
560/// This resource represents a long-running operation that is the result of a network API call.
561#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
562pub struct Operation {
563 /**
564 * This resource represents a long-running operation that is the result of a network API call.
565 */
566 #[serde(
567 default,
568 deserialize_with = "crate::utils::deserialize_null_boolean::deserialize"
569 )]
570 pub done: bool,
571 /**
572 * This resource represents a long-running operation that is the result of a network API call.
573 */
574 #[serde(default, skip_serializing_if = "Option::is_none")]
575 pub error: Option<Status>,
576 /**
577 * This resource represents a long-running operation that is the result of a network API call.
578 */
579 #[serde(default, skip_serializing_if = "Option::is_none")]
580 pub metadata: Option<serde_json::Value>,
581 /**
582 * This resource represents a long-running operation that is the result of a network API call.
583 */
584 #[serde(
585 default,
586 skip_serializing_if = "String::is_empty",
587 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
588 )]
589 pub name: String,
590 /**
591 * This resource represents a long-running operation that is the result of a network API call.
592 */
593 #[serde(default, skip_serializing_if = "Option::is_none")]
594 pub response: Option<serde_json::Value>,
595}
596
597/// An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
598#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
599pub struct Policy {
600 /**
601 * An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). \*\*JSON example:\*\* { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } \*\*YAML example:\*\* bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
602 */
603 #[serde(
604 default,
605 skip_serializing_if = "Vec::is_empty",
606 deserialize_with = "crate::utils::deserialize_null_vector::deserialize",
607 rename = "auditConfigs"
608 )]
609 pub audit_configs: Vec<AuditConfig>,
610 /**
611 * An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). \*\*JSON example:\*\* { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } \*\*YAML example:\*\* bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
612 */
613 #[serde(
614 default,
615 skip_serializing_if = "Vec::is_empty",
616 deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
617 )]
618 pub bindings: Vec<Binding>,
619 /**
620 * An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). \*\*JSON example:\*\* { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } \*\*YAML example:\*\* bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
621 */
622 #[serde(default, skip_serializing_if = "Option::is_none")]
623 pub etag: Option<bytes::Bytes>,
624 /**
625 * An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). \*\*JSON example:\*\* { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } \*\*YAML example:\*\* bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
626 */
627 #[serde(
628 default,
629 skip_serializing_if = "crate::utils::zero_i64",
630 deserialize_with = "crate::utils::deserialize_null_i64::deserialize"
631 )]
632 pub version: i64,
633}
634
635/// The request message for searching folders.
636#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
637pub struct SearchFoldersRequest {
638 /**
639 * The request message for searching folders.
640 */
641 #[serde(
642 default,
643 skip_serializing_if = "crate::utils::zero_i64",
644 deserialize_with = "crate::utils::deserialize_null_i64::deserialize",
645 rename = "pageSize"
646 )]
647 pub page_size: i64,
648 /**
649 * The request message for searching folders.
650 */
651 #[serde(
652 default,
653 skip_serializing_if = "String::is_empty",
654 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
655 rename = "pageToken"
656 )]
657 pub page_token: String,
658 /**
659 * The request message for searching folders.
660 */
661 #[serde(
662 default,
663 skip_serializing_if = "String::is_empty",
664 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
665 )]
666 pub query: String,
667}
668
669/// The response message for searching folders.
670#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
671pub struct SearchFoldersResponse {
672 /**
673 * The response message for searching folders.
674 */
675 #[serde(
676 default,
677 skip_serializing_if = "Vec::is_empty",
678 deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
679 )]
680 pub folders: Vec<Folder>,
681 /**
682 * The response message for searching folders.
683 */
684 #[serde(
685 default,
686 skip_serializing_if = "String::is_empty",
687 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
688 rename = "nextPageToken"
689 )]
690 pub next_page_token: String,
691}
692
693/// Request message for `SetIamPolicy` method.
694#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
695pub struct SetIamPolicyRequest {
696 /**
697 * Request message for `SetIamPolicy` method.
698 */
699 #[serde(default, skip_serializing_if = "Option::is_none")]
700 pub policy: Option<Policy>,
701 /**
702 * Request message for `SetIamPolicy` method.
703 */
704 #[serde(
705 default,
706 skip_serializing_if = "String::is_empty",
707 deserialize_with = "crate::utils::deserialize_null_string::deserialize",
708 rename = "updateMask"
709 )]
710 pub update_mask: String,
711}
712
713/// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
714#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
715pub struct Status {
716 /**
717 * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
718 */
719 #[serde(
720 default,
721 skip_serializing_if = "crate::utils::zero_i64",
722 deserialize_with = "crate::utils::deserialize_null_i64::deserialize"
723 )]
724 pub code: i64,
725 /**
726 * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
727 */
728 #[serde(
729 default,
730 skip_serializing_if = "Vec::is_empty",
731 deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
732 )]
733 pub details: Vec<serde_json::Value>,
734 /**
735 * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
736 */
737 #[serde(
738 default,
739 skip_serializing_if = "String::is_empty",
740 deserialize_with = "crate::utils::deserialize_null_string::deserialize"
741 )]
742 pub message: String,
743}
744
745/// Request message for `TestIamPermissions` method.
746#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
747pub struct TestIamPermissionsRequest {
748 /**
749 * Request message for `TestIamPermissions` method.
750 */
751 #[serde(
752 default,
753 skip_serializing_if = "Vec::is_empty",
754 deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
755 )]
756 pub permissions: Vec<String>,
757}
758
759/// Response message for `TestIamPermissions` method.
760#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
761pub struct TestIamPermissionsResponse {
762 /**
763 * Response message for `TestIamPermissions` method.
764 */
765 #[serde(
766 default,
767 skip_serializing_if = "Vec::is_empty",
768 deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
769 )]
770 pub permissions: Vec<String>,
771}
772
773/**
774 * V1 error format.
775 */
776#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
777pub enum Xgafv {
778 #[serde(rename = "1")]
779 One,
780 #[serde(rename = "2")]
781 Two,
782 #[serde(rename = "")]
783 #[default]
784 Noop,
785 #[serde(other)]
786 FallthroughString,
787}
788
789impl std::fmt::Display for Xgafv {
790 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
791 match self {
792 Xgafv::One => "1",
793 Xgafv::Two => "2",
794 Xgafv::Noop => "",
795 Xgafv::FallthroughString => "*",
796 }
797 .fmt(f)
798 }
799}
800
801impl Xgafv {
802 pub fn is_noop(&self) -> bool {
803 matches!(self, Xgafv::Noop)
804 }
805}
806
807/**
808 * Data format for response.
809 */
810#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
811pub enum Alt {
812 #[serde(rename = "json")]
813 Json,
814 #[serde(rename = "media")]
815 Media,
816 #[serde(rename = "proto")]
817 Proto,
818 #[serde(rename = "")]
819 #[default]
820 Noop,
821 #[serde(other)]
822 FallthroughString,
823}
824
825impl std::fmt::Display for Alt {
826 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
827 match self {
828 Alt::Json => "json",
829 Alt::Media => "media",
830 Alt::Proto => "proto",
831 Alt::Noop => "",
832 Alt::FallthroughString => "*",
833 }
834 .fmt(f)
835 }
836}
837
838impl Alt {
839 pub fn is_noop(&self) -> bool {
840 matches!(self, Alt::Noop)
841 }
842}