GoSpace Manager

Version v0.11.0

Manage Google Workspace resources using a developer-friendly CLI written in Go

batch

Batch creates new files or folders. Can also be used to upload files using a CSV file as input.

Synopsis

Implements the API documented at https://developers.google.com/drive/api/v3/reference/files/create

gsm files create batch [flags]

Options

      --appProperties int                      A collection of arbitrary key-value pairs which are private to the requesting app.
                                               Entries with null values are cleared in update and copy requests.
      --appProperties_ALL strings              Same as appProperties but value is applied to all lines in the CSV file
      --batchThreads int                       Specify the number of threads that should be used for batch commands (overrides value in config file. Max 16)
      --copyRequiresWriterPermission int       Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
      --copyRequiresWriterPermission_ALL       Same as copyRequiresWriterPermission but value is applied to all lines in the CSV file
      --createdTime int                        The time at which the file was created (RFC 3339 date-time).
      --createdTime_ALL string                 Same as createdTime but value is applied to all lines in the CSV file
      --delimiter string                       Delimiter to use for CSV columns. Must be exactly one character. Default is ';'
      --description int                        A short description of the file.
      --description_ALL string                 Same as description but value is applied to all lines in the CSV file
      --fields int                             Fields allows partial responses to be retrieved.
                                               See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
      --fields_ALL string                      Same as fields but value is applied to all lines in the CSV file
      --folderColorRgb int                     The color for a folder as an RGB hex string.
                                               The supported colors are published in the folderColorPalette field of the About resource.
                                               If an unsupported color is specified, the closest color in the palette will be used instead.
      --folderColorRgb_ALL string              Same as folderColorRgb but value is applied to all lines in the CSV file
  -h, --help                                   help for batch
      --id int                                 The ID of the file.
      --ignoreDefaultVisibility int            Whether to ignore the domain's default visibility settings for the created file.
                                               Domain administrators can choose to make all uploaded files visible to the domain by default;
                                               this parameter bypasses that behavior for the request.
                                               Permissions are still inherited from parent folders.
      --ignoreDefaultVisibility_ALL            Same as ignoreDefaultVisibility but value is applied to all lines in the CSV file
      --includePermissionsForView int          Specifies which additional view's permissions to include in the response.
                                               Only 'published' is supported.
      --includePermissionsForView_ALL string   Same as includePermissionsForView but value is applied to all lines in the CSV file
      --indexableText int                      Text to be indexed for the file to improve fullText queries.
                                               This is limited to 128KB in length and may contain HTML elements.
      --indexableText_ALL string               Same as indexableText but value is applied to all lines in the CSV file
      --keepRevisionForever int                Whether to set the 'keepForever' field in the new head revision.
                                               This is only applicable to files with binary content in Google Drive.
                                               Only 200 revisions for the file can be kept forever.
                                               If the limit is reached, try deleting pinned revisions.
      --keepRevisionForever_ALL                Same as keepRevisionForever but value is applied to all lines in the CSV file
      --localFilePath int                      Path to a file or folder on the local disk.
      --localFilePath_ALL string               Same as localFilePath but value is applied to all lines in the CSV file
      --mimeType int                           The target MIME type of the file.
                                               Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided.
                                               The value cannot be changed unless a new revision is uploaded.
                                               
                                               If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible.
                                               The supported import formats are published in the About resource.
      --mimeType_ALL string                    Same as mimeType but value is applied to all lines in the CSV file
      --modifiedTime int                       The last time the file was modified by anyone (RFC 3339 date-time).
                                               Note that setting modifiedTime will also update modifiedByMeTime for the user.
      --modifiedTime_ALL string                Same as modifiedTime but value is applied to all lines in the CSV file
      --name int                               The name of the file. This is not necessarily unique within a folder.
                                               Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant.
      --name_ALL string                        Same as name but value is applied to all lines in the CSV file
      --ocrLanguage int                        A language hint for OCR processing during image import (ISO 639-1 code).
      --ocrLanguage_ALL string                 Same as ocrLanguage but value is applied to all lines in the CSV file
      --originalFilename int                   The original filename of the uploaded content if available, or else the original value of the name field.
                                               This is only available for files with binary content in Google Drive.
      --originalFilename_ALL string            Same as originalFilename but value is applied to all lines in the CSV file
      --parent int                             The single parent of the file.
      --parent_ALL string                      Same as parent but value is applied to all lines in the CSV file
      --path string                            Path of the import file (CSV)
      --properties int                         A collection of arbitrary key-value pairs which are visible to all apps.
                                               Entries with null values are cleared in update and copy requests.
      --properties_ALL strings                 Same as properties but value is applied to all lines in the CSV file
      --readOnly int                           Whether the content of the file is read-only.
                                               If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified.
      --readOnlyReason int                     Reason for why the content of the file is restricted.
                                               This is only mutable on requests that also set readOnly=true.
      --readOnlyReason_ALL string              Same as readOnlyReason but value is applied to all lines in the CSV file
      --readOnly_ALL                           Same as readOnly but value is applied to all lines in the CSV file
      --skipHeader                             Whether to skip the first row (header)
      --sourceMimeType int                     The MIME type of the source file to upload.
                                               Set this to "text/csv" and "mimeType" to "application/vnd.google-apps.spreadsheet" in order to import a CSV file as a Sheet
      --sourceMimeType_ALL string              Same as sourceMimeType but value is applied to all lines in the CSV file
      --starred int                            Whether the user has starred the file.
      --starred_ALL                            Same as starred but value is applied to all lines in the CSV file
      --targetId int                           The ID of the file that this shortcut points to.
      --targetId_ALL string                    Same as targetId but value is applied to all lines in the CSV file
      --thumbnailImage int                     The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
      --thumbnailImage_ALL string              Same as thumbnailImage but value is applied to all lines in the CSV file
      --thumbnailMimeType int                  The MIME type of the thumbnail.
      --thumbnailMimeType_ALL string           Same as thumbnailMimeType but value is applied to all lines in the CSV file
      --useContentAsIndexableText int          Whether users with only writer permission can modify the file's permissions.
                                               Not populated for items in shared drives.
      --useContentAsIndexableText_ALL          Same as useContentAsIndexableText but value is applied to all lines in the CSV file
      --viewedByMeTime int                     The last time the file was viewed by the user (RFC 3339 date-time).
      --viewedByMeTime_ALL string              Same as viewedByMeTime but value is applied to all lines in the CSV file
      --writersCanShare int                    Whether users with only writer permission can modify the file's permissions.
                                               Not populated for items in shared drives.
      --writersCanShare_ALL                    Same as writersCanShare but value is applied to all lines in the CSV file

