Class: Basecamp::Services::CloudFilesService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/basecamp/generated/services/cloud_files_service.rb

Overview

Service for CloudFiles operations

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Basecamp::Services::BaseService

Instance Method Details

#create_cloud_file(bucket_id:, vault_id:, url:, service:, title: nil, description: nil, subscriptions: nil, visible_to_clients: nil) ⇒ Hash

Create a new cloud file in a vault.

Parameters:

  • bucket_id (Integer)

    bucket id ID

  • vault_id (Integer)

    vault id ID

  • url (String)

    url

  • service (String)

    Short identifier for the external service — "dropbox", "google_doc", "figma", "other", … Derived from the CloudFile::Service subclass name, so it is always present. other accepts any well-formed HTTPS URL.

  • title (String, nil) (defaults to: nil)

    title

  • description (String, nil) (defaults to: nil)

    description

  • subscriptions (Array, nil) (defaults to: nil)

    subscriptions

  • visible_to_clients (Boolean, nil) (defaults to: nil)

    Whether the cloud file is visible to the project's clients. Applies only when creating directly in the tool's vault — an item created inside a folder inherits the folder's visibility and ignores this. A client caller always creates client-visible records regardless of what is sent.

Returns:

  • (Hash)

    response data



25
26
27
28
29
# File 'lib/basecamp/generated/services/cloud_files_service.rb', line 25

def create_cloud_file(bucket_id:, vault_id:, url:, service:, title: nil, description: nil, subscriptions: nil, visible_to_clients: nil)
  with_operation(service: "cloudfiles", operation: "create_cloud_file", is_mutation: true, project_id: bucket_id, resource_id: vault_id) do
    http_post("/buckets/#{bucket_id}/vaults/#{vault_id}/cloud_files.json", body: compact_params(url: url, service: service, title: title, description: description, subscriptions: subscriptions, visible_to_clients: visible_to_clients)).json
  end
end

#get_cloud_file(cloud_file_id:) ⇒ Hash

Get a single cloud file by id

Parameters:

  • cloud_file_id (Integer)

    cloud file id ID

Returns:

  • (Hash)

    response data



34
35
36
37
38
# File 'lib/basecamp/generated/services/cloud_files_service.rb', line 34

def get_cloud_file(cloud_file_id:)
  with_operation(service: "cloudfiles", operation: "get_cloud_file", is_mutation: false, resource_id: cloud_file_id) do
    http_get("/cloud_files/#{cloud_file_id}", operation: "GetCloudFile").json
  end
end

#update_cloud_file(cloud_file_id:, url:, service:, title: nil, description: nil, subscriptions: nil) ⇒ Hash

Replace a cloud file with a new complete representation.

Parameters:

  • cloud_file_id (Integer)

    cloud file id ID

  • url (String)

    url

  • service (String)

    Short identifier for the external service — "dropbox", "google_doc", "figma", "other", … Derived from the CloudFile::Service subclass name, so it is always present. other accepts any well-formed HTTPS URL.

  • title (String, nil) (defaults to: nil)

    title

  • description (String, nil) (defaults to: nil)

    description

  • subscriptions (Array, nil) (defaults to: nil)

    subscriptions

Returns:

  • (Hash)

    response data



50
51
52
53
54
# File 'lib/basecamp/generated/services/cloud_files_service.rb', line 50

def update_cloud_file(cloud_file_id:, url:, service:, title: nil, description: nil, subscriptions: nil)
  with_operation(service: "cloudfiles", operation: "update_cloud_file", is_mutation: true, resource_id: cloud_file_id) do
    http_put("/cloud_files/#{cloud_file_id}", body: compact_params(url: url, service: service, title: title, description: description, subscriptions: subscriptions)).json
  end
end