Module: Paperdrive::Client::OrganizationFields

Includes:
Parameters
Included in:
Paperdrive::Client
Defined in:
lib/paperdrive/client/organization_fields.rb

Overview

Instance methods related to OrganizationFields to embed into Paperdrive::Client
arguments are compatible with the Pipedribe API.

Instance Method Summary collapse

Instance Method Details

#all_organization_fields(**args) ⇒ Paperdrive::Response

GET

Get all organization fields



18
19
20
21
22
23
# File 'lib/paperdrive/client/organization_fields.rb', line 18

def all_organization_fields(**args)
  params = parameters(args) do
    optional_params
  end
  request(:get, 'organizationFields', params)
end

#create_organization_field(**args) ⇒ Paperdrive::Response

POST

Add a new organization field



41
42
43
44
45
46
47
# File 'lib/paperdrive/client/organization_fields.rb', line 41

def create_organization_field(**args)
  params = parameters(args) do
    required_params :name, :field_type
    optional_params :name, :field_type, :options
  end
  request(:post, 'organizationFields', params)
end

#delete_organization_field(id:, **args) ⇒ Paperdrive::Response

DELETE

Delete an organization field



79
80
81
82
83
84
# File 'lib/paperdrive/client/organization_fields.rb', line 79

def delete_organization_field(id:, **args)
  params = parameters(args) do
    optional_params
  end
  request(:delete, "organizationFields/#{id}", params)
end

#delete_organization_fields(**args) ⇒ Paperdrive::Response

DELETE

Delete multiple organization fields in bulk



66
67
68
69
70
71
72
# File 'lib/paperdrive/client/organization_fields.rb', line 66

def delete_organization_fields(**args)
  params = parameters(args) do
    required_params :ids
    optional_params :ids
  end
  request(:delete, 'organizationFields', params)
end

#organization_field(id:, **args) ⇒ Paperdrive::Response

GET

Get one organization field



30
31
32
33
34
35
# File 'lib/paperdrive/client/organization_fields.rb', line 30

def organization_field(id:, **args)
  params = parameters(args) do
    optional_params
  end
  request(:get, "organizationFields/#{id}", params)
end

#update_organization_field(id:, **args) ⇒ Paperdrive::Response

PUT

Update an organization field



54
55
56
57
58
59
60
# File 'lib/paperdrive/client/organization_fields.rb', line 54

def update_organization_field(id:, **args)
  params = parameters(args) do
    required_params :name
    optional_params :name, :options
  end
  request(:put, "organizationFields/#{id}", params)
end