Class: Merge::Filestorage::LinkedAccountsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client/filestorage/linked_accounts/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ Merge::Filestorage::LinkedAccountsClient

Parameters:



16
17
18
# File 'lib/merge_ruby_client/filestorage/linked_accounts/client.rb', line 16

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientMerge::RequestClient (readonly)



12
13
14
# File 'lib/merge_ruby_client/filestorage/linked_accounts/client.rb', line 12

def request_client
  @request_client
end

Instance Method Details

#list(category: nil, cursor: nil, end_user_email_address: nil, end_user_organization_name: nil, end_user_origin_id: nil, end_user_origin_ids: nil, id: nil, ids: nil, include_duplicates: nil, integration_name: nil, is_test_account: nil, page_size: nil, status: nil, request_options: nil) ⇒ Merge::Filestorage::PaginatedAccountDetailsAndActionsList

List linked accounts for your organization.

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.filestorage.linked_accounts.list

Parameters:

  • category (Merge::Filestorage::LinkedAccounts::LinkedAccountsListRequestCategory) (defaults to: nil)

    Options: ‘accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`

    • ‘hris` - hris

    • ‘ats` - ats

    • ‘accounting` - accounting

    • ‘ticketing` - ticketing

    • ‘crm` - crm

    • ‘mktg` - mktg

    • ‘filestorage` - filestorage

  • cursor (String) (defaults to: nil)

    The pagination cursor value.

  • end_user_email_address (String) (defaults to: nil)

    If provided, will only return linked accounts associated with the given email address.

  • end_user_organization_name (String) (defaults to: nil)

    If provided, will only return linked accounts associated with the given organization name.

  • end_user_origin_id (String) (defaults to: nil)

    If provided, will only return linked accounts associated with the given origin ID.

  • end_user_origin_ids (String) (defaults to: nil)

    Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once.

  • id (String) (defaults to: nil)
  • ids (String) (defaults to: nil)

    Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once.

  • include_duplicates (Boolean) (defaults to: nil)

    If ‘true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account.

  • integration_name (String) (defaults to: nil)

    If provided, will only return linked accounts associated with the given integration name.

  • is_test_account (String) (defaults to: nil)

    If included, will only include test linked accounts. If not included, will only include non-test linked accounts.

  • page_size (Integer) (defaults to: nil)

    Number of results to return per page.

  • status (String) (defaults to: nil)

    Filter by status. Options: ‘COMPLETE`, `INCOMPLETE`, `RELINK_NEEDED`

  • request_options (Merge::RequestOptions) (defaults to: nil)

Returns:



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/merge_ruby_client/filestorage/linked_accounts/client.rb', line 60

def list(category: nil, cursor: nil, end_user_email_address: nil, end_user_organization_name: nil,
         end_user_origin_id: nil, end_user_origin_ids: nil, id: nil, ids: nil, include_duplicates: nil, integration_name: nil, is_test_account: nil, page_size: nil, status: nil, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "category": category,
      "cursor": cursor,
      "end_user_email_address": end_user_email_address,
      "end_user_organization_name": end_user_organization_name,
      "end_user_origin_id": end_user_origin_id,
      "end_user_origin_ids": end_user_origin_ids,
      "id": id,
      "ids": ids,
      "include_duplicates": include_duplicates,
      "integration_name": integration_name,
      "is_test_account": ,
      "page_size": page_size,
      "status": status
    }.compact
    unless request_options.nil? || request_options&.additional_body_parameters.nil?
      req.body = { **(request_options&.additional_body_parameters || {}) }.compact
    end
    req.url "#{@request_client.get_url(request_options: request_options)}/filestorage/v1/linked-accounts"
  end
  Merge::Filestorage::PaginatedAccountDetailsAndActionsList.from_json(json_object: response.body)
end