Options inherited from parent commands

      --compressOutput         By default, GSM outputs "pretty" (indented) objects. By setting this flag, GSM's output will be compressed. This may or may not improve performance in scripts.
      --config string          config file (default is $HOME/.config/gsm/.gsm.yaml)
      --delay int              This delay (plus a random jitter between 0 and 50) will be applied after every command to avoid reaching quota and rate limits. Set to 0 to disable.
      --dwdSubject string      Specify a subject used for DWD impersonation (overrides value in config file)
      --log string             Set the path of the log file. Default is either ~/gsm.log or defined in your config file
      --maxElapsedTime int     This is the maximum total time that will be spent retrying a request in minutes. (default 15)
      --maxRetryInterval int   This is the maximum interval that will be used between retry attempts in seconds. (default 320)
      --redirectPort int       This is the TCP port on which GSM will create web server if you authenticate with a user account for the first time. This is necessary for the OAuth flow. See https://developers.google.com/identity/protocols/oauth2/native-app#redirect-uri_loopback (default 8081)
      --retryOn ints           Specify the HTTP error code(s) that GSM should retry on. Note that GSM will always retry on HTTP 403 errors that indicate a quota / rate limit error
      --streamOutput           Setting this flag will cause GSM to output slice values to stdout one by one, instead of one large object

SEE ALSO

  • gsm files create - Creates a new file or folder. Can also be used to upload files.