Class: Merge::Ats::AsyncLinkedAccountsClient

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ Merge::Ats::AsyncLinkedAccountsClient

Parameters:



102
103
104
# File 'lib/merge_ruby_client/ats/linked_accounts/client.rb', line 102

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientMerge::AsyncRequestClient (readonly)



98
99
100
# File 'lib/merge_ruby_client/ats/linked_accounts/client.rb', line 98

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::Ats::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.ats.linked_accounts.list

Parameters:

  • category (Merge::Ats::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:



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/merge_ruby_client/ats/linked_accounts/client.rb', line 146

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)
  Async do
    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)}/ats/v1/linked-accounts"
    end
    Merge::Ats::PaginatedAccountDetailsAndActionsList.from_json(json_object: response.body)
  end
end