Skip to content

Latest commit

 

History

History
204 lines (141 loc) · 11.8 KB

README.md

File metadata and controls

204 lines (141 loc) · 11.8 KB

Folders

(folders)

Overview

Available Operations

  • create - Create a new folder
  • list - Retrieve a list of folders
  • update - Update a folder
  • delete - Delete a folder

create

Create a new folder for the authenticated workspace.

Example Usage

from dub import Dub

with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.folders.create()

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.CreateFolderRequestBody ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

components.FolderSchema

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4XX, 5XX */*

list

Retrieve a list of folders for the authenticated workspace.

Example Usage

from dub import Dub

with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.folders.list(request={})

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.ListFoldersRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

List[components.FolderSchema]

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4XX, 5XX */*

update

Update a folder in the workspace.

Example Usage

from dub import Dub

with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.folders.update(id="<id>")

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id str ✔️ The ID of the folder to update.
request_body Optional[operations.UpdateFolderRequestBody] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

components.FolderSchema

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4XX, 5XX */*

delete

Delete a folder from the workspace. All existing links will still work, but they will no longer be associated with this folder.

Example Usage

from dub import Dub

with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.folders.delete(id="<id>")

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id str ✔️ The ID of the folder to delete.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteFolderResponseBody

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4XX, 5XX */*