Creates a shared drive.

Scopes

You will need authorization for the https://www.googleapis.com/auth/drive scope to make a valid call.

If unset, the scope for this method defaults to https://www.googleapis.com/auth/drive. You can set the scope for this method like this: drive3 --scope <scope> drives create ...

Required Scalar Argument

  • <request-id> (string)
    • Required. An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a shared drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same shared drive. If the shared drive already exists a 409 error will be returned.

Required Request Value

The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.

For example, a structure like this:

Drive:
  background-image-file:
    id: string
    width: number
    x-coordinate: number
    y-coordinate: number
  background-image-link: string
  capabilities:
    can-add-children: boolean
    can-change-copy-requires-writer-permission-restriction: boolean
    can-change-domain-users-only-restriction: boolean
    can-change-drive-background: boolean
    can-change-drive-members-only-restriction: boolean
    can-change-sharing-folders-requires-organizer-permission-restriction: boolean
    can-comment: boolean
    can-copy: boolean
    can-delete-children: boolean
    can-delete-drive: boolean
    can-download: boolean
    can-edit: boolean
    can-list-children: boolean
    can-manage-members: boolean
    can-read-revisions: boolean
    can-rename: boolean
    can-rename-drive: boolean
    can-reset-drive-restrictions: boolean
    can-share: boolean
    can-trash-children: boolean
  color-rgb: string
  created-time: string
  hidden: boolean
  id: string
  kind: string
  name: string
  org-unit-id: string
  restrictions:
    admin-managed-restrictions: boolean
    copy-requires-writer-permission: boolean
    domain-users-only: boolean
    drive-members-only: boolean
    sharing-folders-requires-organizer-permission: boolean
  theme-id: string

