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
94
95
96
97
98
99
|
# File 'lib/merge_ruby_client/crm/link_token/client.rb', line 67
def create(end_user_email_address:, end_user_organization_name:, end_user_origin_id:, categories:,
integration: nil, link_expiry_mins: nil, should_create_magic_link_url: nil, hide_admin_magic_link: nil, common_models: nil, category_common_model_scopes: nil, language: nil, integration_specific_config: nil, request_options: nil)
response = @request_client.conn.post do |req|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
req.["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
req.["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
req. = {
**(req. || {}),
**@request_client.,
**(request_options&. || {})
}.compact
unless request_options.nil? || request_options&.additional_query_parameters.nil?
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
end
req.body = {
**(request_options&.additional_body_parameters || {}),
end_user_email_address: end_user_email_address,
end_user_organization_name: end_user_organization_name,
end_user_origin_id: end_user_origin_id,
categories: categories,
integration: integration,
link_expiry_mins: link_expiry_mins,
should_create_magic_link_url: should_create_magic_link_url,
hide_admin_magic_link: hide_admin_magic_link,
common_models: common_models,
category_common_model_scopes: category_common_model_scopes,
language: language,
integration_specific_config: integration_specific_config
}.compact
req.url "#{@request_client.get_url(request_options: request_options)}/crm/v1/link-token"
end
Merge::Crm::LinkToken.from_json(json_object: response.body)
end
|