Google Drive API . parents

Instance Methods

close()

Close httplib2 connections.

delete(fileId, parentId, enforceSingleParent=None, x__xgafv=None)

Removes a parent from a file.

get(fileId, parentId, x__xgafv=None)

Gets a specific parent reference.

insert(fileId, body=None, enforceSingleParent=None, supportsAllDrives=None, supportsTeamDrives=None, x__xgafv=None)

Adds a parent folder for a file.

list(fileId, x__xgafv=None)

Lists a file's parents.

Method Details

close()
Close httplib2 connections.
delete(fileId, parentId, enforceSingleParent=None, x__xgafv=None)
Removes a parent from a file.

Args:
  fileId: string, The ID of the file. (required)
  parentId: string, The ID of the parent. (required)
  enforceSingleParent: boolean, Deprecated: If an item is not in a shared drive and its last parent is removed, the item is placed under its owner's root.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format
get(fileId, parentId, x__xgafv=None)
Gets a specific parent reference.

Args:
  fileId: string, The ID of the file. (required)
  parentId: string, The ID of the parent. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A reference to a file's parent. Some resource methods (such as `parents.get`) require a `parentId`. Use the `parents.list` method to retrieve the ID for a parent.
  "id": "A String", # The ID of the parent.
  "isRoot": True or False, # Output only. Whether or not the parent is the root folder.
  "kind": "drive#parentReference", # Output only. This is always `drive#parentReference`.
  "parentLink": "A String", # Output only. A link to the parent.
  "selfLink": "A String", # Output only. A link back to this reference.
}
insert(fileId, body=None, enforceSingleParent=None, supportsAllDrives=None, supportsTeamDrives=None, x__xgafv=None)
Adds a parent folder for a file.

Args:
  fileId: string, The ID of the file. (required)
  body: object, The request body.
    The object takes the form of:

{ # A reference to a file's parent. Some resource methods (such as `parents.get`) require a `parentId`. Use the `parents.list` method to retrieve the ID for a parent.
  "id": "A String", # The ID of the parent.
  "isRoot": True or False, # Output only. Whether or not the parent is the root folder.
  "kind": "drive#parentReference", # Output only. This is always `drive#parentReference`.
  "parentLink": "A String", # Output only. A link to the parent.
  "selfLink": "A String", # Output only. A link back to this reference.
}

  enforceSingleParent: boolean, Deprecated: Adding files to multiple folders is no longer supported. Use `shortcuts` instead.
  supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
  supportsTeamDrives: boolean, Deprecated: Use `supportsAllDrives` instead.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A reference to a file's parent. Some resource methods (such as `parents.get`) require a `parentId`. Use the `parents.list` method to retrieve the ID for a parent.
  "id": "A String", # The ID of the parent.
  "isRoot": True or False, # Output only. Whether or not the parent is the root folder.
  "kind": "drive#parentReference", # Output only. This is always `drive#parentReference`.
  "parentLink": "A String", # Output only. A link to the parent.
  "selfLink": "A String", # Output only. A link back to this reference.
}
list(fileId, x__xgafv=None)
Lists a file's parents.

Args:
  fileId: string, The ID of the file. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A list of a file's parents.
  "etag": "A String", # The ETag of the list.
  "items": [ # The list of parents.
    { # A reference to a file's parent. Some resource methods (such as `parents.get`) require a `parentId`. Use the `parents.list` method to retrieve the ID for a parent.
      "id": "A String", # The ID of the parent.
      "isRoot": True or False, # Output only. Whether or not the parent is the root folder.
      "kind": "drive#parentReference", # Output only. This is always `drive#parentReference`.
      "parentLink": "A String", # Output only. A link to the parent.
      "selfLink": "A String", # Output only. A link back to this reference.
    },
  ],
  "kind": "drive#parentList", # This is always `drive#parentList`.
  "selfLink": "A String", # A link back to this list.
}