can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.

  • -r .background-image-file id=duo
    • The ID of an image file in Google Drive to use for the background image.
  • width=0.19681975392268636
    • The width of the cropped image in the closed range of 0 to 1. This value represents the width of the cropped image divided by the width of the entire image. The height is computed by applying a width to height aspect ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and 144 pixels high.
  • x-coordinate=0.10459029141758258
    • The X coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the horizontal distance from the left side of the entire image to the left side of the cropping area divided by the width of the entire image.
  • y-coordinate=0.19657477328425788

    • The Y coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the vertical distance from the top side of the entire image to the top side of the cropping area divided by the height of the entire image.
  • .. background-image-link=lorem

    • Output only. A short-lived link to this shared drive's background image.
  • capabilities can-add-children=true
    • Output only. Whether the current user can add children to folders in this shared drive.
  • can-change-copy-requires-writer-permission-restriction=false
    • Output only. Whether the current user can change the copyRequiresWriterPermission restriction of this shared drive.
  • can-change-domain-users-only-restriction=true
    • Output only. Whether the current user can change the domainUsersOnly restriction of this shared drive.
  • can-change-drive-background=true
    • Output only. Whether the current user can change the background of this shared drive.
  • can-change-drive-members-only-restriction=false
    • Output only. Whether the current user can change the driveMembersOnly restriction of this shared drive.
  • can-change-sharing-folders-requires-organizer-permission-restriction=false
    • Output only. Whether the current user can change the sharingFoldersRequiresOrganizerPermission restriction of this shared drive.
  • can-comment=true
    • Output only. Whether the current user can comment on files in this shared drive.
  • can-copy=false
    • Output only. Whether the current user can copy files in this shared drive.
  • can-delete-children=false
    • Output only. Whether the current user can delete children from folders in this shared drive.
  • can-delete-drive=false
    • Output only. Whether the current user can delete this shared drive. Attempting to delete the shared drive may still fail if there are untrashed items inside the shared drive.
  • can-download=false
    • Output only. Whether the current user can download files in this shared drive.
  • can-edit=true
    • Output only. Whether the current user can edit files in this shared drive
  • can-list-children=true
    • Output only. Whether the current user can list the children of folders in this shared drive.
  • can-manage-members=false
    • Output only. Whether the current user can add members to this shared drive or remove them or change their role.
  • can-read-revisions=true
    • Output only. Whether the current user can read the revisions resource of files in this shared drive.
  • can-rename=true
    • Output only. Whether the current user can rename files or folders in this shared drive.
  • can-rename-drive=true
    • Output only. Whether the current user can rename this shared drive.
  • can-reset-drive-restrictions=true
    • Output only. Whether the current user can reset the shared drive restrictions to defaults.
  • can-share=false
    • Output only. Whether the current user can share files or folders in this shared drive.
  • can-trash-children=false

    • Output only. Whether the current user can trash children from folders in this shared drive.
  • .. color-rgb=elitr

    • The color of this shared drive as an RGB hex string. It can only be set on a drive.drives.update request that does not set themeId.
  • created-time=sed
    • The time at which the shared drive was created (RFC 3339 date-time).
  • hidden=true
    • Whether the shared drive is hidden from default view.
  • id=nonumy
    • Output only. The ID of this shared drive which is also the ID of the top level folder of this shared drive.
  • kind=at
    • Output only. Identifies what kind of resource this is. Value: the fixed string &#34;drive#drive&#34;.
  • name=sadipscing
    • The name of this shared drive.
  • org-unit-id=aliquyam
    • Output only. The organizational unit of this shared drive. This field is only populated on drives.list responses when the useDomainAdminAccess parameter is set to true.
  • restrictions admin-managed-restrictions=true
    • Whether administrative privileges on this shared drive are required to modify restrictions.
  • copy-requires-writer-permission=false
    • Whether the options to copy, print, or download files inside this shared drive, should be disabled for readers and commenters. When this restriction is set to true, it will override the similarly named field to true for any file inside this shared drive.
  • domain-users-only=false
    • Whether access to this shared drive and items inside this shared drive is restricted to users of the domain to which this shared drive belongs. This restriction may be overridden by other sharing policies controlled outside of this shared drive.
  • drive-members-only=true
    • Whether access to items inside this shared drive is restricted to its members.
  • sharing-folders-requires-organizer-permission=true

    • If true, only users with the organizer role can share folders. If false, users with either the organizer role or the file organizer role can share folders.
  • .. theme-id=et

    • The ID of the theme from which the background image and color will be set. The set of possible driveThemes can be retrieved from a drive.about.get response. When not specified on a drive.drives.create request, a random theme is chosen from which the background image and color are set. This is a write-only field; it can only be set on requests that don't set colorRgb or backgroundImageFile.

About Cursors

The cursor position is key to comfortably set complex nested structures. The following rules apply:

  • The cursor position is always set relative to the current one, unless the field name starts with the . character. Fields can be nested such as in -r f.s.o .
  • The cursor position is set relative to the top-level structure if it starts with ., e.g. -r .s.s
  • You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify -r struct.sub_struct=bar.
  • You can move the cursor one level up by using ... Each additional . moves it up one additional level. E.g. ... would go three levels up.

Optional Output Flags

The method's return value a JSON encoded structure, which will be written to standard output by default.

  • -o out
    • out specifies the destination to which to write the server's result to. It will be a JSON-encoded structure. The destination may be - to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.

Optional General Properties

The following properties can configure any call, and are not specific to this method.

  • -p $-xgafv=string

    • V1 error format.
  • -p access-token=string

    • OAuth access token.
  • -p alt=string

    • Data format for response.
  • -p callback=string

    • JSONP
  • -p fields=string

    • Selector specifying which fields to include in a partial response.
  • -p key=string

    • API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
  • -p oauth-token=string

    • OAuth 2.0 token for the current user.
  • -p pretty-print=boolean

    • Returns response with indentations and line breaks.
  • -p quota-user=string

    • Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
  • -p upload-type=string

    • Legacy upload protocol for media (e.g. "media", "multipart").
  • -p upload-protocol=string

    • Upload protocol for media (e.g. "raw", "multipart").