stackone_client 0.5.9 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/stack_one/accounts.rb +361 -36
- data/lib/stack_one/ats.rb +5301 -652
- data/lib/stack_one/connect_sessions.rb +157 -22
- data/lib/stack_one/connectors.rb +145 -14
- data/lib/stack_one/crm.rb +725 -78
- data/lib/stack_one/hris.rb +4335 -462
- data/lib/stack_one/iam.rb +805 -56
- data/lib/stack_one/lms.rb +1967 -220
- data/lib/stack_one/marketing.rb +1921 -230
- data/lib/stack_one/models/operations/ats_get_application_custom_field_definition_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_get_application_document_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_application_note_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_application_offer_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_application_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_application_scheduled_interview_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_application_scorecard_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_assessments_package_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_assessments_request_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_assessments_result_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_background_check_package_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_background_check_request_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_background_check_result_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_candidate_custom_field_definition_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_get_candidate_note_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_candidate_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_department_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_interview_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_interview_stage_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_job_custom_field_definition_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_get_job_posting_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_job_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_list_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_location_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_offer_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_rejected_reason_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_user_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_list_application_custom_field_definitions_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_application_documents_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_application_notes_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_application_scorecards_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_applications_offers_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_applications_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_applications_scheduled_interviews_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_assessments_packages_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_background_check_packages_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_background_check_request_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_candidate_custom_field_definitions_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_candidate_notes_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_candidates_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_departments_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_interview_stages_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_interviews_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_job_custom_field_definitions_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_job_postings_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_jobs_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_lists_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_locations_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_offers_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_rejected_reasons_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_users_request.rb +2 -2
- data/lib/stack_one/models/operations/crm_get_account_request.rb +1 -1
- data/lib/stack_one/models/operations/crm_get_contact_custom_field_definition_request.rb +2 -2
- data/lib/stack_one/models/operations/crm_get_contact_request.rb +1 -1
- data/lib/stack_one/models/operations/crm_get_list_request.rb +1 -1
- data/lib/stack_one/models/operations/crm_list_accounts_request.rb +2 -2
- data/lib/stack_one/models/operations/crm_list_contact_custom_field_definitions_request.rb +2 -2
- data/lib/stack_one/models/operations/crm_list_contacts_request.rb +2 -2
- data/lib/stack_one/models/operations/crm_list_lists_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_get_benefit_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_company_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_cost_center_group_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_department_group_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_custom_field_definition_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_get_employee_document_category_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_document_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_employment_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_skill_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_time_off_balance_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employees_time_off_request_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employees_work_eligibility_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employment_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_group_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_job_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_location_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_location_response.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_team_group_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_time_entries_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_time_off_policy_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_time_off_request_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_time_off_type_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_list_benefits_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_companies_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_cost_center_groups_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_department_groups_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_categories_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_custom_field_definitions_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_documents_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_employments_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_skills_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_time_off_balances_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_time_off_requests_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_work_eligibility_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employees_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employments_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_groups_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_jobs_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_locations_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_locations_response.rb +1 -1
- data/lib/stack_one/models/operations/hris_list_team_groups_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_time_entries_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_time_off_policies_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_time_off_requests_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_time_off_types_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_update_employee_time_off_request_request.rb +33 -0
- data/lib/stack_one/models/operations/hris_update_employee_time_off_request_response.rb +36 -0
- data/lib/stack_one/models/operations/iam_delete_user_request.rb +27 -0
- data/lib/stack_one/models/operations/iam_delete_user_response.rb +36 -0
- data/lib/stack_one/models/operations/iam_get_group_request.rb +1 -1
- data/lib/stack_one/models/operations/iam_get_policy_request.rb +1 -1
- data/lib/stack_one/models/operations/iam_get_role_request.rb +1 -1
- data/lib/stack_one/models/operations/iam_get_user_request.rb +1 -1
- data/lib/stack_one/models/operations/iam_list_groups_request.rb +2 -2
- data/lib/stack_one/models/operations/iam_list_policies_request.rb +2 -2
- data/lib/stack_one/models/operations/iam_list_roles_request.rb +2 -2
- data/lib/stack_one/models/operations/iam_list_users_request.rb +2 -2
- data/lib/stack_one/models/operations/iam_update_user_request.rb +30 -0
- data/lib/stack_one/models/operations/iam_update_user_response.rb +36 -0
- data/lib/stack_one/models/operations/lms_get_assignment_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_category_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_completion_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_content_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_course_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_skill_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_user_assignment_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_user_completion_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_user_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_list_assignments_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_categories_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_completions_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_content_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_courses_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_skills_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_user_assignments_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_user_completions_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_users_queryparam_filter.rb +5 -2
- data/lib/stack_one/models/operations/lms_list_users_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_get_campaign_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_content_block_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_email_template_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_in_app_template_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_omni_channel_template_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_push_template_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_sms_template_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_list_campaigns_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_content_blocks_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_email_templates_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_in_app_templates_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_omni_channel_templates_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_push_templates_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_sms_templates_request.rb +2 -2
- data/lib/stack_one/models/operations.rb +6 -0
- data/lib/stack_one/models/shared/atscreatejobrequestdto.rb +5 -2
- data/lib/stack_one/models/shared/atsupdatejobrequestdto.rb +5 -2
- data/lib/stack_one/models/shared/categories.rb +2 -0
- data/lib/stack_one/models/shared/company.rb +5 -2
- data/lib/stack_one/models/shared/connectorsmeta_category.rb +2 -0
- data/lib/stack_one/models/shared/connectsessioncreate_categories.rb +2 -0
- data/lib/stack_one/models/shared/connectsessiontokenauthlink_categories.rb +2 -0
- data/lib/stack_one/models/shared/createemploymentapimodel.rb +4 -5
- data/lib/stack_one/models/shared/employee_company.rb +5 -2
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto.rb +10 -8
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_employment.rb +56 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_pay_frequency.rb +27 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_pay_period.rb +27 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_contract_type.rb +27 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_employment_contract_type_value.rb +20 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_employment_type_value.rb +33 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_pay_period_value.rb +29 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_type.rb +27 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_value.rb +31 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_state.rb +3 -3
- data/lib/stack_one/models/shared/hriscreateemploymentrequestdto.rb +4 -5
- data/lib/stack_one/models/shared/hriscreatetimeoffrequestdto.rb +2 -0
- data/lib/stack_one/models/shared/hriscreatetimeoffrequestdto_type.rb +2 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto.rb +8 -8
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_employment.rb +56 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_pay_frequency.rb +27 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_pay_period.rb +27 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_contract_type.rb +27 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_employment_contract_type_value.rb +20 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_employment_type_value.rb +33 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_pay_period_value.rb +29 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_type.rb +27 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_value.rb +31 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_state.rb +3 -3
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_state.rb +3 -3
- data/lib/stack_one/models/shared/iamupdateuserrequestdto.rb +45 -0
- data/lib/stack_one/models/shared/iamupdateuserrequestdto_status.rb +27 -0
- data/lib/stack_one/models/shared/iamupdateuserrequestdto_value.rb +20 -0
- data/lib/stack_one/models/shared/job.rb +5 -2
- data/lib/stack_one/models/shared/linkedaccountmeta_category.rb +2 -0
- data/lib/stack_one/models/shared/rawresponse.rb +2 -2
- data/lib/stack_one/models/shared/state.rb +3 -3
- data/lib/stack_one/models/shared/timeoff.rb +2 -0
- data/lib/stack_one/models/shared/timeoff_type.rb +2 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel.rb +8 -8
- data/lib/stack_one/models/shared/updateemployeeapimodel_employment.rb +56 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_pay_frequency.rb +27 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_pay_period.rb +27 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_contract_type.rb +27 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_employment_contract_type_value.rb +20 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_employment_type_value.rb +33 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_pay_period_value.rb +29 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_type.rb +27 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_value.rb +31 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_state.rb +3 -3
- data/lib/stack_one/models/shared/updateemployeeapimodel_state.rb +3 -3
- data/lib/stack_one/models/shared/updatepackage.rb +5 -2
- data/lib/stack_one/models/shared/updateuserapimodel.rb +45 -0
- data/lib/stack_one/models/shared/updateuserapimodel_status.rb +27 -0
- data/lib/stack_one/models/shared/updateuserapimodel_value.rb +20 -0
- data/lib/stack_one/models/shared.rb +33 -6
- data/lib/stack_one/proxy.rb +80 -11
- data/lib/stack_one/sdk_hooks/hooks.rb +101 -0
- data/lib/stack_one/sdk_hooks/types.rb +152 -0
- data/lib/stack_one/sdkconfiguration.rb +25 -7
- data/lib/stack_one/stackone.rb +29 -10
- data/lib/stack_one/utils/retries.rb +95 -0
- data/lib/stack_one/utils/utils.rb +10 -0
- metadata +74 -10
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_home_location_state_value.rb +0 -3840
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_work_location_state_value.rb +0 -3840
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_home_location_state_value.rb +0 -3840
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_work_location_state_value.rb +0 -3840
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_home_location_state_value.rb +0 -3840
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_work_location_state_value.rb +0 -3840
data/lib/stack_one/crm.rb
CHANGED
@@ -5,7 +5,10 @@
|
|
5
5
|
|
6
6
|
require 'faraday'
|
7
7
|
require 'faraday/multipart'
|
8
|
+
require 'faraday/retry'
|
8
9
|
require 'sorbet-runtime'
|
10
|
+
require_relative 'sdk_hooks/hooks'
|
11
|
+
require_relative 'utils/retries'
|
9
12
|
|
10
13
|
module StackOne
|
11
14
|
extend T::Sig
|
@@ -19,8 +22,8 @@ module StackOne
|
|
19
22
|
end
|
20
23
|
|
21
24
|
|
22
|
-
sig { params(crm_create_contact_request_dto: ::StackOne::Shared::CrmCreateContactRequestDto, x_account_id: ::String).returns(::StackOne::Operations::CrmCreateContactResponse) }
|
23
|
-
def create_contact(crm_create_contact_request_dto, x_account_id)
|
25
|
+
sig { params(crm_create_contact_request_dto: ::StackOne::Shared::CrmCreateContactRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmCreateContactResponse) }
|
26
|
+
def create_contact(crm_create_contact_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
24
27
|
# create_contact - Creates a new Contact
|
25
28
|
request = ::StackOne::Operations::CrmCreateContactRequest.new(
|
26
29
|
|
@@ -34,19 +37,85 @@ module StackOne
|
|
34
37
|
req_content_type, data, form = Utils.serialize_request_body(request, :crm_create_contact_request_dto, :json)
|
35
38
|
headers['content-type'] = req_content_type
|
36
39
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
40
|
+
|
41
|
+
if form
|
42
|
+
body = Utils.encode_form(form)
|
43
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
44
|
+
body = URI.encode_www_form(data)
|
45
|
+
else
|
46
|
+
body = data
|
47
|
+
end
|
37
48
|
headers['Accept'] = 'application/json'
|
38
49
|
headers['user-agent'] = @sdk_configuration.user_agent
|
50
|
+
retries ||= @sdk_configuration.retry_config
|
51
|
+
retries ||= Utils::RetryConfig.new(
|
52
|
+
backoff: Utils::BackoffStrategy.new(
|
53
|
+
exponent: 1.5,
|
54
|
+
initial_interval: 500,
|
55
|
+
max_elapsed_time: 3_600_000,
|
56
|
+
max_interval: 60_000
|
57
|
+
),
|
58
|
+
retry_connection_errors: true,
|
59
|
+
strategy: 'backoff'
|
60
|
+
)
|
61
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
62
|
+
retry_options[:retry_statuses] = [429, 408]
|
63
|
+
|
64
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
65
|
+
|
66
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
67
|
+
timeout ||= @sdk_configuration.timeout
|
68
|
+
|
69
|
+
connection = @sdk_configuration.client.dup
|
70
|
+
connection.request :retry, retry_options
|
71
|
+
|
72
|
+
hook_ctx = SDKHooks::HookContext.new(
|
73
|
+
base_url: base_url,
|
74
|
+
oauth2_scopes: [],
|
75
|
+
operation_id: 'crm_create_contact',
|
76
|
+
security_source: @sdk_configuration.security_source
|
77
|
+
)
|
39
78
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
req.body =
|
46
|
-
|
47
|
-
req.
|
79
|
+
error = T.let(nil, T.nilable(StandardError))
|
80
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
81
|
+
|
82
|
+
begin
|
83
|
+
r = connection.post(url) do |req|
|
84
|
+
req.body = body
|
85
|
+
req.headers.merge!(headers)
|
86
|
+
req.options.timeout = timeout unless timeout.nil?
|
87
|
+
Utils.configure_request_security(req, security)
|
88
|
+
|
89
|
+
@sdk_configuration.hooks.before_request(
|
90
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
91
|
+
hook_ctx: hook_ctx
|
92
|
+
),
|
93
|
+
request: req
|
94
|
+
)
|
95
|
+
end
|
96
|
+
rescue StandardError => e
|
97
|
+
error = e
|
98
|
+
ensure
|
99
|
+
if r.nil? || Utils.error_status?(r.status)
|
100
|
+
r = @sdk_configuration.hooks.after_error(
|
101
|
+
error: error,
|
102
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
103
|
+
hook_ctx: hook_ctx
|
104
|
+
),
|
105
|
+
response: r
|
106
|
+
)
|
48
107
|
else
|
49
|
-
|
108
|
+
r = @sdk_configuration.hooks.after_success(
|
109
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
110
|
+
hook_ctx: hook_ctx
|
111
|
+
),
|
112
|
+
response: r
|
113
|
+
)
|
114
|
+
end
|
115
|
+
|
116
|
+
if r.nil?
|
117
|
+
raise error if !error.nil?
|
118
|
+
raise 'no response'
|
50
119
|
end
|
51
120
|
end
|
52
121
|
|
@@ -70,8 +139,8 @@ module StackOne
|
|
70
139
|
end
|
71
140
|
|
72
141
|
|
73
|
-
sig { params(request: T.nilable(::StackOne::Operations::CrmGetAccountRequest)).returns(::StackOne::Operations::CrmGetAccountResponse) }
|
74
|
-
def get_account(request)
|
142
|
+
sig { params(request: T.nilable(::StackOne::Operations::CrmGetAccountRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmGetAccountResponse) }
|
143
|
+
def get_account(request, retries = nil, timeout_ms = nil)
|
75
144
|
# get_account - Get Account
|
76
145
|
url, params = @sdk_configuration.get_server_details
|
77
146
|
base_url = Utils.template_url(url, params)
|
@@ -85,12 +154,76 @@ module StackOne
|
|
85
154
|
query_params = Utils.get_query_params(::StackOne::Operations::CrmGetAccountRequest, request)
|
86
155
|
headers['Accept'] = 'application/json'
|
87
156
|
headers['user-agent'] = @sdk_configuration.user_agent
|
157
|
+
retries ||= @sdk_configuration.retry_config
|
158
|
+
retries ||= Utils::RetryConfig.new(
|
159
|
+
backoff: Utils::BackoffStrategy.new(
|
160
|
+
exponent: 1.5,
|
161
|
+
initial_interval: 500,
|
162
|
+
max_elapsed_time: 3_600_000,
|
163
|
+
max_interval: 60_000
|
164
|
+
),
|
165
|
+
retry_connection_errors: true,
|
166
|
+
strategy: 'backoff'
|
167
|
+
)
|
168
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
169
|
+
retry_options[:retry_statuses] = [429, 408]
|
170
|
+
|
171
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
172
|
+
|
173
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
174
|
+
timeout ||= @sdk_configuration.timeout
|
88
175
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
176
|
+
connection = @sdk_configuration.client.dup
|
177
|
+
connection.request :retry, retry_options
|
178
|
+
|
179
|
+
hook_ctx = SDKHooks::HookContext.new(
|
180
|
+
base_url: base_url,
|
181
|
+
oauth2_scopes: [],
|
182
|
+
operation_id: 'crm_get_account',
|
183
|
+
security_source: @sdk_configuration.security_source
|
184
|
+
)
|
185
|
+
|
186
|
+
error = T.let(nil, T.nilable(StandardError))
|
187
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
188
|
+
|
189
|
+
begin
|
190
|
+
r = connection.get(url) do |req|
|
191
|
+
req.headers.merge!(headers)
|
192
|
+
req.options.timeout = timeout unless timeout.nil?
|
193
|
+
req.params = query_params
|
194
|
+
Utils.configure_request_security(req, security)
|
195
|
+
|
196
|
+
@sdk_configuration.hooks.before_request(
|
197
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
198
|
+
hook_ctx: hook_ctx
|
199
|
+
),
|
200
|
+
request: req
|
201
|
+
)
|
202
|
+
end
|
203
|
+
rescue StandardError => e
|
204
|
+
error = e
|
205
|
+
ensure
|
206
|
+
if r.nil? || Utils.error_status?(r.status)
|
207
|
+
r = @sdk_configuration.hooks.after_error(
|
208
|
+
error: error,
|
209
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
210
|
+
hook_ctx: hook_ctx
|
211
|
+
),
|
212
|
+
response: r
|
213
|
+
)
|
214
|
+
else
|
215
|
+
r = @sdk_configuration.hooks.after_success(
|
216
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
217
|
+
hook_ctx: hook_ctx
|
218
|
+
),
|
219
|
+
response: r
|
220
|
+
)
|
221
|
+
end
|
222
|
+
|
223
|
+
if r.nil?
|
224
|
+
raise error if !error.nil?
|
225
|
+
raise 'no response'
|
226
|
+
end
|
94
227
|
end
|
95
228
|
|
96
229
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -113,8 +246,8 @@ module StackOne
|
|
113
246
|
end
|
114
247
|
|
115
248
|
|
116
|
-
sig { params(request: T.nilable(::StackOne::Operations::CrmGetContactRequest)).returns(::StackOne::Operations::CrmGetContactResponse) }
|
117
|
-
def get_contact(request)
|
249
|
+
sig { params(request: T.nilable(::StackOne::Operations::CrmGetContactRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmGetContactResponse) }
|
250
|
+
def get_contact(request, retries = nil, timeout_ms = nil)
|
118
251
|
# get_contact - Get Contact
|
119
252
|
url, params = @sdk_configuration.get_server_details
|
120
253
|
base_url = Utils.template_url(url, params)
|
@@ -128,12 +261,76 @@ module StackOne
|
|
128
261
|
query_params = Utils.get_query_params(::StackOne::Operations::CrmGetContactRequest, request)
|
129
262
|
headers['Accept'] = 'application/json'
|
130
263
|
headers['user-agent'] = @sdk_configuration.user_agent
|
264
|
+
retries ||= @sdk_configuration.retry_config
|
265
|
+
retries ||= Utils::RetryConfig.new(
|
266
|
+
backoff: Utils::BackoffStrategy.new(
|
267
|
+
exponent: 1.5,
|
268
|
+
initial_interval: 500,
|
269
|
+
max_elapsed_time: 3_600_000,
|
270
|
+
max_interval: 60_000
|
271
|
+
),
|
272
|
+
retry_connection_errors: true,
|
273
|
+
strategy: 'backoff'
|
274
|
+
)
|
275
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
276
|
+
retry_options[:retry_statuses] = [429, 408]
|
277
|
+
|
278
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
279
|
+
|
280
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
281
|
+
timeout ||= @sdk_configuration.timeout
|
282
|
+
|
283
|
+
connection = @sdk_configuration.client.dup
|
284
|
+
connection.request :retry, retry_options
|
285
|
+
|
286
|
+
hook_ctx = SDKHooks::HookContext.new(
|
287
|
+
base_url: base_url,
|
288
|
+
oauth2_scopes: [],
|
289
|
+
operation_id: 'crm_get_contact',
|
290
|
+
security_source: @sdk_configuration.security_source
|
291
|
+
)
|
131
292
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
293
|
+
error = T.let(nil, T.nilable(StandardError))
|
294
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
295
|
+
|
296
|
+
begin
|
297
|
+
r = connection.get(url) do |req|
|
298
|
+
req.headers.merge!(headers)
|
299
|
+
req.options.timeout = timeout unless timeout.nil?
|
300
|
+
req.params = query_params
|
301
|
+
Utils.configure_request_security(req, security)
|
302
|
+
|
303
|
+
@sdk_configuration.hooks.before_request(
|
304
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
305
|
+
hook_ctx: hook_ctx
|
306
|
+
),
|
307
|
+
request: req
|
308
|
+
)
|
309
|
+
end
|
310
|
+
rescue StandardError => e
|
311
|
+
error = e
|
312
|
+
ensure
|
313
|
+
if r.nil? || Utils.error_status?(r.status)
|
314
|
+
r = @sdk_configuration.hooks.after_error(
|
315
|
+
error: error,
|
316
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
317
|
+
hook_ctx: hook_ctx
|
318
|
+
),
|
319
|
+
response: r
|
320
|
+
)
|
321
|
+
else
|
322
|
+
r = @sdk_configuration.hooks.after_success(
|
323
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
324
|
+
hook_ctx: hook_ctx
|
325
|
+
),
|
326
|
+
response: r
|
327
|
+
)
|
328
|
+
end
|
329
|
+
|
330
|
+
if r.nil?
|
331
|
+
raise error if !error.nil?
|
332
|
+
raise 'no response'
|
333
|
+
end
|
137
334
|
end
|
138
335
|
|
139
336
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -156,8 +353,8 @@ module StackOne
|
|
156
353
|
end
|
157
354
|
|
158
355
|
|
159
|
-
sig { params(request: T.nilable(::StackOne::Operations::CrmGetContactCustomFieldDefinitionRequest)).returns(::StackOne::Operations::CrmGetContactCustomFieldDefinitionResponse) }
|
160
|
-
def get_contact_custom_field_definition(request)
|
356
|
+
sig { params(request: T.nilable(::StackOne::Operations::CrmGetContactCustomFieldDefinitionRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmGetContactCustomFieldDefinitionResponse) }
|
357
|
+
def get_contact_custom_field_definition(request, retries = nil, timeout_ms = nil)
|
161
358
|
# get_contact_custom_field_definition - Get Contact Custom Field Definition
|
162
359
|
url, params = @sdk_configuration.get_server_details
|
163
360
|
base_url = Utils.template_url(url, params)
|
@@ -171,12 +368,76 @@ module StackOne
|
|
171
368
|
query_params = Utils.get_query_params(::StackOne::Operations::CrmGetContactCustomFieldDefinitionRequest, request)
|
172
369
|
headers['Accept'] = 'application/json'
|
173
370
|
headers['user-agent'] = @sdk_configuration.user_agent
|
371
|
+
retries ||= @sdk_configuration.retry_config
|
372
|
+
retries ||= Utils::RetryConfig.new(
|
373
|
+
backoff: Utils::BackoffStrategy.new(
|
374
|
+
exponent: 1.5,
|
375
|
+
initial_interval: 500,
|
376
|
+
max_elapsed_time: 3_600_000,
|
377
|
+
max_interval: 60_000
|
378
|
+
),
|
379
|
+
retry_connection_errors: true,
|
380
|
+
strategy: 'backoff'
|
381
|
+
)
|
382
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
383
|
+
retry_options[:retry_statuses] = [429, 408]
|
384
|
+
|
385
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
174
386
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
387
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
388
|
+
timeout ||= @sdk_configuration.timeout
|
389
|
+
|
390
|
+
connection = @sdk_configuration.client.dup
|
391
|
+
connection.request :retry, retry_options
|
392
|
+
|
393
|
+
hook_ctx = SDKHooks::HookContext.new(
|
394
|
+
base_url: base_url,
|
395
|
+
oauth2_scopes: [],
|
396
|
+
operation_id: 'crm_get_contact_custom_field_definition',
|
397
|
+
security_source: @sdk_configuration.security_source
|
398
|
+
)
|
399
|
+
|
400
|
+
error = T.let(nil, T.nilable(StandardError))
|
401
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
402
|
+
|
403
|
+
begin
|
404
|
+
r = connection.get(url) do |req|
|
405
|
+
req.headers.merge!(headers)
|
406
|
+
req.options.timeout = timeout unless timeout.nil?
|
407
|
+
req.params = query_params
|
408
|
+
Utils.configure_request_security(req, security)
|
409
|
+
|
410
|
+
@sdk_configuration.hooks.before_request(
|
411
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
412
|
+
hook_ctx: hook_ctx
|
413
|
+
),
|
414
|
+
request: req
|
415
|
+
)
|
416
|
+
end
|
417
|
+
rescue StandardError => e
|
418
|
+
error = e
|
419
|
+
ensure
|
420
|
+
if r.nil? || Utils.error_status?(r.status)
|
421
|
+
r = @sdk_configuration.hooks.after_error(
|
422
|
+
error: error,
|
423
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
424
|
+
hook_ctx: hook_ctx
|
425
|
+
),
|
426
|
+
response: r
|
427
|
+
)
|
428
|
+
else
|
429
|
+
r = @sdk_configuration.hooks.after_success(
|
430
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
431
|
+
hook_ctx: hook_ctx
|
432
|
+
),
|
433
|
+
response: r
|
434
|
+
)
|
435
|
+
end
|
436
|
+
|
437
|
+
if r.nil?
|
438
|
+
raise error if !error.nil?
|
439
|
+
raise 'no response'
|
440
|
+
end
|
180
441
|
end
|
181
442
|
|
182
443
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -199,8 +460,8 @@ module StackOne
|
|
199
460
|
end
|
200
461
|
|
201
462
|
|
202
|
-
sig { params(request: T.nilable(::StackOne::Operations::CrmGetListRequest)).returns(::StackOne::Operations::CrmGetListResponse) }
|
203
|
-
def get_list(request)
|
463
|
+
sig { params(request: T.nilable(::StackOne::Operations::CrmGetListRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmGetListResponse) }
|
464
|
+
def get_list(request, retries = nil, timeout_ms = nil)
|
204
465
|
# get_list - Get List
|
205
466
|
url, params = @sdk_configuration.get_server_details
|
206
467
|
base_url = Utils.template_url(url, params)
|
@@ -214,12 +475,76 @@ module StackOne
|
|
214
475
|
query_params = Utils.get_query_params(::StackOne::Operations::CrmGetListRequest, request)
|
215
476
|
headers['Accept'] = 'application/json'
|
216
477
|
headers['user-agent'] = @sdk_configuration.user_agent
|
478
|
+
retries ||= @sdk_configuration.retry_config
|
479
|
+
retries ||= Utils::RetryConfig.new(
|
480
|
+
backoff: Utils::BackoffStrategy.new(
|
481
|
+
exponent: 1.5,
|
482
|
+
initial_interval: 500,
|
483
|
+
max_elapsed_time: 3_600_000,
|
484
|
+
max_interval: 60_000
|
485
|
+
),
|
486
|
+
retry_connection_errors: true,
|
487
|
+
strategy: 'backoff'
|
488
|
+
)
|
489
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
490
|
+
retry_options[:retry_statuses] = [429, 408]
|
491
|
+
|
492
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
217
493
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
494
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
495
|
+
timeout ||= @sdk_configuration.timeout
|
496
|
+
|
497
|
+
connection = @sdk_configuration.client.dup
|
498
|
+
connection.request :retry, retry_options
|
499
|
+
|
500
|
+
hook_ctx = SDKHooks::HookContext.new(
|
501
|
+
base_url: base_url,
|
502
|
+
oauth2_scopes: [],
|
503
|
+
operation_id: 'crm_get_list',
|
504
|
+
security_source: @sdk_configuration.security_source
|
505
|
+
)
|
506
|
+
|
507
|
+
error = T.let(nil, T.nilable(StandardError))
|
508
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
509
|
+
|
510
|
+
begin
|
511
|
+
r = connection.get(url) do |req|
|
512
|
+
req.headers.merge!(headers)
|
513
|
+
req.options.timeout = timeout unless timeout.nil?
|
514
|
+
req.params = query_params
|
515
|
+
Utils.configure_request_security(req, security)
|
516
|
+
|
517
|
+
@sdk_configuration.hooks.before_request(
|
518
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
519
|
+
hook_ctx: hook_ctx
|
520
|
+
),
|
521
|
+
request: req
|
522
|
+
)
|
523
|
+
end
|
524
|
+
rescue StandardError => e
|
525
|
+
error = e
|
526
|
+
ensure
|
527
|
+
if r.nil? || Utils.error_status?(r.status)
|
528
|
+
r = @sdk_configuration.hooks.after_error(
|
529
|
+
error: error,
|
530
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
531
|
+
hook_ctx: hook_ctx
|
532
|
+
),
|
533
|
+
response: r
|
534
|
+
)
|
535
|
+
else
|
536
|
+
r = @sdk_configuration.hooks.after_success(
|
537
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
538
|
+
hook_ctx: hook_ctx
|
539
|
+
),
|
540
|
+
response: r
|
541
|
+
)
|
542
|
+
end
|
543
|
+
|
544
|
+
if r.nil?
|
545
|
+
raise error if !error.nil?
|
546
|
+
raise 'no response'
|
547
|
+
end
|
223
548
|
end
|
224
549
|
|
225
550
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -242,8 +567,8 @@ module StackOne
|
|
242
567
|
end
|
243
568
|
|
244
569
|
|
245
|
-
sig { params(request: T.nilable(::StackOne::Operations::CrmListAccountsRequest)).returns(::StackOne::Operations::CrmListAccountsResponse) }
|
246
|
-
def list_accounts(request)
|
570
|
+
sig { params(request: T.nilable(::StackOne::Operations::CrmListAccountsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmListAccountsResponse) }
|
571
|
+
def list_accounts(request, retries = nil, timeout_ms = nil)
|
247
572
|
# list_accounts - List Accounts
|
248
573
|
url, params = @sdk_configuration.get_server_details
|
249
574
|
base_url = Utils.template_url(url, params)
|
@@ -252,12 +577,76 @@ module StackOne
|
|
252
577
|
query_params = Utils.get_query_params(::StackOne::Operations::CrmListAccountsRequest, request)
|
253
578
|
headers['Accept'] = 'application/json'
|
254
579
|
headers['user-agent'] = @sdk_configuration.user_agent
|
580
|
+
retries ||= @sdk_configuration.retry_config
|
581
|
+
retries ||= Utils::RetryConfig.new(
|
582
|
+
backoff: Utils::BackoffStrategy.new(
|
583
|
+
exponent: 1.5,
|
584
|
+
initial_interval: 500,
|
585
|
+
max_elapsed_time: 3_600_000,
|
586
|
+
max_interval: 60_000
|
587
|
+
),
|
588
|
+
retry_connection_errors: true,
|
589
|
+
strategy: 'backoff'
|
590
|
+
)
|
591
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
592
|
+
retry_options[:retry_statuses] = [429, 408]
|
593
|
+
|
594
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
595
|
+
|
596
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
597
|
+
timeout ||= @sdk_configuration.timeout
|
598
|
+
|
599
|
+
connection = @sdk_configuration.client.dup
|
600
|
+
connection.request :retry, retry_options
|
255
601
|
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
602
|
+
hook_ctx = SDKHooks::HookContext.new(
|
603
|
+
base_url: base_url,
|
604
|
+
oauth2_scopes: [],
|
605
|
+
operation_id: 'crm_list_accounts',
|
606
|
+
security_source: @sdk_configuration.security_source
|
607
|
+
)
|
608
|
+
|
609
|
+
error = T.let(nil, T.nilable(StandardError))
|
610
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
611
|
+
|
612
|
+
begin
|
613
|
+
r = connection.get(url) do |req|
|
614
|
+
req.headers.merge!(headers)
|
615
|
+
req.options.timeout = timeout unless timeout.nil?
|
616
|
+
req.params = query_params
|
617
|
+
Utils.configure_request_security(req, security)
|
618
|
+
|
619
|
+
@sdk_configuration.hooks.before_request(
|
620
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
621
|
+
hook_ctx: hook_ctx
|
622
|
+
),
|
623
|
+
request: req
|
624
|
+
)
|
625
|
+
end
|
626
|
+
rescue StandardError => e
|
627
|
+
error = e
|
628
|
+
ensure
|
629
|
+
if r.nil? || Utils.error_status?(r.status)
|
630
|
+
r = @sdk_configuration.hooks.after_error(
|
631
|
+
error: error,
|
632
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
633
|
+
hook_ctx: hook_ctx
|
634
|
+
),
|
635
|
+
response: r
|
636
|
+
)
|
637
|
+
else
|
638
|
+
r = @sdk_configuration.hooks.after_success(
|
639
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
640
|
+
hook_ctx: hook_ctx
|
641
|
+
),
|
642
|
+
response: r
|
643
|
+
)
|
644
|
+
end
|
645
|
+
|
646
|
+
if r.nil?
|
647
|
+
raise error if !error.nil?
|
648
|
+
raise 'no response'
|
649
|
+
end
|
261
650
|
end
|
262
651
|
|
263
652
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -280,8 +669,8 @@ module StackOne
|
|
280
669
|
end
|
281
670
|
|
282
671
|
|
283
|
-
sig { params(request: T.nilable(::StackOne::Operations::CrmListContactCustomFieldDefinitionsRequest)).returns(::StackOne::Operations::CrmListContactCustomFieldDefinitionsResponse) }
|
284
|
-
def list_contact_custom_field_definitions(request)
|
672
|
+
sig { params(request: T.nilable(::StackOne::Operations::CrmListContactCustomFieldDefinitionsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmListContactCustomFieldDefinitionsResponse) }
|
673
|
+
def list_contact_custom_field_definitions(request, retries = nil, timeout_ms = nil)
|
285
674
|
# list_contact_custom_field_definitions - List Contact Custom Field Definitions
|
286
675
|
url, params = @sdk_configuration.get_server_details
|
287
676
|
base_url = Utils.template_url(url, params)
|
@@ -290,12 +679,76 @@ module StackOne
|
|
290
679
|
query_params = Utils.get_query_params(::StackOne::Operations::CrmListContactCustomFieldDefinitionsRequest, request)
|
291
680
|
headers['Accept'] = 'application/json'
|
292
681
|
headers['user-agent'] = @sdk_configuration.user_agent
|
682
|
+
retries ||= @sdk_configuration.retry_config
|
683
|
+
retries ||= Utils::RetryConfig.new(
|
684
|
+
backoff: Utils::BackoffStrategy.new(
|
685
|
+
exponent: 1.5,
|
686
|
+
initial_interval: 500,
|
687
|
+
max_elapsed_time: 3_600_000,
|
688
|
+
max_interval: 60_000
|
689
|
+
),
|
690
|
+
retry_connection_errors: true,
|
691
|
+
strategy: 'backoff'
|
692
|
+
)
|
693
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
694
|
+
retry_options[:retry_statuses] = [429, 408]
|
695
|
+
|
696
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
697
|
+
|
698
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
699
|
+
timeout ||= @sdk_configuration.timeout
|
293
700
|
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
701
|
+
connection = @sdk_configuration.client.dup
|
702
|
+
connection.request :retry, retry_options
|
703
|
+
|
704
|
+
hook_ctx = SDKHooks::HookContext.new(
|
705
|
+
base_url: base_url,
|
706
|
+
oauth2_scopes: [],
|
707
|
+
operation_id: 'crm_list_contact_custom_field_definitions',
|
708
|
+
security_source: @sdk_configuration.security_source
|
709
|
+
)
|
710
|
+
|
711
|
+
error = T.let(nil, T.nilable(StandardError))
|
712
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
713
|
+
|
714
|
+
begin
|
715
|
+
r = connection.get(url) do |req|
|
716
|
+
req.headers.merge!(headers)
|
717
|
+
req.options.timeout = timeout unless timeout.nil?
|
718
|
+
req.params = query_params
|
719
|
+
Utils.configure_request_security(req, security)
|
720
|
+
|
721
|
+
@sdk_configuration.hooks.before_request(
|
722
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
723
|
+
hook_ctx: hook_ctx
|
724
|
+
),
|
725
|
+
request: req
|
726
|
+
)
|
727
|
+
end
|
728
|
+
rescue StandardError => e
|
729
|
+
error = e
|
730
|
+
ensure
|
731
|
+
if r.nil? || Utils.error_status?(r.status)
|
732
|
+
r = @sdk_configuration.hooks.after_error(
|
733
|
+
error: error,
|
734
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
735
|
+
hook_ctx: hook_ctx
|
736
|
+
),
|
737
|
+
response: r
|
738
|
+
)
|
739
|
+
else
|
740
|
+
r = @sdk_configuration.hooks.after_success(
|
741
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
742
|
+
hook_ctx: hook_ctx
|
743
|
+
),
|
744
|
+
response: r
|
745
|
+
)
|
746
|
+
end
|
747
|
+
|
748
|
+
if r.nil?
|
749
|
+
raise error if !error.nil?
|
750
|
+
raise 'no response'
|
751
|
+
end
|
299
752
|
end
|
300
753
|
|
301
754
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -318,8 +771,8 @@ module StackOne
|
|
318
771
|
end
|
319
772
|
|
320
773
|
|
321
|
-
sig { params(request: T.nilable(::StackOne::Operations::CrmListContactsRequest)).returns(::StackOne::Operations::CrmListContactsResponse) }
|
322
|
-
def list_contacts(request)
|
774
|
+
sig { params(request: T.nilable(::StackOne::Operations::CrmListContactsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmListContactsResponse) }
|
775
|
+
def list_contacts(request, retries = nil, timeout_ms = nil)
|
323
776
|
# list_contacts - List Contacts
|
324
777
|
url, params = @sdk_configuration.get_server_details
|
325
778
|
base_url = Utils.template_url(url, params)
|
@@ -328,12 +781,76 @@ module StackOne
|
|
328
781
|
query_params = Utils.get_query_params(::StackOne::Operations::CrmListContactsRequest, request)
|
329
782
|
headers['Accept'] = 'application/json'
|
330
783
|
headers['user-agent'] = @sdk_configuration.user_agent
|
784
|
+
retries ||= @sdk_configuration.retry_config
|
785
|
+
retries ||= Utils::RetryConfig.new(
|
786
|
+
backoff: Utils::BackoffStrategy.new(
|
787
|
+
exponent: 1.5,
|
788
|
+
initial_interval: 500,
|
789
|
+
max_elapsed_time: 3_600_000,
|
790
|
+
max_interval: 60_000
|
791
|
+
),
|
792
|
+
retry_connection_errors: true,
|
793
|
+
strategy: 'backoff'
|
794
|
+
)
|
795
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
796
|
+
retry_options[:retry_statuses] = [429, 408]
|
797
|
+
|
798
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
799
|
+
|
800
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
801
|
+
timeout ||= @sdk_configuration.timeout
|
802
|
+
|
803
|
+
connection = @sdk_configuration.client.dup
|
804
|
+
connection.request :retry, retry_options
|
805
|
+
|
806
|
+
hook_ctx = SDKHooks::HookContext.new(
|
807
|
+
base_url: base_url,
|
808
|
+
oauth2_scopes: [],
|
809
|
+
operation_id: 'crm_list_contacts',
|
810
|
+
security_source: @sdk_configuration.security_source
|
811
|
+
)
|
331
812
|
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
813
|
+
error = T.let(nil, T.nilable(StandardError))
|
814
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
815
|
+
|
816
|
+
begin
|
817
|
+
r = connection.get(url) do |req|
|
818
|
+
req.headers.merge!(headers)
|
819
|
+
req.options.timeout = timeout unless timeout.nil?
|
820
|
+
req.params = query_params
|
821
|
+
Utils.configure_request_security(req, security)
|
822
|
+
|
823
|
+
@sdk_configuration.hooks.before_request(
|
824
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
825
|
+
hook_ctx: hook_ctx
|
826
|
+
),
|
827
|
+
request: req
|
828
|
+
)
|
829
|
+
end
|
830
|
+
rescue StandardError => e
|
831
|
+
error = e
|
832
|
+
ensure
|
833
|
+
if r.nil? || Utils.error_status?(r.status)
|
834
|
+
r = @sdk_configuration.hooks.after_error(
|
835
|
+
error: error,
|
836
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
837
|
+
hook_ctx: hook_ctx
|
838
|
+
),
|
839
|
+
response: r
|
840
|
+
)
|
841
|
+
else
|
842
|
+
r = @sdk_configuration.hooks.after_success(
|
843
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
844
|
+
hook_ctx: hook_ctx
|
845
|
+
),
|
846
|
+
response: r
|
847
|
+
)
|
848
|
+
end
|
849
|
+
|
850
|
+
if r.nil?
|
851
|
+
raise error if !error.nil?
|
852
|
+
raise 'no response'
|
853
|
+
end
|
337
854
|
end
|
338
855
|
|
339
856
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -356,8 +873,8 @@ module StackOne
|
|
356
873
|
end
|
357
874
|
|
358
875
|
|
359
|
-
sig { params(request: T.nilable(::StackOne::Operations::CrmListListsRequest)).returns(::StackOne::Operations::CrmListListsResponse) }
|
360
|
-
def list_lists(request)
|
876
|
+
sig { params(request: T.nilable(::StackOne::Operations::CrmListListsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmListListsResponse) }
|
877
|
+
def list_lists(request, retries = nil, timeout_ms = nil)
|
361
878
|
# list_lists - Get all Lists
|
362
879
|
url, params = @sdk_configuration.get_server_details
|
363
880
|
base_url = Utils.template_url(url, params)
|
@@ -366,12 +883,76 @@ module StackOne
|
|
366
883
|
query_params = Utils.get_query_params(::StackOne::Operations::CrmListListsRequest, request)
|
367
884
|
headers['Accept'] = 'application/json'
|
368
885
|
headers['user-agent'] = @sdk_configuration.user_agent
|
886
|
+
retries ||= @sdk_configuration.retry_config
|
887
|
+
retries ||= Utils::RetryConfig.new(
|
888
|
+
backoff: Utils::BackoffStrategy.new(
|
889
|
+
exponent: 1.5,
|
890
|
+
initial_interval: 500,
|
891
|
+
max_elapsed_time: 3_600_000,
|
892
|
+
max_interval: 60_000
|
893
|
+
),
|
894
|
+
retry_connection_errors: true,
|
895
|
+
strategy: 'backoff'
|
896
|
+
)
|
897
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
898
|
+
retry_options[:retry_statuses] = [429, 408]
|
899
|
+
|
900
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
369
901
|
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
902
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
903
|
+
timeout ||= @sdk_configuration.timeout
|
904
|
+
|
905
|
+
connection = @sdk_configuration.client.dup
|
906
|
+
connection.request :retry, retry_options
|
907
|
+
|
908
|
+
hook_ctx = SDKHooks::HookContext.new(
|
909
|
+
base_url: base_url,
|
910
|
+
oauth2_scopes: [],
|
911
|
+
operation_id: 'crm_list_lists',
|
912
|
+
security_source: @sdk_configuration.security_source
|
913
|
+
)
|
914
|
+
|
915
|
+
error = T.let(nil, T.nilable(StandardError))
|
916
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
917
|
+
|
918
|
+
begin
|
919
|
+
r = connection.get(url) do |req|
|
920
|
+
req.headers.merge!(headers)
|
921
|
+
req.options.timeout = timeout unless timeout.nil?
|
922
|
+
req.params = query_params
|
923
|
+
Utils.configure_request_security(req, security)
|
924
|
+
|
925
|
+
@sdk_configuration.hooks.before_request(
|
926
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
927
|
+
hook_ctx: hook_ctx
|
928
|
+
),
|
929
|
+
request: req
|
930
|
+
)
|
931
|
+
end
|
932
|
+
rescue StandardError => e
|
933
|
+
error = e
|
934
|
+
ensure
|
935
|
+
if r.nil? || Utils.error_status?(r.status)
|
936
|
+
r = @sdk_configuration.hooks.after_error(
|
937
|
+
error: error,
|
938
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
939
|
+
hook_ctx: hook_ctx
|
940
|
+
),
|
941
|
+
response: r
|
942
|
+
)
|
943
|
+
else
|
944
|
+
r = @sdk_configuration.hooks.after_success(
|
945
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
946
|
+
hook_ctx: hook_ctx
|
947
|
+
),
|
948
|
+
response: r
|
949
|
+
)
|
950
|
+
end
|
951
|
+
|
952
|
+
if r.nil?
|
953
|
+
raise error if !error.nil?
|
954
|
+
raise 'no response'
|
955
|
+
end
|
375
956
|
end
|
376
957
|
|
377
958
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -394,8 +975,8 @@ module StackOne
|
|
394
975
|
end
|
395
976
|
|
396
977
|
|
397
|
-
sig { params(crm_create_contact_request_dto: ::StackOne::Shared::CrmCreateContactRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::CrmUpdateContactResponse) }
|
398
|
-
def update_contact(crm_create_contact_request_dto, id, x_account_id)
|
978
|
+
sig { params(crm_create_contact_request_dto: ::StackOne::Shared::CrmCreateContactRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmUpdateContactResponse) }
|
979
|
+
def update_contact(crm_create_contact_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
399
980
|
# update_contact - Update Contact (early access)
|
400
981
|
request = ::StackOne::Operations::CrmUpdateContactRequest.new(
|
401
982
|
|
@@ -415,19 +996,85 @@ module StackOne
|
|
415
996
|
req_content_type, data, form = Utils.serialize_request_body(request, :crm_create_contact_request_dto, :json)
|
416
997
|
headers['content-type'] = req_content_type
|
417
998
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
999
|
+
|
1000
|
+
if form
|
1001
|
+
body = Utils.encode_form(form)
|
1002
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
1003
|
+
body = URI.encode_www_form(data)
|
1004
|
+
else
|
1005
|
+
body = data
|
1006
|
+
end
|
418
1007
|
headers['Accept'] = 'application/json'
|
419
1008
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1009
|
+
retries ||= @sdk_configuration.retry_config
|
1010
|
+
retries ||= Utils::RetryConfig.new(
|
1011
|
+
backoff: Utils::BackoffStrategy.new(
|
1012
|
+
exponent: 1.5,
|
1013
|
+
initial_interval: 500,
|
1014
|
+
max_elapsed_time: 3_600_000,
|
1015
|
+
max_interval: 60_000
|
1016
|
+
),
|
1017
|
+
retry_connection_errors: true,
|
1018
|
+
strategy: 'backoff'
|
1019
|
+
)
|
1020
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1021
|
+
retry_options[:retry_statuses] = [429, 408]
|
1022
|
+
|
1023
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1024
|
+
|
1025
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1026
|
+
timeout ||= @sdk_configuration.timeout
|
420
1027
|
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
1028
|
+
connection = @sdk_configuration.client.dup
|
1029
|
+
connection.request :retry, retry_options
|
1030
|
+
|
1031
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1032
|
+
base_url: base_url,
|
1033
|
+
oauth2_scopes: [],
|
1034
|
+
operation_id: 'crm_update_contact',
|
1035
|
+
security_source: @sdk_configuration.security_source
|
1036
|
+
)
|
1037
|
+
|
1038
|
+
error = T.let(nil, T.nilable(StandardError))
|
1039
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1040
|
+
|
1041
|
+
begin
|
1042
|
+
r = connection.patch(url) do |req|
|
1043
|
+
req.body = body
|
1044
|
+
req.headers.merge!(headers)
|
1045
|
+
req.options.timeout = timeout unless timeout.nil?
|
1046
|
+
Utils.configure_request_security(req, security)
|
1047
|
+
|
1048
|
+
@sdk_configuration.hooks.before_request(
|
1049
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1050
|
+
hook_ctx: hook_ctx
|
1051
|
+
),
|
1052
|
+
request: req
|
1053
|
+
)
|
1054
|
+
end
|
1055
|
+
rescue StandardError => e
|
1056
|
+
error = e
|
1057
|
+
ensure
|
1058
|
+
if r.nil? || Utils.error_status?(r.status)
|
1059
|
+
r = @sdk_configuration.hooks.after_error(
|
1060
|
+
error: error,
|
1061
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1062
|
+
hook_ctx: hook_ctx
|
1063
|
+
),
|
1064
|
+
response: r
|
1065
|
+
)
|
429
1066
|
else
|
430
|
-
|
1067
|
+
r = @sdk_configuration.hooks.after_success(
|
1068
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1069
|
+
hook_ctx: hook_ctx
|
1070
|
+
),
|
1071
|
+
response: r
|
1072
|
+
)
|
1073
|
+
end
|
1074
|
+
|
1075
|
+
if r.nil?
|
1076
|
+
raise error if !error.nil?
|
1077
|
+
raise 'no response'
|
431
1078
|
end
|
432
1079
|
end
|
433
1080
|
|