//! The data types sent to and returned from the API client.
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
/// 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.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct AuditConfig {
/**
* 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.
*/
#[serde(
default,
skip_serializing_if = "Vec::is_empty",
deserialize_with = "crate::utils::deserialize_null_vector::deserialize",
rename = "auditLogConfigs"
)]
pub audit_log_configs: Vec<AuditLogConfig>,
/**
* 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.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub service: String,
}
/**
* The log type that this config enables.
*/
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
pub enum LogType {
#[serde(rename = "ADMIN_READ")]
AdminRead,
#[serde(rename = "DATA_READ")]
DataRead,
#[serde(rename = "DATA_WRITE")]
DataWrite,
#[serde(rename = "LOG_TYPE_UNSPECIFIED")]
LogTypeUnspecified,
#[serde(rename = "")]
#[default]
Noop,
#[serde(other)]
FallthroughString,
}
impl std::fmt::Display for LogType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
LogType::AdminRead => "ADMIN_READ",
LogType::DataRead => "DATA_READ",
LogType::DataWrite => "DATA_WRITE",
LogType::LogTypeUnspecified => "LOG_TYPE_UNSPECIFIED",
LogType::Noop => "",
LogType::FallthroughString => "*",
}
.fmt(f)
}
}
impl LogType {
pub fn is_noop(&self) -> bool {
matches!(self, LogType::Noop)
}
}
/// 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.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct AuditLogConfig {
/**
* 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.
*/
#[serde(
default,
skip_serializing_if = "Vec::is_empty",
deserialize_with = "crate::utils::deserialize_null_vector::deserialize",
rename = "exemptedMembers"
)]
pub exempted_members: Vec<String>,
/**
* 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.
*/
#[serde(default, skip_serializing_if = "Option::is_none", rename = "logType")]
pub log_type: Option<LogType>,
}
/// Associates `members` with a `role`.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct Binding {
/**
* Associates `members` with a `role`.
*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub condition: Option<Expr>,
/**
* Associates `members` with a `role`.
*/
#[serde(
default,
skip_serializing_if = "Vec::is_empty",
deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
)]
pub members: Vec<String>,
/**
* Associates `members` with a `role`.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub role: String,
}
/**
* The type of this operation.
*/
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
pub enum OperationType {
#[serde(rename = "CREATE")]
Create,
#[serde(rename = "MOVE")]
Move,
#[serde(rename = "OPERATION_TYPE_UNSPECIFIED")]
OperationTypeUnspecified,
#[serde(rename = "")]
#[default]
Noop,
#[serde(other)]
FallthroughString,
}
impl std::fmt::Display for OperationType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
OperationType::Create => "CREATE",
OperationType::Move => "MOVE",
OperationType::OperationTypeUnspecified => "OPERATION_TYPE_UNSPECIFIED",
OperationType::Noop => "",
OperationType::FallthroughString => "*",
}
.fmt(f)
}
}
impl OperationType {
pub fn is_noop(&self) -> bool {
matches!(self, OperationType::Noop)
}
}
/// Metadata describing a long running folder operation
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct FolderOperation {
/**
* Metadata describing a long running folder operation
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "destinationParent"
)]
pub destination_parent: String,
/**
* Metadata describing a long running folder operation
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "displayName"
)]
pub display_name: String,
/**
* Metadata describing a long running folder operation
*/
#[serde(
default,
skip_serializing_if = "Option::is_none",
rename = "operationType"
)]
pub operation_type: Option<OperationType>,
/**
* Metadata describing a long running folder operation
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "sourceParent"
)]
pub source_parent: String,
}
/// Metadata pertaining to the Folder creation process.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct CreateFolderMetadata {
/**
* Metadata pertaining to the Folder creation process.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "displayName"
)]
pub display_name: String,
/**
* Metadata pertaining to the Folder creation process.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub parent: String,
}
/// 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.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct CreateProjectMetadata {
/**
* 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.
*/
#[serde(
default,
skip_serializing_if = "Option::is_none",
deserialize_with = "crate::utils::date_time_format::deserialize",
rename = "createTime"
)]
pub create_time: Option<chrono::DateTime<chrono::Utc>>,
/**
* 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.
*/
#[serde(
default,
deserialize_with = "crate::utils::deserialize_null_boolean::deserialize"
)]
pub gettable: bool,
/**
* 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.
*/
#[serde(
default,
deserialize_with = "crate::utils::deserialize_null_boolean::deserialize"
)]
pub ready: bool,
}
/// A status object which is used as the `metadata` field for the Operation returned by MoveProject.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct MoveProjectMetadata {}
/// 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.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct Expr {
/**
* 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.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub description: String,
/**
* 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.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub expression: String,
/**
* 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.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub location: String,
/**
* 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.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub title: String,
}
/**
* Output only. The lifecycle state of the folder. Updates to the lifecycle_state must be performed via DeleteFolder and UndeleteFolder.
*/
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
pub enum LifecycleState {
#[serde(rename = "ACTIVE")]
Active,
#[serde(rename = "DELETE_REQUESTED")]
DeleteRequested,
#[serde(rename = "LIFECYCLE_STATE_UNSPECIFIED")]
LifecycleStateUnspecified,
#[serde(rename = "")]
#[default]
Noop,
#[serde(other)]
FallthroughString,
}
impl std::fmt::Display for LifecycleState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
LifecycleState::Active => "ACTIVE",
LifecycleState::DeleteRequested => "DELETE_REQUESTED",
LifecycleState::LifecycleStateUnspecified => "LIFECYCLE_STATE_UNSPECIFIED",
LifecycleState::Noop => "",
LifecycleState::FallthroughString => "*",
}
.fmt(f)
}
}
impl LifecycleState {
pub fn is_noop(&self) -> bool {
matches!(self, LifecycleState::Noop)
}
}
/// A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct Folder {
/**
* A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
*/
#[serde(
default,
skip_serializing_if = "Option::is_none",
deserialize_with = "crate::utils::date_time_format::deserialize",
rename = "createTime"
)]
pub create_time: Option<chrono::DateTime<chrono::Utc>>,
/**
* A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "displayName"
)]
pub display_name: String,
/**
* A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
*/
#[serde(
default,
skip_serializing_if = "Option::is_none",
rename = "lifecycleState"
)]
pub lifecycle_state: Option<LifecycleState>,
/**
* A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub name: String,
/**
* A Folder in an Organization's resource hierarchy, used to organize that Organization's resources.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub parent: String,
}
/**
* The type of operation error experienced.
*/
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
pub enum ErrorMessageId {
#[serde(rename = "ACTIVE_FOLDER_HEIGHT_VIOLATION")]
ActiveFolderHeightViolation,
#[serde(rename = "CYCLE_INTRODUCED_VIOLATION")]
CycleIntroducedViolation,
#[serde(rename = "DELETED_FOLDER_HEIGHT_VIOLATION")]
DeletedFolderHeightViolation,
#[serde(rename = "ERROR_TYPE_UNSPECIFIED")]
ErrorTypeUnspecified,
#[serde(rename = "FOLDER_BEING_MOVED_VIOLATION")]
FolderBeingMovedViolation,
#[serde(rename = "FOLDER_NAME_UNIQUENESS_VIOLATION")]
FolderNameUniquenessViolation,
#[serde(rename = "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION")]
FolderToDeleteNonEmptyViolation,
#[serde(rename = "MAX_CHILD_FOLDERS_VIOLATION")]
MaxChildFoldersViolation,
#[serde(rename = "PARENT_DELETED_VIOLATION")]
ParentDeletedViolation,
#[serde(rename = "RESOURCE_DELETED_VIOLATION")]
ResourceDeletedViolation,
#[serde(rename = "")]
#[default]
Noop,
#[serde(other)]
FallthroughString,
}
impl std::fmt::Display for ErrorMessageId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
ErrorMessageId::ActiveFolderHeightViolation => "ACTIVE_FOLDER_HEIGHT_VIOLATION",
ErrorMessageId::CycleIntroducedViolation => "CYCLE_INTRODUCED_VIOLATION",
ErrorMessageId::DeletedFolderHeightViolation => "DELETED_FOLDER_HEIGHT_VIOLATION",
ErrorMessageId::ErrorTypeUnspecified => "ERROR_TYPE_UNSPECIFIED",
ErrorMessageId::FolderBeingMovedViolation => "FOLDER_BEING_MOVED_VIOLATION",
ErrorMessageId::FolderNameUniquenessViolation => "FOLDER_NAME_UNIQUENESS_VIOLATION",
ErrorMessageId::FolderToDeleteNonEmptyViolation => {
"FOLDER_TO_DELETE_NON_EMPTY_VIOLATION"
}
ErrorMessageId::MaxChildFoldersViolation => "MAX_CHILD_FOLDERS_VIOLATION",
ErrorMessageId::ParentDeletedViolation => "PARENT_DELETED_VIOLATION",
ErrorMessageId::ResourceDeletedViolation => "RESOURCE_DELETED_VIOLATION",
ErrorMessageId::Noop => "",
ErrorMessageId::FallthroughString => "*",
}
.fmt(f)
}
}
impl ErrorMessageId {
pub fn is_noop(&self) -> bool {
matches!(self, ErrorMessageId::Noop)
}
}
/// A classification of the Folder Operation error.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct FolderOperationError {
/**
* A classification of the Folder Operation error.
*/
#[serde(
default,
skip_serializing_if = "Option::is_none",
rename = "errorMessageId"
)]
pub error_message_id: Option<ErrorMessageId>,
}
/// Request message for `GetIamPolicy` method.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct GetIamPolicyRequest {
/**
* Request message for `GetIamPolicy` method.
*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<GetPolicyOptions>,
}
/// Encapsulates settings provided to GetIamPolicy.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct GetPolicyOptions {
/**
* Encapsulates settings provided to GetIamPolicy.
*/
#[serde(
default,
skip_serializing_if = "crate::utils::zero_i64",
deserialize_with = "crate::utils::deserialize_null_i64::deserialize",
rename = "requestedPolicyVersion"
)]
pub requested_policy_version: i64,
}
/// The ListFolders response message.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct ListFoldersResponse {
/**
* The ListFolders response message.
*/
#[serde(
default,
skip_serializing_if = "Vec::is_empty",
deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
)]
pub folders: Vec<Folder>,
/**
* The ListFolders response message.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "nextPageToken"
)]
pub next_page_token: String,
}
/// Metadata pertaining to the folder move process.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct MoveFolderMetadata {
/**
* Metadata pertaining to the folder move process.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "destinationParent"
)]
pub destination_parent: String,
/**
* Metadata pertaining to the folder move process.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "displayName"
)]
pub display_name: String,
/**
* Metadata pertaining to the folder move process.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "sourceParent"
)]
pub source_parent: String,
}
/// The MoveFolder request message.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct MoveFolderRequest {
/**
* The MoveFolder request message.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "destinationParent"
)]
pub destination_parent: String,
}
/// This resource represents a long-running operation that is the result of a network API call.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct Operation {
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
#[serde(
default,
deserialize_with = "crate::utils::deserialize_null_boolean::deserialize"
)]
pub done: bool,
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<Status>,
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metadata: Option<serde_json::Value>,
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub name: String,
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response: Option<serde_json::Value>,
}
/// 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/).
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct Policy {
/**
* 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/).
*/
#[serde(
default,
skip_serializing_if = "Vec::is_empty",
deserialize_with = "crate::utils::deserialize_null_vector::deserialize",
rename = "auditConfigs"
)]
pub audit_configs: Vec<AuditConfig>,
/**
* 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/).
*/
#[serde(
default,
skip_serializing_if = "Vec::is_empty",
deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
)]
pub bindings: Vec<Binding>,
/**
* 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/).
*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub etag: Option<bytes::Bytes>,
/**
* 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/).
*/
#[serde(
default,
skip_serializing_if = "crate::utils::zero_i64",
deserialize_with = "crate::utils::deserialize_null_i64::deserialize"
)]
pub version: i64,
}
/// The request message for searching folders.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct SearchFoldersRequest {
/**
* The request message for searching folders.
*/
#[serde(
default,
skip_serializing_if = "crate::utils::zero_i64",
deserialize_with = "crate::utils::deserialize_null_i64::deserialize",
rename = "pageSize"
)]
pub page_size: i64,
/**
* The request message for searching folders.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "pageToken"
)]
pub page_token: String,
/**
* The request message for searching folders.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub query: String,
}
/// The response message for searching folders.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct SearchFoldersResponse {
/**
* The response message for searching folders.
*/
#[serde(
default,
skip_serializing_if = "Vec::is_empty",
deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
)]
pub folders: Vec<Folder>,
/**
* The response message for searching folders.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "nextPageToken"
)]
pub next_page_token: String,
}
/// Request message for `SetIamPolicy` method.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct SetIamPolicyRequest {
/**
* Request message for `SetIamPolicy` method.
*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub policy: Option<Policy>,
/**
* Request message for `SetIamPolicy` method.
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize",
rename = "updateMask"
)]
pub update_mask: String,
}
/// 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).
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct Status {
/**
* 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).
*/
#[serde(
default,
skip_serializing_if = "crate::utils::zero_i64",
deserialize_with = "crate::utils::deserialize_null_i64::deserialize"
)]
pub code: i64,
/**
* 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).
*/
#[serde(
default,
skip_serializing_if = "Vec::is_empty",
deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
)]
pub details: Vec<serde_json::Value>,
/**
* 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).
*/
#[serde(
default,
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub message: String,
}
/// Request message for `TestIamPermissions` method.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct TestIamPermissionsRequest {
/**
* Request message for `TestIamPermissions` method.
*/
#[serde(
default,
skip_serializing_if = "Vec::is_empty",
deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
)]
pub permissions: Vec<String>,
}
/// Response message for `TestIamPermissions` method.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct TestIamPermissionsResponse {
/**
* Response message for `TestIamPermissions` method.
*/
#[serde(
default,
skip_serializing_if = "Vec::is_empty",
deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
)]
pub permissions: Vec<String>,
}
/**
* V1 error format.
*/
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
pub enum Xgafv {
#[serde(rename = "1")]
One,
#[serde(rename = "2")]
Two,
#[serde(rename = "")]
#[default]
Noop,
#[serde(other)]
FallthroughString,
}
impl std::fmt::Display for Xgafv {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Xgafv::One => "1",
Xgafv::Two => "2",
Xgafv::Noop => "",
Xgafv::FallthroughString => "*",
}
.fmt(f)
}
}
impl Xgafv {
pub fn is_noop(&self) -> bool {
matches!(self, Xgafv::Noop)
}
}
/**
* Data format for response.
*/
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)]
pub enum Alt {
#[serde(rename = "json")]
Json,
#[serde(rename = "media")]
Media,
#[serde(rename = "proto")]
Proto,
#[serde(rename = "")]
#[default]
Noop,
#[serde(other)]
FallthroughString,
}
impl std::fmt::Display for Alt {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Alt::Json => "json",
Alt::Media => "media",
Alt::Proto => "proto",
Alt::Noop => "",
Alt::FallthroughString => "*",
}
.fmt(f)
}
}
impl Alt {
pub fn is_noop(&self) -> bool {
matches!(self, Alt::Noop)
}
}