// This file was generated by code-gen. DO NOT EDIT MANUALLY!
///A permission for a file. A permission grants a user, group, domain, or the world access to a file or a folder hierarchy. By default, permissions requests only return a subset of fields. Permission kind, ID, type, and role are always returned. To retrieve specific fields, see <https://developers.google.com/workspace/drive/api/guides/fields-parameter.> Some resource methods (such as `permissions.update`) require a `permissionId`. Use the `permissions.list` method to retrieve the ID for a file, folder, or shared drive.
#[derive(Debug, Clone, ::serde::Deserialize, ::serde::Serialize)]
pub struct Permission {
#[serde(rename = "allowFileDiscovery")]
///Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type `domain` or `anyone`.
pub allow_file_discovery: ::core::primitive::bool,
#[serde(rename = "deleted")]
///Output only. Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
pub deleted: ::core::primitive::bool,
#[serde(rename = "displayName")]
///Output only. The "pretty" name of the value of the permission. The following is a list of examples for each type of permission: * `user` - User's full name, as defined for their Google account, such as "Joe Smith." * `group` - Name of the Google Group, such as "The Company Administrators." * `domain` - String domain name, such as "thecompany.com." * `anyone` - No `displayName` is present.
pub display_name: ::alloc::string::String,
#[serde(rename = "domain")]
///The domain to which this permission refers.
pub domain: ::alloc::string::String,
#[serde(rename = "emailAddress")]
///The email address of the user or group to which this permission refers.
pub email_address: ::alloc::string::String,
#[serde(rename = "expirationTime")]
///The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: - They can only be set on user and group permissions - The time must be in the future - The time cannot be more than a year in the future
pub expiration_time: ::alloc::string::String,
#[serde(rename = "id")]
///Output only. The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as `permissionId`. IDs should be treated as opaque values.
pub id: ::alloc::string::String,
#[serde(rename = "inheritedPermissionsDisabled")]
///When true, only organizers, owners, and users with permissions added directly on the item can access it.
pub inherited_permissions_disabled: ::core::primitive::bool,
#[serde(rename = "kind")]
///Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#permission"`.
pub kind: ::alloc::string::String,
#[serde(rename = "pendingOwner")]
///Whether the account associated with this permission is a pending owner. Only populated for `user` type permissions for files that are not in a shared drive.
pub pending_owner: ::core::primitive::bool,
#[serde(rename = "permissionDetails")]
///Output only. Details of whether the permissions on this item are inherited or directly on this item.
pub permission_details: ::alloc::vec::Vec<
permission_permission_details_additional::PermissionDetails,
>,
#[serde(rename = "photoLink")]
///Output only. A link to the user's profile photo, if available.
pub photo_link: ::alloc::string::String,
#[serde(rename = "role")]
///The role granted by this permission. While new values may be supported in the future, the following are currently allowed: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader`
pub role: ::alloc::string::String,
#[serde(rename = "teamDrivePermissionDetails")]
///Output only. Deprecated: Output only. Use `permissionDetails` instead.
pub team_drive_permission_details: ::alloc::vec::Vec<
permission_team_drive_permission_details_additional::TeamDrivePermissionDetails,
>,
#[serde(rename = "type")]
///The type of the grantee. Valid values are: * `user` * `group` * `domain` * `anyone` When creating a permission, if `type` is `user` or `group`, you must provide an `emailAddress` for the user or group. When `type` is `domain`, you must provide a `domain`. There isn't extra information required for an `anyone` type.
pub type_: ::alloc::string::String,
#[serde(rename = "view")]
///Indicates the view for this permission. Only populated for permissions that belong to a view. published and metadata are the only supported values. - published: The permission's role is published_reader. - metadata: The item is only visible to the metadata view because the item has limited access and the scope has at least read access to the parent. Note: The metadata view is currently only supported on folders.
pub view: ::alloc::string::String,
}
///A permission for a file. A permission grants a user, group, domain, or the world access to a file or a folder hierarchy. By default, permissions requests only return a subset of fields. Permission kind, ID, type, and role are always returned. To retrieve specific fields, see <https://developers.google.com/workspace/drive/api/guides/fields-parameter.> Some resource methods (such as `permissions.update`) require a `permissionId`. Use the `permissions.list` method to retrieve the ID for a file, folder, or shared drive.
#[derive(Debug, Clone, ::serde::Deserialize, ::serde::Serialize, Default)]
pub struct PermissionPartial {
#[serde(rename = "allowFileDiscovery")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type `domain` or `anyone`.
pub allow_file_discovery: ::core::option::Option<::core::primitive::bool>,
#[serde(rename = "deleted")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Output only. Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
pub deleted: ::core::option::Option<::core::primitive::bool>,
#[serde(rename = "displayName")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Output only. The "pretty" name of the value of the permission. The following is a list of examples for each type of permission: * `user` - User's full name, as defined for their Google account, such as "Joe Smith." * `group` - Name of the Google Group, such as "The Company Administrators." * `domain` - String domain name, such as "thecompany.com." * `anyone` - No `displayName` is present.
pub display_name: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "domain")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///The domain to which this permission refers.
pub domain: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "emailAddress")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///The email address of the user or group to which this permission refers.
pub email_address: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "expirationTime")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: - They can only be set on user and group permissions - The time must be in the future - The time cannot be more than a year in the future
pub expiration_time: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "id")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Output only. The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as `permissionId`. IDs should be treated as opaque values.
pub id: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "inheritedPermissionsDisabled")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///When true, only organizers, owners, and users with permissions added directly on the item can access it.
pub inherited_permissions_disabled: ::core::option::Option<::core::primitive::bool>,
#[serde(rename = "kind")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#permission"`.
pub kind: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "pendingOwner")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Whether the account associated with this permission is a pending owner. Only populated for `user` type permissions for files that are not in a shared drive.
pub pending_owner: ::core::option::Option<::core::primitive::bool>,
#[serde(rename = "permissionDetails")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Output only. Details of whether the permissions on this item are inherited or directly on this item.
pub permission_details: ::core::option::Option<
::alloc::vec::Vec<
permission_permission_details_additional::PermissionDetailsPartial,
>,
>,
#[serde(rename = "photoLink")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Output only. A link to the user's profile photo, if available.
pub photo_link: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "role")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///The role granted by this permission. While new values may be supported in the future, the following are currently allowed: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader`
pub role: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "teamDrivePermissionDetails")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Output only. Deprecated: Output only. Use `permissionDetails` instead.
pub team_drive_permission_details: ::core::option::Option<
::alloc::vec::Vec<
permission_team_drive_permission_details_additional::TeamDrivePermissionDetailsPartial,
>,
>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///The type of the grantee. Valid values are: * `user` * `group` * `domain` * `anyone` When creating a permission, if `type` is `user` or `group`, you must provide an `emailAddress` for the user or group. When `type` is `domain`, you must provide a `domain`. There isn't extra information required for an `anyone` type.
pub type_: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "view")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Indicates the view for this permission. Only populated for permissions that belong to a view. published and metadata are the only supported values. - published: The permission's role is published_reader. - metadata: The item is only visible to the metadata view because the item has limited access and the scope has at least read access to the parent. Note: The metadata view is currently only supported on folders.
pub view: ::core::option::Option<::alloc::string::String>,
}
pub mod permission_permission_details_additional {
use super::*;
///No description
#[derive(Debug, Clone, ::serde::Deserialize, ::serde::Serialize)]
pub struct PermissionDetails {
#[serde(rename = "inherited")]
///Output only. Whether this permission is inherited. This field is always populated. This is an output-only field.
pub inherited: ::core::primitive::bool,
#[serde(rename = "inheritedFrom")]
///Output only. The ID of the item from which this permission is inherited. This is only populated for items in shared drives.
pub inherited_from: ::alloc::string::String,
#[serde(rename = "permissionType")]
///Output only. The permission type for this user. While new values may be added in future, the following are currently possible: * `file` * `member`
pub permission_type: ::alloc::string::String,
#[serde(rename = "role")]
///Output only. The primary role for this user. While new values may be added in the future, the following are currently possible: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader`
pub role: ::alloc::string::String,
}
///No description
#[derive(Debug, Clone, ::serde::Deserialize, ::serde::Serialize, Default)]
pub struct PermissionDetailsPartial {
#[serde(rename = "inherited")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Output only. Whether this permission is inherited. This field is always populated. This is an output-only field.
pub inherited: ::core::option::Option<::core::primitive::bool>,
#[serde(rename = "inheritedFrom")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Output only. The ID of the item from which this permission is inherited. This is only populated for items in shared drives.
pub inherited_from: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "permissionType")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Output only. The permission type for this user. While new values may be added in future, the following are currently possible: * `file` * `member`
pub permission_type: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "role")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Output only. The primary role for this user. While new values may be added in the future, the following are currently possible: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader`
pub role: ::core::option::Option<::alloc::string::String>,
}
}
pub mod permission_team_drive_permission_details_additional {
use super::*;
///No description
#[derive(Debug, Clone, ::serde::Deserialize, ::serde::Serialize)]
pub struct TeamDrivePermissionDetails {
#[serde(rename = "inherited")]
///Deprecated: Output only. Use `permissionDetails/inherited` instead.
pub inherited: ::core::primitive::bool,
#[serde(rename = "inheritedFrom")]
///Deprecated: Output only. Use `permissionDetails/inheritedFrom` instead.
pub inherited_from: ::alloc::string::String,
#[serde(rename = "role")]
///Deprecated: Output only. Use `permissionDetails/role` instead.
pub role: ::alloc::string::String,
#[serde(rename = "teamDrivePermissionType")]
///Deprecated: Output only. Use `permissionDetails/permissionType` instead.
pub team_drive_permission_type: ::alloc::string::String,
}
///No description
#[derive(Debug, Clone, ::serde::Deserialize, ::serde::Serialize, Default)]
pub struct TeamDrivePermissionDetailsPartial {
#[serde(rename = "inherited")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Deprecated: Output only. Use `permissionDetails/inherited` instead.
pub inherited: ::core::option::Option<::core::primitive::bool>,
#[serde(rename = "inheritedFrom")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Deprecated: Output only. Use `permissionDetails/inheritedFrom` instead.
pub inherited_from: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "role")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Deprecated: Output only. Use `permissionDetails/role` instead.
pub role: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "teamDrivePermissionType")]
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
///Deprecated: Output only. Use `permissionDetails/permissionType` instead.
pub team_drive_permission_type: ::core::option::Option<::alloc::string::String>,
}
}