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/marketing.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(marketing_create_content_blocks_request_dto: ::StackOne::Shared::MarketingCreateContentBlocksRequestDto, x_account_id: ::String).returns(::StackOne::Operations::MarketingCreateContentBlockResponse) }
|
23
|
-
def create_content_block(marketing_create_content_blocks_request_dto, x_account_id)
|
25
|
+
sig { params(marketing_create_content_blocks_request_dto: ::StackOne::Shared::MarketingCreateContentBlocksRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingCreateContentBlockResponse) }
|
26
|
+
def create_content_block(marketing_create_content_blocks_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
24
27
|
# create_content_block - Create Content Block
|
25
28
|
request = ::StackOne::Operations::MarketingCreateContentBlockRequest.new(
|
26
29
|
|
@@ -34,19 +37,85 @@ module StackOne
|
|
34
37
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_content_blocks_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
|
39
68
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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: 'marketing_create_content_block',
|
76
|
+
security_source: @sdk_configuration.security_source
|
77
|
+
)
|
78
|
+
|
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(marketing_create_email_template_request_dto: ::StackOne::Shared::MarketingCreateEmailTemplateRequestDto, x_account_id: ::String).returns(::StackOne::Operations::MarketingCreateEmailTemplateResponse) }
|
74
|
-
def create_email_template(marketing_create_email_template_request_dto, x_account_id)
|
142
|
+
sig { params(marketing_create_email_template_request_dto: ::StackOne::Shared::MarketingCreateEmailTemplateRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingCreateEmailTemplateResponse) }
|
143
|
+
def create_email_template(marketing_create_email_template_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
75
144
|
# create_email_template - Create Email Templates
|
76
145
|
request = ::StackOne::Operations::MarketingCreateEmailTemplateRequest.new(
|
77
146
|
|
@@ -85,19 +154,85 @@ module StackOne
|
|
85
154
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_email_template_request_dto, :json)
|
86
155
|
headers['content-type'] = req_content_type
|
87
156
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
157
|
+
|
158
|
+
if form
|
159
|
+
body = Utils.encode_form(form)
|
160
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
161
|
+
body = URI.encode_www_form(data)
|
162
|
+
else
|
163
|
+
body = data
|
164
|
+
end
|
88
165
|
headers['Accept'] = 'application/json'
|
89
166
|
headers['user-agent'] = @sdk_configuration.user_agent
|
167
|
+
retries ||= @sdk_configuration.retry_config
|
168
|
+
retries ||= Utils::RetryConfig.new(
|
169
|
+
backoff: Utils::BackoffStrategy.new(
|
170
|
+
exponent: 1.5,
|
171
|
+
initial_interval: 500,
|
172
|
+
max_elapsed_time: 3_600_000,
|
173
|
+
max_interval: 60_000
|
174
|
+
),
|
175
|
+
retry_connection_errors: true,
|
176
|
+
strategy: 'backoff'
|
177
|
+
)
|
178
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
179
|
+
retry_options[:retry_statuses] = [429, 408]
|
180
|
+
|
181
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
182
|
+
|
183
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
184
|
+
timeout ||= @sdk_configuration.timeout
|
185
|
+
|
186
|
+
connection = @sdk_configuration.client.dup
|
187
|
+
connection.request :retry, retry_options
|
188
|
+
|
189
|
+
hook_ctx = SDKHooks::HookContext.new(
|
190
|
+
base_url: base_url,
|
191
|
+
oauth2_scopes: [],
|
192
|
+
operation_id: 'marketing_create_email_template',
|
193
|
+
security_source: @sdk_configuration.security_source
|
194
|
+
)
|
90
195
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
req.body =
|
97
|
-
|
98
|
-
req.
|
196
|
+
error = T.let(nil, T.nilable(StandardError))
|
197
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
198
|
+
|
199
|
+
begin
|
200
|
+
r = connection.post(url) do |req|
|
201
|
+
req.body = body
|
202
|
+
req.headers.merge!(headers)
|
203
|
+
req.options.timeout = timeout unless timeout.nil?
|
204
|
+
Utils.configure_request_security(req, security)
|
205
|
+
|
206
|
+
@sdk_configuration.hooks.before_request(
|
207
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
208
|
+
hook_ctx: hook_ctx
|
209
|
+
),
|
210
|
+
request: req
|
211
|
+
)
|
212
|
+
end
|
213
|
+
rescue StandardError => e
|
214
|
+
error = e
|
215
|
+
ensure
|
216
|
+
if r.nil? || Utils.error_status?(r.status)
|
217
|
+
r = @sdk_configuration.hooks.after_error(
|
218
|
+
error: error,
|
219
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
220
|
+
hook_ctx: hook_ctx
|
221
|
+
),
|
222
|
+
response: r
|
223
|
+
)
|
99
224
|
else
|
100
|
-
|
225
|
+
r = @sdk_configuration.hooks.after_success(
|
226
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
227
|
+
hook_ctx: hook_ctx
|
228
|
+
),
|
229
|
+
response: r
|
230
|
+
)
|
231
|
+
end
|
232
|
+
|
233
|
+
if r.nil?
|
234
|
+
raise error if !error.nil?
|
235
|
+
raise 'no response'
|
101
236
|
end
|
102
237
|
end
|
103
238
|
|
@@ -121,8 +256,8 @@ module StackOne
|
|
121
256
|
end
|
122
257
|
|
123
258
|
|
124
|
-
sig { params(marketing_create_in_app_template_request_dto: ::StackOne::Shared::MarketingCreateInAppTemplateRequestDto, x_account_id: ::String).returns(::StackOne::Operations::MarketingCreateInAppTemplateResponse) }
|
125
|
-
def create_in_app_template(marketing_create_in_app_template_request_dto, x_account_id)
|
259
|
+
sig { params(marketing_create_in_app_template_request_dto: ::StackOne::Shared::MarketingCreateInAppTemplateRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingCreateInAppTemplateResponse) }
|
260
|
+
def create_in_app_template(marketing_create_in_app_template_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
126
261
|
# create_in_app_template - Create In-App Template
|
127
262
|
request = ::StackOne::Operations::MarketingCreateInAppTemplateRequest.new(
|
128
263
|
|
@@ -136,19 +271,85 @@ module StackOne
|
|
136
271
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_in_app_template_request_dto, :json)
|
137
272
|
headers['content-type'] = req_content_type
|
138
273
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
274
|
+
|
275
|
+
if form
|
276
|
+
body = Utils.encode_form(form)
|
277
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
278
|
+
body = URI.encode_www_form(data)
|
279
|
+
else
|
280
|
+
body = data
|
281
|
+
end
|
139
282
|
headers['Accept'] = 'application/json'
|
140
283
|
headers['user-agent'] = @sdk_configuration.user_agent
|
284
|
+
retries ||= @sdk_configuration.retry_config
|
285
|
+
retries ||= Utils::RetryConfig.new(
|
286
|
+
backoff: Utils::BackoffStrategy.new(
|
287
|
+
exponent: 1.5,
|
288
|
+
initial_interval: 500,
|
289
|
+
max_elapsed_time: 3_600_000,
|
290
|
+
max_interval: 60_000
|
291
|
+
),
|
292
|
+
retry_connection_errors: true,
|
293
|
+
strategy: 'backoff'
|
294
|
+
)
|
295
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
296
|
+
retry_options[:retry_statuses] = [429, 408]
|
297
|
+
|
298
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
299
|
+
|
300
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
301
|
+
timeout ||= @sdk_configuration.timeout
|
141
302
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
303
|
+
connection = @sdk_configuration.client.dup
|
304
|
+
connection.request :retry, retry_options
|
305
|
+
|
306
|
+
hook_ctx = SDKHooks::HookContext.new(
|
307
|
+
base_url: base_url,
|
308
|
+
oauth2_scopes: [],
|
309
|
+
operation_id: 'marketing_create_in_app_template',
|
310
|
+
security_source: @sdk_configuration.security_source
|
311
|
+
)
|
312
|
+
|
313
|
+
error = T.let(nil, T.nilable(StandardError))
|
314
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
315
|
+
|
316
|
+
begin
|
317
|
+
r = connection.post(url) do |req|
|
318
|
+
req.body = body
|
319
|
+
req.headers.merge!(headers)
|
320
|
+
req.options.timeout = timeout unless timeout.nil?
|
321
|
+
Utils.configure_request_security(req, security)
|
322
|
+
|
323
|
+
@sdk_configuration.hooks.before_request(
|
324
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
325
|
+
hook_ctx: hook_ctx
|
326
|
+
),
|
327
|
+
request: req
|
328
|
+
)
|
329
|
+
end
|
330
|
+
rescue StandardError => e
|
331
|
+
error = e
|
332
|
+
ensure
|
333
|
+
if r.nil? || Utils.error_status?(r.status)
|
334
|
+
r = @sdk_configuration.hooks.after_error(
|
335
|
+
error: error,
|
336
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
337
|
+
hook_ctx: hook_ctx
|
338
|
+
),
|
339
|
+
response: r
|
340
|
+
)
|
150
341
|
else
|
151
|
-
|
342
|
+
r = @sdk_configuration.hooks.after_success(
|
343
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
344
|
+
hook_ctx: hook_ctx
|
345
|
+
),
|
346
|
+
response: r
|
347
|
+
)
|
348
|
+
end
|
349
|
+
|
350
|
+
if r.nil?
|
351
|
+
raise error if !error.nil?
|
352
|
+
raise 'no response'
|
152
353
|
end
|
153
354
|
end
|
154
355
|
|
@@ -172,8 +373,8 @@ module StackOne
|
|
172
373
|
end
|
173
374
|
|
174
375
|
|
175
|
-
sig { params(marketing_create_template_request_dto: ::StackOne::Shared::MarketingCreateTemplateRequestDto, x_account_id: ::String).returns(::StackOne::Operations::MarketingCreateOmniChannelTemplateResponse) }
|
176
|
-
def create_omni_channel_template(marketing_create_template_request_dto, x_account_id)
|
376
|
+
sig { params(marketing_create_template_request_dto: ::StackOne::Shared::MarketingCreateTemplateRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingCreateOmniChannelTemplateResponse) }
|
377
|
+
def create_omni_channel_template(marketing_create_template_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
177
378
|
# create_omni_channel_template - Create Omni-Channel Template
|
178
379
|
#
|
179
380
|
# @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
@@ -189,19 +390,85 @@ module StackOne
|
|
189
390
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_template_request_dto, :json)
|
190
391
|
headers['content-type'] = req_content_type
|
191
392
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
393
|
+
|
394
|
+
if form
|
395
|
+
body = Utils.encode_form(form)
|
396
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
397
|
+
body = URI.encode_www_form(data)
|
398
|
+
else
|
399
|
+
body = data
|
400
|
+
end
|
192
401
|
headers['Accept'] = 'application/json'
|
193
402
|
headers['user-agent'] = @sdk_configuration.user_agent
|
403
|
+
retries ||= @sdk_configuration.retry_config
|
404
|
+
retries ||= Utils::RetryConfig.new(
|
405
|
+
backoff: Utils::BackoffStrategy.new(
|
406
|
+
exponent: 1.5,
|
407
|
+
initial_interval: 500,
|
408
|
+
max_elapsed_time: 3_600_000,
|
409
|
+
max_interval: 60_000
|
410
|
+
),
|
411
|
+
retry_connection_errors: true,
|
412
|
+
strategy: 'backoff'
|
413
|
+
)
|
414
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
415
|
+
retry_options[:retry_statuses] = [429, 408]
|
194
416
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
417
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
418
|
+
|
419
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
420
|
+
timeout ||= @sdk_configuration.timeout
|
421
|
+
|
422
|
+
connection = @sdk_configuration.client.dup
|
423
|
+
connection.request :retry, retry_options
|
424
|
+
|
425
|
+
hook_ctx = SDKHooks::HookContext.new(
|
426
|
+
base_url: base_url,
|
427
|
+
oauth2_scopes: [],
|
428
|
+
operation_id: 'marketing_create_omni_channel_template',
|
429
|
+
security_source: @sdk_configuration.security_source
|
430
|
+
)
|
431
|
+
|
432
|
+
error = T.let(nil, T.nilable(StandardError))
|
433
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
434
|
+
|
435
|
+
begin
|
436
|
+
r = connection.post(url) do |req|
|
437
|
+
req.body = body
|
438
|
+
req.headers.merge!(headers)
|
439
|
+
req.options.timeout = timeout unless timeout.nil?
|
440
|
+
Utils.configure_request_security(req, security)
|
441
|
+
|
442
|
+
@sdk_configuration.hooks.before_request(
|
443
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
444
|
+
hook_ctx: hook_ctx
|
445
|
+
),
|
446
|
+
request: req
|
447
|
+
)
|
448
|
+
end
|
449
|
+
rescue StandardError => e
|
450
|
+
error = e
|
451
|
+
ensure
|
452
|
+
if r.nil? || Utils.error_status?(r.status)
|
453
|
+
r = @sdk_configuration.hooks.after_error(
|
454
|
+
error: error,
|
455
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
456
|
+
hook_ctx: hook_ctx
|
457
|
+
),
|
458
|
+
response: r
|
459
|
+
)
|
203
460
|
else
|
204
|
-
|
461
|
+
r = @sdk_configuration.hooks.after_success(
|
462
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
463
|
+
hook_ctx: hook_ctx
|
464
|
+
),
|
465
|
+
response: r
|
466
|
+
)
|
467
|
+
end
|
468
|
+
|
469
|
+
if r.nil?
|
470
|
+
raise error if !error.nil?
|
471
|
+
raise 'no response'
|
205
472
|
end
|
206
473
|
end
|
207
474
|
|
@@ -225,8 +492,8 @@ module StackOne
|
|
225
492
|
end
|
226
493
|
|
227
494
|
|
228
|
-
sig { params(marketing_create_push_template_request_dto: ::StackOne::Shared::MarketingCreatePushTemplateRequestDto, x_account_id: ::String).returns(::StackOne::Operations::MarketingCreatePushTemplateResponse) }
|
229
|
-
def create_push_template(marketing_create_push_template_request_dto, x_account_id)
|
495
|
+
sig { params(marketing_create_push_template_request_dto: ::StackOne::Shared::MarketingCreatePushTemplateRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingCreatePushTemplateResponse) }
|
496
|
+
def create_push_template(marketing_create_push_template_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
230
497
|
# create_push_template - Create Push Template
|
231
498
|
request = ::StackOne::Operations::MarketingCreatePushTemplateRequest.new(
|
232
499
|
|
@@ -240,19 +507,85 @@ module StackOne
|
|
240
507
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_push_template_request_dto, :json)
|
241
508
|
headers['content-type'] = req_content_type
|
242
509
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
510
|
+
|
511
|
+
if form
|
512
|
+
body = Utils.encode_form(form)
|
513
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
514
|
+
body = URI.encode_www_form(data)
|
515
|
+
else
|
516
|
+
body = data
|
517
|
+
end
|
243
518
|
headers['Accept'] = 'application/json'
|
244
519
|
headers['user-agent'] = @sdk_configuration.user_agent
|
520
|
+
retries ||= @sdk_configuration.retry_config
|
521
|
+
retries ||= Utils::RetryConfig.new(
|
522
|
+
backoff: Utils::BackoffStrategy.new(
|
523
|
+
exponent: 1.5,
|
524
|
+
initial_interval: 500,
|
525
|
+
max_elapsed_time: 3_600_000,
|
526
|
+
max_interval: 60_000
|
527
|
+
),
|
528
|
+
retry_connection_errors: true,
|
529
|
+
strategy: 'backoff'
|
530
|
+
)
|
531
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
532
|
+
retry_options[:retry_statuses] = [429, 408]
|
533
|
+
|
534
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
535
|
+
|
536
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
537
|
+
timeout ||= @sdk_configuration.timeout
|
538
|
+
|
539
|
+
connection = @sdk_configuration.client.dup
|
540
|
+
connection.request :retry, retry_options
|
245
541
|
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
542
|
+
hook_ctx = SDKHooks::HookContext.new(
|
543
|
+
base_url: base_url,
|
544
|
+
oauth2_scopes: [],
|
545
|
+
operation_id: 'marketing_create_push_template',
|
546
|
+
security_source: @sdk_configuration.security_source
|
547
|
+
)
|
548
|
+
|
549
|
+
error = T.let(nil, T.nilable(StandardError))
|
550
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
551
|
+
|
552
|
+
begin
|
553
|
+
r = connection.post(url) do |req|
|
554
|
+
req.body = body
|
555
|
+
req.headers.merge!(headers)
|
556
|
+
req.options.timeout = timeout unless timeout.nil?
|
557
|
+
Utils.configure_request_security(req, security)
|
558
|
+
|
559
|
+
@sdk_configuration.hooks.before_request(
|
560
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
561
|
+
hook_ctx: hook_ctx
|
562
|
+
),
|
563
|
+
request: req
|
564
|
+
)
|
565
|
+
end
|
566
|
+
rescue StandardError => e
|
567
|
+
error = e
|
568
|
+
ensure
|
569
|
+
if r.nil? || Utils.error_status?(r.status)
|
570
|
+
r = @sdk_configuration.hooks.after_error(
|
571
|
+
error: error,
|
572
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
573
|
+
hook_ctx: hook_ctx
|
574
|
+
),
|
575
|
+
response: r
|
576
|
+
)
|
254
577
|
else
|
255
|
-
|
578
|
+
r = @sdk_configuration.hooks.after_success(
|
579
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
580
|
+
hook_ctx: hook_ctx
|
581
|
+
),
|
582
|
+
response: r
|
583
|
+
)
|
584
|
+
end
|
585
|
+
|
586
|
+
if r.nil?
|
587
|
+
raise error if !error.nil?
|
588
|
+
raise 'no response'
|
256
589
|
end
|
257
590
|
end
|
258
591
|
|
@@ -276,8 +609,8 @@ module StackOne
|
|
276
609
|
end
|
277
610
|
|
278
611
|
|
279
|
-
sig { params(marketing_create_sms_template_request_dto: ::StackOne::Shared::MarketingCreateSmsTemplateRequestDto, x_account_id: ::String).returns(::StackOne::Operations::MarketingCreateSmsTemplateResponse) }
|
280
|
-
def create_sms_template(marketing_create_sms_template_request_dto, x_account_id)
|
612
|
+
sig { params(marketing_create_sms_template_request_dto: ::StackOne::Shared::MarketingCreateSmsTemplateRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingCreateSmsTemplateResponse) }
|
613
|
+
def create_sms_template(marketing_create_sms_template_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
281
614
|
# create_sms_template - Create SMS Template
|
282
615
|
request = ::StackOne::Operations::MarketingCreateSmsTemplateRequest.new(
|
283
616
|
|
@@ -291,19 +624,85 @@ module StackOne
|
|
291
624
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_sms_template_request_dto, :json)
|
292
625
|
headers['content-type'] = req_content_type
|
293
626
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
627
|
+
|
628
|
+
if form
|
629
|
+
body = Utils.encode_form(form)
|
630
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
631
|
+
body = URI.encode_www_form(data)
|
632
|
+
else
|
633
|
+
body = data
|
634
|
+
end
|
294
635
|
headers['Accept'] = 'application/json'
|
295
636
|
headers['user-agent'] = @sdk_configuration.user_agent
|
637
|
+
retries ||= @sdk_configuration.retry_config
|
638
|
+
retries ||= Utils::RetryConfig.new(
|
639
|
+
backoff: Utils::BackoffStrategy.new(
|
640
|
+
exponent: 1.5,
|
641
|
+
initial_interval: 500,
|
642
|
+
max_elapsed_time: 3_600_000,
|
643
|
+
max_interval: 60_000
|
644
|
+
),
|
645
|
+
retry_connection_errors: true,
|
646
|
+
strategy: 'backoff'
|
647
|
+
)
|
648
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
649
|
+
retry_options[:retry_statuses] = [429, 408]
|
650
|
+
|
651
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
652
|
+
|
653
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
654
|
+
timeout ||= @sdk_configuration.timeout
|
655
|
+
|
656
|
+
connection = @sdk_configuration.client.dup
|
657
|
+
connection.request :retry, retry_options
|
658
|
+
|
659
|
+
hook_ctx = SDKHooks::HookContext.new(
|
660
|
+
base_url: base_url,
|
661
|
+
oauth2_scopes: [],
|
662
|
+
operation_id: 'marketing_create_sms_template',
|
663
|
+
security_source: @sdk_configuration.security_source
|
664
|
+
)
|
296
665
|
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
req.body =
|
303
|
-
|
304
|
-
req.
|
666
|
+
error = T.let(nil, T.nilable(StandardError))
|
667
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
668
|
+
|
669
|
+
begin
|
670
|
+
r = connection.post(url) do |req|
|
671
|
+
req.body = body
|
672
|
+
req.headers.merge!(headers)
|
673
|
+
req.options.timeout = timeout unless timeout.nil?
|
674
|
+
Utils.configure_request_security(req, security)
|
675
|
+
|
676
|
+
@sdk_configuration.hooks.before_request(
|
677
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
678
|
+
hook_ctx: hook_ctx
|
679
|
+
),
|
680
|
+
request: req
|
681
|
+
)
|
682
|
+
end
|
683
|
+
rescue StandardError => e
|
684
|
+
error = e
|
685
|
+
ensure
|
686
|
+
if r.nil? || Utils.error_status?(r.status)
|
687
|
+
r = @sdk_configuration.hooks.after_error(
|
688
|
+
error: error,
|
689
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
690
|
+
hook_ctx: hook_ctx
|
691
|
+
),
|
692
|
+
response: r
|
693
|
+
)
|
305
694
|
else
|
306
|
-
|
695
|
+
r = @sdk_configuration.hooks.after_success(
|
696
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
697
|
+
hook_ctx: hook_ctx
|
698
|
+
),
|
699
|
+
response: r
|
700
|
+
)
|
701
|
+
end
|
702
|
+
|
703
|
+
if r.nil?
|
704
|
+
raise error if !error.nil?
|
705
|
+
raise 'no response'
|
307
706
|
end
|
308
707
|
end
|
309
708
|
|
@@ -327,8 +726,8 @@ module StackOne
|
|
327
726
|
end
|
328
727
|
|
329
728
|
|
330
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetCampaignRequest)).returns(::StackOne::Operations::MarketingGetCampaignResponse) }
|
331
|
-
def get_campaign(request)
|
729
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetCampaignRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetCampaignResponse) }
|
730
|
+
def get_campaign(request, retries = nil, timeout_ms = nil)
|
332
731
|
# get_campaign - Get campaign
|
333
732
|
url, params = @sdk_configuration.get_server_details
|
334
733
|
base_url = Utils.template_url(url, params)
|
@@ -342,12 +741,76 @@ module StackOne
|
|
342
741
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingGetCampaignRequest, request)
|
343
742
|
headers['Accept'] = 'application/json'
|
344
743
|
headers['user-agent'] = @sdk_configuration.user_agent
|
744
|
+
retries ||= @sdk_configuration.retry_config
|
745
|
+
retries ||= Utils::RetryConfig.new(
|
746
|
+
backoff: Utils::BackoffStrategy.new(
|
747
|
+
exponent: 1.5,
|
748
|
+
initial_interval: 500,
|
749
|
+
max_elapsed_time: 3_600_000,
|
750
|
+
max_interval: 60_000
|
751
|
+
),
|
752
|
+
retry_connection_errors: true,
|
753
|
+
strategy: 'backoff'
|
754
|
+
)
|
755
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
756
|
+
retry_options[:retry_statuses] = [429, 408]
|
757
|
+
|
758
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
759
|
+
|
760
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
761
|
+
timeout ||= @sdk_configuration.timeout
|
762
|
+
|
763
|
+
connection = @sdk_configuration.client.dup
|
764
|
+
connection.request :retry, retry_options
|
765
|
+
|
766
|
+
hook_ctx = SDKHooks::HookContext.new(
|
767
|
+
base_url: base_url,
|
768
|
+
oauth2_scopes: [],
|
769
|
+
operation_id: 'marketing_get_campaign',
|
770
|
+
security_source: @sdk_configuration.security_source
|
771
|
+
)
|
345
772
|
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
773
|
+
error = T.let(nil, T.nilable(StandardError))
|
774
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
775
|
+
|
776
|
+
begin
|
777
|
+
r = connection.get(url) do |req|
|
778
|
+
req.headers.merge!(headers)
|
779
|
+
req.options.timeout = timeout unless timeout.nil?
|
780
|
+
req.params = query_params
|
781
|
+
Utils.configure_request_security(req, security)
|
782
|
+
|
783
|
+
@sdk_configuration.hooks.before_request(
|
784
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
785
|
+
hook_ctx: hook_ctx
|
786
|
+
),
|
787
|
+
request: req
|
788
|
+
)
|
789
|
+
end
|
790
|
+
rescue StandardError => e
|
791
|
+
error = e
|
792
|
+
ensure
|
793
|
+
if r.nil? || Utils.error_status?(r.status)
|
794
|
+
r = @sdk_configuration.hooks.after_error(
|
795
|
+
error: error,
|
796
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
797
|
+
hook_ctx: hook_ctx
|
798
|
+
),
|
799
|
+
response: r
|
800
|
+
)
|
801
|
+
else
|
802
|
+
r = @sdk_configuration.hooks.after_success(
|
803
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
804
|
+
hook_ctx: hook_ctx
|
805
|
+
),
|
806
|
+
response: r
|
807
|
+
)
|
808
|
+
end
|
809
|
+
|
810
|
+
if r.nil?
|
811
|
+
raise error if !error.nil?
|
812
|
+
raise 'no response'
|
813
|
+
end
|
351
814
|
end
|
352
815
|
|
353
816
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -370,8 +833,8 @@ module StackOne
|
|
370
833
|
end
|
371
834
|
|
372
835
|
|
373
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetContentBlockRequest)).returns(::StackOne::Operations::MarketingGetContentBlockResponse) }
|
374
|
-
def get_content_block(request)
|
836
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetContentBlockRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetContentBlockResponse) }
|
837
|
+
def get_content_block(request, retries = nil, timeout_ms = nil)
|
375
838
|
# get_content_block - Get Content Blocks
|
376
839
|
url, params = @sdk_configuration.get_server_details
|
377
840
|
base_url = Utils.template_url(url, params)
|
@@ -385,12 +848,76 @@ module StackOne
|
|
385
848
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingGetContentBlockRequest, request)
|
386
849
|
headers['Accept'] = 'application/json'
|
387
850
|
headers['user-agent'] = @sdk_configuration.user_agent
|
851
|
+
retries ||= @sdk_configuration.retry_config
|
852
|
+
retries ||= Utils::RetryConfig.new(
|
853
|
+
backoff: Utils::BackoffStrategy.new(
|
854
|
+
exponent: 1.5,
|
855
|
+
initial_interval: 500,
|
856
|
+
max_elapsed_time: 3_600_000,
|
857
|
+
max_interval: 60_000
|
858
|
+
),
|
859
|
+
retry_connection_errors: true,
|
860
|
+
strategy: 'backoff'
|
861
|
+
)
|
862
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
863
|
+
retry_options[:retry_statuses] = [429, 408]
|
864
|
+
|
865
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
866
|
+
|
867
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
868
|
+
timeout ||= @sdk_configuration.timeout
|
869
|
+
|
870
|
+
connection = @sdk_configuration.client.dup
|
871
|
+
connection.request :retry, retry_options
|
388
872
|
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
873
|
+
hook_ctx = SDKHooks::HookContext.new(
|
874
|
+
base_url: base_url,
|
875
|
+
oauth2_scopes: [],
|
876
|
+
operation_id: 'marketing_get_content_block',
|
877
|
+
security_source: @sdk_configuration.security_source
|
878
|
+
)
|
879
|
+
|
880
|
+
error = T.let(nil, T.nilable(StandardError))
|
881
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
882
|
+
|
883
|
+
begin
|
884
|
+
r = connection.get(url) do |req|
|
885
|
+
req.headers.merge!(headers)
|
886
|
+
req.options.timeout = timeout unless timeout.nil?
|
887
|
+
req.params = query_params
|
888
|
+
Utils.configure_request_security(req, security)
|
889
|
+
|
890
|
+
@sdk_configuration.hooks.before_request(
|
891
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
892
|
+
hook_ctx: hook_ctx
|
893
|
+
),
|
894
|
+
request: req
|
895
|
+
)
|
896
|
+
end
|
897
|
+
rescue StandardError => e
|
898
|
+
error = e
|
899
|
+
ensure
|
900
|
+
if r.nil? || Utils.error_status?(r.status)
|
901
|
+
r = @sdk_configuration.hooks.after_error(
|
902
|
+
error: error,
|
903
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
904
|
+
hook_ctx: hook_ctx
|
905
|
+
),
|
906
|
+
response: r
|
907
|
+
)
|
908
|
+
else
|
909
|
+
r = @sdk_configuration.hooks.after_success(
|
910
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
911
|
+
hook_ctx: hook_ctx
|
912
|
+
),
|
913
|
+
response: r
|
914
|
+
)
|
915
|
+
end
|
916
|
+
|
917
|
+
if r.nil?
|
918
|
+
raise error if !error.nil?
|
919
|
+
raise 'no response'
|
920
|
+
end
|
394
921
|
end
|
395
922
|
|
396
923
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -413,8 +940,8 @@ module StackOne
|
|
413
940
|
end
|
414
941
|
|
415
942
|
|
416
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetEmailTemplateRequest)).returns(::StackOne::Operations::MarketingGetEmailTemplateResponse) }
|
417
|
-
def get_email_template(request)
|
943
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetEmailTemplateRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetEmailTemplateResponse) }
|
944
|
+
def get_email_template(request, retries = nil, timeout_ms = nil)
|
418
945
|
# get_email_template - Get Email Templates
|
419
946
|
url, params = @sdk_configuration.get_server_details
|
420
947
|
base_url = Utils.template_url(url, params)
|
@@ -428,12 +955,76 @@ module StackOne
|
|
428
955
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingGetEmailTemplateRequest, request)
|
429
956
|
headers['Accept'] = 'application/json'
|
430
957
|
headers['user-agent'] = @sdk_configuration.user_agent
|
958
|
+
retries ||= @sdk_configuration.retry_config
|
959
|
+
retries ||= Utils::RetryConfig.new(
|
960
|
+
backoff: Utils::BackoffStrategy.new(
|
961
|
+
exponent: 1.5,
|
962
|
+
initial_interval: 500,
|
963
|
+
max_elapsed_time: 3_600_000,
|
964
|
+
max_interval: 60_000
|
965
|
+
),
|
966
|
+
retry_connection_errors: true,
|
967
|
+
strategy: 'backoff'
|
968
|
+
)
|
969
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
970
|
+
retry_options[:retry_statuses] = [429, 408]
|
971
|
+
|
972
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
431
973
|
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
974
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
975
|
+
timeout ||= @sdk_configuration.timeout
|
976
|
+
|
977
|
+
connection = @sdk_configuration.client.dup
|
978
|
+
connection.request :retry, retry_options
|
979
|
+
|
980
|
+
hook_ctx = SDKHooks::HookContext.new(
|
981
|
+
base_url: base_url,
|
982
|
+
oauth2_scopes: [],
|
983
|
+
operation_id: 'marketing_get_email_template',
|
984
|
+
security_source: @sdk_configuration.security_source
|
985
|
+
)
|
986
|
+
|
987
|
+
error = T.let(nil, T.nilable(StandardError))
|
988
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
989
|
+
|
990
|
+
begin
|
991
|
+
r = connection.get(url) do |req|
|
992
|
+
req.headers.merge!(headers)
|
993
|
+
req.options.timeout = timeout unless timeout.nil?
|
994
|
+
req.params = query_params
|
995
|
+
Utils.configure_request_security(req, security)
|
996
|
+
|
997
|
+
@sdk_configuration.hooks.before_request(
|
998
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
999
|
+
hook_ctx: hook_ctx
|
1000
|
+
),
|
1001
|
+
request: req
|
1002
|
+
)
|
1003
|
+
end
|
1004
|
+
rescue StandardError => e
|
1005
|
+
error = e
|
1006
|
+
ensure
|
1007
|
+
if r.nil? || Utils.error_status?(r.status)
|
1008
|
+
r = @sdk_configuration.hooks.after_error(
|
1009
|
+
error: error,
|
1010
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1011
|
+
hook_ctx: hook_ctx
|
1012
|
+
),
|
1013
|
+
response: r
|
1014
|
+
)
|
1015
|
+
else
|
1016
|
+
r = @sdk_configuration.hooks.after_success(
|
1017
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1018
|
+
hook_ctx: hook_ctx
|
1019
|
+
),
|
1020
|
+
response: r
|
1021
|
+
)
|
1022
|
+
end
|
1023
|
+
|
1024
|
+
if r.nil?
|
1025
|
+
raise error if !error.nil?
|
1026
|
+
raise 'no response'
|
1027
|
+
end
|
437
1028
|
end
|
438
1029
|
|
439
1030
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -456,8 +1047,8 @@ module StackOne
|
|
456
1047
|
end
|
457
1048
|
|
458
1049
|
|
459
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetInAppTemplateRequest)).returns(::StackOne::Operations::MarketingGetInAppTemplateResponse) }
|
460
|
-
def get_in_app_template(request)
|
1050
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetInAppTemplateRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetInAppTemplateResponse) }
|
1051
|
+
def get_in_app_template(request, retries = nil, timeout_ms = nil)
|
461
1052
|
# get_in_app_template - Get In-App Template
|
462
1053
|
url, params = @sdk_configuration.get_server_details
|
463
1054
|
base_url = Utils.template_url(url, params)
|
@@ -471,12 +1062,76 @@ module StackOne
|
|
471
1062
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingGetInAppTemplateRequest, request)
|
472
1063
|
headers['Accept'] = 'application/json'
|
473
1064
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1065
|
+
retries ||= @sdk_configuration.retry_config
|
1066
|
+
retries ||= Utils::RetryConfig.new(
|
1067
|
+
backoff: Utils::BackoffStrategy.new(
|
1068
|
+
exponent: 1.5,
|
1069
|
+
initial_interval: 500,
|
1070
|
+
max_elapsed_time: 3_600_000,
|
1071
|
+
max_interval: 60_000
|
1072
|
+
),
|
1073
|
+
retry_connection_errors: true,
|
1074
|
+
strategy: 'backoff'
|
1075
|
+
)
|
1076
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1077
|
+
retry_options[:retry_statuses] = [429, 408]
|
1078
|
+
|
1079
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1080
|
+
|
1081
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1082
|
+
timeout ||= @sdk_configuration.timeout
|
474
1083
|
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
1084
|
+
connection = @sdk_configuration.client.dup
|
1085
|
+
connection.request :retry, retry_options
|
1086
|
+
|
1087
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1088
|
+
base_url: base_url,
|
1089
|
+
oauth2_scopes: [],
|
1090
|
+
operation_id: 'marketing_get_in_app_template',
|
1091
|
+
security_source: @sdk_configuration.security_source
|
1092
|
+
)
|
1093
|
+
|
1094
|
+
error = T.let(nil, T.nilable(StandardError))
|
1095
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1096
|
+
|
1097
|
+
begin
|
1098
|
+
r = connection.get(url) do |req|
|
1099
|
+
req.headers.merge!(headers)
|
1100
|
+
req.options.timeout = timeout unless timeout.nil?
|
1101
|
+
req.params = query_params
|
1102
|
+
Utils.configure_request_security(req, security)
|
1103
|
+
|
1104
|
+
@sdk_configuration.hooks.before_request(
|
1105
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1106
|
+
hook_ctx: hook_ctx
|
1107
|
+
),
|
1108
|
+
request: req
|
1109
|
+
)
|
1110
|
+
end
|
1111
|
+
rescue StandardError => e
|
1112
|
+
error = e
|
1113
|
+
ensure
|
1114
|
+
if r.nil? || Utils.error_status?(r.status)
|
1115
|
+
r = @sdk_configuration.hooks.after_error(
|
1116
|
+
error: error,
|
1117
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1118
|
+
hook_ctx: hook_ctx
|
1119
|
+
),
|
1120
|
+
response: r
|
1121
|
+
)
|
1122
|
+
else
|
1123
|
+
r = @sdk_configuration.hooks.after_success(
|
1124
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1125
|
+
hook_ctx: hook_ctx
|
1126
|
+
),
|
1127
|
+
response: r
|
1128
|
+
)
|
1129
|
+
end
|
1130
|
+
|
1131
|
+
if r.nil?
|
1132
|
+
raise error if !error.nil?
|
1133
|
+
raise 'no response'
|
1134
|
+
end
|
480
1135
|
end
|
481
1136
|
|
482
1137
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -499,8 +1154,8 @@ module StackOne
|
|
499
1154
|
end
|
500
1155
|
|
501
1156
|
|
502
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetOmniChannelTemplateRequest)).returns(::StackOne::Operations::MarketingGetOmniChannelTemplateResponse) }
|
503
|
-
def get_omni_channel_template(request)
|
1157
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetOmniChannelTemplateRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetOmniChannelTemplateResponse) }
|
1158
|
+
def get_omni_channel_template(request, retries = nil, timeout_ms = nil)
|
504
1159
|
# get_omni_channel_template - Get Omni-Channel Template
|
505
1160
|
#
|
506
1161
|
# @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
@@ -516,12 +1171,76 @@ module StackOne
|
|
516
1171
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingGetOmniChannelTemplateRequest, request)
|
517
1172
|
headers['Accept'] = 'application/json'
|
518
1173
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1174
|
+
retries ||= @sdk_configuration.retry_config
|
1175
|
+
retries ||= Utils::RetryConfig.new(
|
1176
|
+
backoff: Utils::BackoffStrategy.new(
|
1177
|
+
exponent: 1.5,
|
1178
|
+
initial_interval: 500,
|
1179
|
+
max_elapsed_time: 3_600_000,
|
1180
|
+
max_interval: 60_000
|
1181
|
+
),
|
1182
|
+
retry_connection_errors: true,
|
1183
|
+
strategy: 'backoff'
|
1184
|
+
)
|
1185
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1186
|
+
retry_options[:retry_statuses] = [429, 408]
|
1187
|
+
|
1188
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1189
|
+
|
1190
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1191
|
+
timeout ||= @sdk_configuration.timeout
|
519
1192
|
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
1193
|
+
connection = @sdk_configuration.client.dup
|
1194
|
+
connection.request :retry, retry_options
|
1195
|
+
|
1196
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1197
|
+
base_url: base_url,
|
1198
|
+
oauth2_scopes: [],
|
1199
|
+
operation_id: 'marketing_get_omni_channel_template',
|
1200
|
+
security_source: @sdk_configuration.security_source
|
1201
|
+
)
|
1202
|
+
|
1203
|
+
error = T.let(nil, T.nilable(StandardError))
|
1204
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1205
|
+
|
1206
|
+
begin
|
1207
|
+
r = connection.get(url) do |req|
|
1208
|
+
req.headers.merge!(headers)
|
1209
|
+
req.options.timeout = timeout unless timeout.nil?
|
1210
|
+
req.params = query_params
|
1211
|
+
Utils.configure_request_security(req, security)
|
1212
|
+
|
1213
|
+
@sdk_configuration.hooks.before_request(
|
1214
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1215
|
+
hook_ctx: hook_ctx
|
1216
|
+
),
|
1217
|
+
request: req
|
1218
|
+
)
|
1219
|
+
end
|
1220
|
+
rescue StandardError => e
|
1221
|
+
error = e
|
1222
|
+
ensure
|
1223
|
+
if r.nil? || Utils.error_status?(r.status)
|
1224
|
+
r = @sdk_configuration.hooks.after_error(
|
1225
|
+
error: error,
|
1226
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1227
|
+
hook_ctx: hook_ctx
|
1228
|
+
),
|
1229
|
+
response: r
|
1230
|
+
)
|
1231
|
+
else
|
1232
|
+
r = @sdk_configuration.hooks.after_success(
|
1233
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1234
|
+
hook_ctx: hook_ctx
|
1235
|
+
),
|
1236
|
+
response: r
|
1237
|
+
)
|
1238
|
+
end
|
1239
|
+
|
1240
|
+
if r.nil?
|
1241
|
+
raise error if !error.nil?
|
1242
|
+
raise 'no response'
|
1243
|
+
end
|
525
1244
|
end
|
526
1245
|
|
527
1246
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -544,8 +1263,8 @@ module StackOne
|
|
544
1263
|
end
|
545
1264
|
|
546
1265
|
|
547
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetPushTemplateRequest)).returns(::StackOne::Operations::MarketingGetPushTemplateResponse) }
|
548
|
-
def get_push_template(request)
|
1266
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetPushTemplateRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetPushTemplateResponse) }
|
1267
|
+
def get_push_template(request, retries = nil, timeout_ms = nil)
|
549
1268
|
# get_push_template - Get Push Template
|
550
1269
|
url, params = @sdk_configuration.get_server_details
|
551
1270
|
base_url = Utils.template_url(url, params)
|
@@ -559,12 +1278,76 @@ module StackOne
|
|
559
1278
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingGetPushTemplateRequest, request)
|
560
1279
|
headers['Accept'] = 'application/json'
|
561
1280
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1281
|
+
retries ||= @sdk_configuration.retry_config
|
1282
|
+
retries ||= Utils::RetryConfig.new(
|
1283
|
+
backoff: Utils::BackoffStrategy.new(
|
1284
|
+
exponent: 1.5,
|
1285
|
+
initial_interval: 500,
|
1286
|
+
max_elapsed_time: 3_600_000,
|
1287
|
+
max_interval: 60_000
|
1288
|
+
),
|
1289
|
+
retry_connection_errors: true,
|
1290
|
+
strategy: 'backoff'
|
1291
|
+
)
|
1292
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1293
|
+
retry_options[:retry_statuses] = [429, 408]
|
562
1294
|
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
1295
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1296
|
+
|
1297
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1298
|
+
timeout ||= @sdk_configuration.timeout
|
1299
|
+
|
1300
|
+
connection = @sdk_configuration.client.dup
|
1301
|
+
connection.request :retry, retry_options
|
1302
|
+
|
1303
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1304
|
+
base_url: base_url,
|
1305
|
+
oauth2_scopes: [],
|
1306
|
+
operation_id: 'marketing_get_push_template',
|
1307
|
+
security_source: @sdk_configuration.security_source
|
1308
|
+
)
|
1309
|
+
|
1310
|
+
error = T.let(nil, T.nilable(StandardError))
|
1311
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1312
|
+
|
1313
|
+
begin
|
1314
|
+
r = connection.get(url) do |req|
|
1315
|
+
req.headers.merge!(headers)
|
1316
|
+
req.options.timeout = timeout unless timeout.nil?
|
1317
|
+
req.params = query_params
|
1318
|
+
Utils.configure_request_security(req, security)
|
1319
|
+
|
1320
|
+
@sdk_configuration.hooks.before_request(
|
1321
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1322
|
+
hook_ctx: hook_ctx
|
1323
|
+
),
|
1324
|
+
request: req
|
1325
|
+
)
|
1326
|
+
end
|
1327
|
+
rescue StandardError => e
|
1328
|
+
error = e
|
1329
|
+
ensure
|
1330
|
+
if r.nil? || Utils.error_status?(r.status)
|
1331
|
+
r = @sdk_configuration.hooks.after_error(
|
1332
|
+
error: error,
|
1333
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1334
|
+
hook_ctx: hook_ctx
|
1335
|
+
),
|
1336
|
+
response: r
|
1337
|
+
)
|
1338
|
+
else
|
1339
|
+
r = @sdk_configuration.hooks.after_success(
|
1340
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1341
|
+
hook_ctx: hook_ctx
|
1342
|
+
),
|
1343
|
+
response: r
|
1344
|
+
)
|
1345
|
+
end
|
1346
|
+
|
1347
|
+
if r.nil?
|
1348
|
+
raise error if !error.nil?
|
1349
|
+
raise 'no response'
|
1350
|
+
end
|
568
1351
|
end
|
569
1352
|
|
570
1353
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -587,8 +1370,8 @@ module StackOne
|
|
587
1370
|
end
|
588
1371
|
|
589
1372
|
|
590
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetSmsTemplateRequest)).returns(::StackOne::Operations::MarketingGetSmsTemplateResponse) }
|
591
|
-
def get_sms_template(request)
|
1373
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetSmsTemplateRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetSmsTemplateResponse) }
|
1374
|
+
def get_sms_template(request, retries = nil, timeout_ms = nil)
|
592
1375
|
# get_sms_template - Get SMS Template
|
593
1376
|
url, params = @sdk_configuration.get_server_details
|
594
1377
|
base_url = Utils.template_url(url, params)
|
@@ -602,12 +1385,76 @@ module StackOne
|
|
602
1385
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingGetSmsTemplateRequest, request)
|
603
1386
|
headers['Accept'] = 'application/json'
|
604
1387
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1388
|
+
retries ||= @sdk_configuration.retry_config
|
1389
|
+
retries ||= Utils::RetryConfig.new(
|
1390
|
+
backoff: Utils::BackoffStrategy.new(
|
1391
|
+
exponent: 1.5,
|
1392
|
+
initial_interval: 500,
|
1393
|
+
max_elapsed_time: 3_600_000,
|
1394
|
+
max_interval: 60_000
|
1395
|
+
),
|
1396
|
+
retry_connection_errors: true,
|
1397
|
+
strategy: 'backoff'
|
1398
|
+
)
|
1399
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1400
|
+
retry_options[:retry_statuses] = [429, 408]
|
1401
|
+
|
1402
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1403
|
+
|
1404
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1405
|
+
timeout ||= @sdk_configuration.timeout
|
605
1406
|
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
1407
|
+
connection = @sdk_configuration.client.dup
|
1408
|
+
connection.request :retry, retry_options
|
1409
|
+
|
1410
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1411
|
+
base_url: base_url,
|
1412
|
+
oauth2_scopes: [],
|
1413
|
+
operation_id: 'marketing_get_sms_template',
|
1414
|
+
security_source: @sdk_configuration.security_source
|
1415
|
+
)
|
1416
|
+
|
1417
|
+
error = T.let(nil, T.nilable(StandardError))
|
1418
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1419
|
+
|
1420
|
+
begin
|
1421
|
+
r = connection.get(url) do |req|
|
1422
|
+
req.headers.merge!(headers)
|
1423
|
+
req.options.timeout = timeout unless timeout.nil?
|
1424
|
+
req.params = query_params
|
1425
|
+
Utils.configure_request_security(req, security)
|
1426
|
+
|
1427
|
+
@sdk_configuration.hooks.before_request(
|
1428
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1429
|
+
hook_ctx: hook_ctx
|
1430
|
+
),
|
1431
|
+
request: req
|
1432
|
+
)
|
1433
|
+
end
|
1434
|
+
rescue StandardError => e
|
1435
|
+
error = e
|
1436
|
+
ensure
|
1437
|
+
if r.nil? || Utils.error_status?(r.status)
|
1438
|
+
r = @sdk_configuration.hooks.after_error(
|
1439
|
+
error: error,
|
1440
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1441
|
+
hook_ctx: hook_ctx
|
1442
|
+
),
|
1443
|
+
response: r
|
1444
|
+
)
|
1445
|
+
else
|
1446
|
+
r = @sdk_configuration.hooks.after_success(
|
1447
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1448
|
+
hook_ctx: hook_ctx
|
1449
|
+
),
|
1450
|
+
response: r
|
1451
|
+
)
|
1452
|
+
end
|
1453
|
+
|
1454
|
+
if r.nil?
|
1455
|
+
raise error if !error.nil?
|
1456
|
+
raise 'no response'
|
1457
|
+
end
|
611
1458
|
end
|
612
1459
|
|
613
1460
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -630,8 +1477,8 @@ module StackOne
|
|
630
1477
|
end
|
631
1478
|
|
632
1479
|
|
633
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListCampaignsRequest)).returns(::StackOne::Operations::MarketingListCampaignsResponse) }
|
634
|
-
def list_campaigns(request)
|
1480
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListCampaignsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListCampaignsResponse) }
|
1481
|
+
def list_campaigns(request, retries = nil, timeout_ms = nil)
|
635
1482
|
# list_campaigns - List campaigns
|
636
1483
|
url, params = @sdk_configuration.get_server_details
|
637
1484
|
base_url = Utils.template_url(url, params)
|
@@ -640,12 +1487,76 @@ module StackOne
|
|
640
1487
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingListCampaignsRequest, request)
|
641
1488
|
headers['Accept'] = 'application/json'
|
642
1489
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1490
|
+
retries ||= @sdk_configuration.retry_config
|
1491
|
+
retries ||= Utils::RetryConfig.new(
|
1492
|
+
backoff: Utils::BackoffStrategy.new(
|
1493
|
+
exponent: 1.5,
|
1494
|
+
initial_interval: 500,
|
1495
|
+
max_elapsed_time: 3_600_000,
|
1496
|
+
max_interval: 60_000
|
1497
|
+
),
|
1498
|
+
retry_connection_errors: true,
|
1499
|
+
strategy: 'backoff'
|
1500
|
+
)
|
1501
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1502
|
+
retry_options[:retry_statuses] = [429, 408]
|
1503
|
+
|
1504
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1505
|
+
|
1506
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1507
|
+
timeout ||= @sdk_configuration.timeout
|
643
1508
|
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
1509
|
+
connection = @sdk_configuration.client.dup
|
1510
|
+
connection.request :retry, retry_options
|
1511
|
+
|
1512
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1513
|
+
base_url: base_url,
|
1514
|
+
oauth2_scopes: [],
|
1515
|
+
operation_id: 'marketing_list_campaigns',
|
1516
|
+
security_source: @sdk_configuration.security_source
|
1517
|
+
)
|
1518
|
+
|
1519
|
+
error = T.let(nil, T.nilable(StandardError))
|
1520
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1521
|
+
|
1522
|
+
begin
|
1523
|
+
r = connection.get(url) do |req|
|
1524
|
+
req.headers.merge!(headers)
|
1525
|
+
req.options.timeout = timeout unless timeout.nil?
|
1526
|
+
req.params = query_params
|
1527
|
+
Utils.configure_request_security(req, security)
|
1528
|
+
|
1529
|
+
@sdk_configuration.hooks.before_request(
|
1530
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1531
|
+
hook_ctx: hook_ctx
|
1532
|
+
),
|
1533
|
+
request: req
|
1534
|
+
)
|
1535
|
+
end
|
1536
|
+
rescue StandardError => e
|
1537
|
+
error = e
|
1538
|
+
ensure
|
1539
|
+
if r.nil? || Utils.error_status?(r.status)
|
1540
|
+
r = @sdk_configuration.hooks.after_error(
|
1541
|
+
error: error,
|
1542
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1543
|
+
hook_ctx: hook_ctx
|
1544
|
+
),
|
1545
|
+
response: r
|
1546
|
+
)
|
1547
|
+
else
|
1548
|
+
r = @sdk_configuration.hooks.after_success(
|
1549
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1550
|
+
hook_ctx: hook_ctx
|
1551
|
+
),
|
1552
|
+
response: r
|
1553
|
+
)
|
1554
|
+
end
|
1555
|
+
|
1556
|
+
if r.nil?
|
1557
|
+
raise error if !error.nil?
|
1558
|
+
raise 'no response'
|
1559
|
+
end
|
649
1560
|
end
|
650
1561
|
|
651
1562
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -668,8 +1579,8 @@ module StackOne
|
|
668
1579
|
end
|
669
1580
|
|
670
1581
|
|
671
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListContentBlocksRequest)).returns(::StackOne::Operations::MarketingListContentBlocksResponse) }
|
672
|
-
def list_content_blocks(request)
|
1582
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListContentBlocksRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListContentBlocksResponse) }
|
1583
|
+
def list_content_blocks(request, retries = nil, timeout_ms = nil)
|
673
1584
|
# list_content_blocks - List Content Blocks
|
674
1585
|
url, params = @sdk_configuration.get_server_details
|
675
1586
|
base_url = Utils.template_url(url, params)
|
@@ -678,12 +1589,76 @@ module StackOne
|
|
678
1589
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingListContentBlocksRequest, request)
|
679
1590
|
headers['Accept'] = 'application/json'
|
680
1591
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1592
|
+
retries ||= @sdk_configuration.retry_config
|
1593
|
+
retries ||= Utils::RetryConfig.new(
|
1594
|
+
backoff: Utils::BackoffStrategy.new(
|
1595
|
+
exponent: 1.5,
|
1596
|
+
initial_interval: 500,
|
1597
|
+
max_elapsed_time: 3_600_000,
|
1598
|
+
max_interval: 60_000
|
1599
|
+
),
|
1600
|
+
retry_connection_errors: true,
|
1601
|
+
strategy: 'backoff'
|
1602
|
+
)
|
1603
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1604
|
+
retry_options[:retry_statuses] = [429, 408]
|
1605
|
+
|
1606
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1607
|
+
|
1608
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1609
|
+
timeout ||= @sdk_configuration.timeout
|
681
1610
|
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
1611
|
+
connection = @sdk_configuration.client.dup
|
1612
|
+
connection.request :retry, retry_options
|
1613
|
+
|
1614
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1615
|
+
base_url: base_url,
|
1616
|
+
oauth2_scopes: [],
|
1617
|
+
operation_id: 'marketing_list_content_blocks',
|
1618
|
+
security_source: @sdk_configuration.security_source
|
1619
|
+
)
|
1620
|
+
|
1621
|
+
error = T.let(nil, T.nilable(StandardError))
|
1622
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1623
|
+
|
1624
|
+
begin
|
1625
|
+
r = connection.get(url) do |req|
|
1626
|
+
req.headers.merge!(headers)
|
1627
|
+
req.options.timeout = timeout unless timeout.nil?
|
1628
|
+
req.params = query_params
|
1629
|
+
Utils.configure_request_security(req, security)
|
1630
|
+
|
1631
|
+
@sdk_configuration.hooks.before_request(
|
1632
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1633
|
+
hook_ctx: hook_ctx
|
1634
|
+
),
|
1635
|
+
request: req
|
1636
|
+
)
|
1637
|
+
end
|
1638
|
+
rescue StandardError => e
|
1639
|
+
error = e
|
1640
|
+
ensure
|
1641
|
+
if r.nil? || Utils.error_status?(r.status)
|
1642
|
+
r = @sdk_configuration.hooks.after_error(
|
1643
|
+
error: error,
|
1644
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1645
|
+
hook_ctx: hook_ctx
|
1646
|
+
),
|
1647
|
+
response: r
|
1648
|
+
)
|
1649
|
+
else
|
1650
|
+
r = @sdk_configuration.hooks.after_success(
|
1651
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1652
|
+
hook_ctx: hook_ctx
|
1653
|
+
),
|
1654
|
+
response: r
|
1655
|
+
)
|
1656
|
+
end
|
1657
|
+
|
1658
|
+
if r.nil?
|
1659
|
+
raise error if !error.nil?
|
1660
|
+
raise 'no response'
|
1661
|
+
end
|
687
1662
|
end
|
688
1663
|
|
689
1664
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -706,8 +1681,8 @@ module StackOne
|
|
706
1681
|
end
|
707
1682
|
|
708
1683
|
|
709
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListEmailTemplatesRequest)).returns(::StackOne::Operations::MarketingListEmailTemplatesResponse) }
|
710
|
-
def list_email_templates(request)
|
1684
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListEmailTemplatesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListEmailTemplatesResponse) }
|
1685
|
+
def list_email_templates(request, retries = nil, timeout_ms = nil)
|
711
1686
|
# list_email_templates - List Email Templates
|
712
1687
|
url, params = @sdk_configuration.get_server_details
|
713
1688
|
base_url = Utils.template_url(url, params)
|
@@ -716,12 +1691,76 @@ module StackOne
|
|
716
1691
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingListEmailTemplatesRequest, request)
|
717
1692
|
headers['Accept'] = 'application/json'
|
718
1693
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1694
|
+
retries ||= @sdk_configuration.retry_config
|
1695
|
+
retries ||= Utils::RetryConfig.new(
|
1696
|
+
backoff: Utils::BackoffStrategy.new(
|
1697
|
+
exponent: 1.5,
|
1698
|
+
initial_interval: 500,
|
1699
|
+
max_elapsed_time: 3_600_000,
|
1700
|
+
max_interval: 60_000
|
1701
|
+
),
|
1702
|
+
retry_connection_errors: true,
|
1703
|
+
strategy: 'backoff'
|
1704
|
+
)
|
1705
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1706
|
+
retry_options[:retry_statuses] = [429, 408]
|
1707
|
+
|
1708
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1709
|
+
|
1710
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1711
|
+
timeout ||= @sdk_configuration.timeout
|
1712
|
+
|
1713
|
+
connection = @sdk_configuration.client.dup
|
1714
|
+
connection.request :retry, retry_options
|
1715
|
+
|
1716
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1717
|
+
base_url: base_url,
|
1718
|
+
oauth2_scopes: [],
|
1719
|
+
operation_id: 'marketing_list_email_templates',
|
1720
|
+
security_source: @sdk_configuration.security_source
|
1721
|
+
)
|
719
1722
|
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
1723
|
+
error = T.let(nil, T.nilable(StandardError))
|
1724
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1725
|
+
|
1726
|
+
begin
|
1727
|
+
r = connection.get(url) do |req|
|
1728
|
+
req.headers.merge!(headers)
|
1729
|
+
req.options.timeout = timeout unless timeout.nil?
|
1730
|
+
req.params = query_params
|
1731
|
+
Utils.configure_request_security(req, security)
|
1732
|
+
|
1733
|
+
@sdk_configuration.hooks.before_request(
|
1734
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1735
|
+
hook_ctx: hook_ctx
|
1736
|
+
),
|
1737
|
+
request: req
|
1738
|
+
)
|
1739
|
+
end
|
1740
|
+
rescue StandardError => e
|
1741
|
+
error = e
|
1742
|
+
ensure
|
1743
|
+
if r.nil? || Utils.error_status?(r.status)
|
1744
|
+
r = @sdk_configuration.hooks.after_error(
|
1745
|
+
error: error,
|
1746
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1747
|
+
hook_ctx: hook_ctx
|
1748
|
+
),
|
1749
|
+
response: r
|
1750
|
+
)
|
1751
|
+
else
|
1752
|
+
r = @sdk_configuration.hooks.after_success(
|
1753
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1754
|
+
hook_ctx: hook_ctx
|
1755
|
+
),
|
1756
|
+
response: r
|
1757
|
+
)
|
1758
|
+
end
|
1759
|
+
|
1760
|
+
if r.nil?
|
1761
|
+
raise error if !error.nil?
|
1762
|
+
raise 'no response'
|
1763
|
+
end
|
725
1764
|
end
|
726
1765
|
|
727
1766
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -744,8 +1783,8 @@ module StackOne
|
|
744
1783
|
end
|
745
1784
|
|
746
1785
|
|
747
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListInAppTemplatesRequest)).returns(::StackOne::Operations::MarketingListInAppTemplatesResponse) }
|
748
|
-
def list_in_app_templates(request)
|
1786
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListInAppTemplatesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListInAppTemplatesResponse) }
|
1787
|
+
def list_in_app_templates(request, retries = nil, timeout_ms = nil)
|
749
1788
|
# list_in_app_templates - List In-App Templates
|
750
1789
|
url, params = @sdk_configuration.get_server_details
|
751
1790
|
base_url = Utils.template_url(url, params)
|
@@ -754,12 +1793,76 @@ module StackOne
|
|
754
1793
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingListInAppTemplatesRequest, request)
|
755
1794
|
headers['Accept'] = 'application/json'
|
756
1795
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1796
|
+
retries ||= @sdk_configuration.retry_config
|
1797
|
+
retries ||= Utils::RetryConfig.new(
|
1798
|
+
backoff: Utils::BackoffStrategy.new(
|
1799
|
+
exponent: 1.5,
|
1800
|
+
initial_interval: 500,
|
1801
|
+
max_elapsed_time: 3_600_000,
|
1802
|
+
max_interval: 60_000
|
1803
|
+
),
|
1804
|
+
retry_connection_errors: true,
|
1805
|
+
strategy: 'backoff'
|
1806
|
+
)
|
1807
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1808
|
+
retry_options[:retry_statuses] = [429, 408]
|
1809
|
+
|
1810
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1811
|
+
|
1812
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1813
|
+
timeout ||= @sdk_configuration.timeout
|
757
1814
|
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
1815
|
+
connection = @sdk_configuration.client.dup
|
1816
|
+
connection.request :retry, retry_options
|
1817
|
+
|
1818
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1819
|
+
base_url: base_url,
|
1820
|
+
oauth2_scopes: [],
|
1821
|
+
operation_id: 'marketing_list_in_app_templates',
|
1822
|
+
security_source: @sdk_configuration.security_source
|
1823
|
+
)
|
1824
|
+
|
1825
|
+
error = T.let(nil, T.nilable(StandardError))
|
1826
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1827
|
+
|
1828
|
+
begin
|
1829
|
+
r = connection.get(url) do |req|
|
1830
|
+
req.headers.merge!(headers)
|
1831
|
+
req.options.timeout = timeout unless timeout.nil?
|
1832
|
+
req.params = query_params
|
1833
|
+
Utils.configure_request_security(req, security)
|
1834
|
+
|
1835
|
+
@sdk_configuration.hooks.before_request(
|
1836
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1837
|
+
hook_ctx: hook_ctx
|
1838
|
+
),
|
1839
|
+
request: req
|
1840
|
+
)
|
1841
|
+
end
|
1842
|
+
rescue StandardError => e
|
1843
|
+
error = e
|
1844
|
+
ensure
|
1845
|
+
if r.nil? || Utils.error_status?(r.status)
|
1846
|
+
r = @sdk_configuration.hooks.after_error(
|
1847
|
+
error: error,
|
1848
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1849
|
+
hook_ctx: hook_ctx
|
1850
|
+
),
|
1851
|
+
response: r
|
1852
|
+
)
|
1853
|
+
else
|
1854
|
+
r = @sdk_configuration.hooks.after_success(
|
1855
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1856
|
+
hook_ctx: hook_ctx
|
1857
|
+
),
|
1858
|
+
response: r
|
1859
|
+
)
|
1860
|
+
end
|
1861
|
+
|
1862
|
+
if r.nil?
|
1863
|
+
raise error if !error.nil?
|
1864
|
+
raise 'no response'
|
1865
|
+
end
|
763
1866
|
end
|
764
1867
|
|
765
1868
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -782,8 +1885,8 @@ module StackOne
|
|
782
1885
|
end
|
783
1886
|
|
784
1887
|
|
785
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListOmniChannelTemplatesRequest)).returns(::StackOne::Operations::MarketingListOmniChannelTemplatesResponse) }
|
786
|
-
def list_omni_channel_templates(request)
|
1888
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListOmniChannelTemplatesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListOmniChannelTemplatesResponse) }
|
1889
|
+
def list_omni_channel_templates(request, retries = nil, timeout_ms = nil)
|
787
1890
|
# list_omni_channel_templates - List Omni-Channel Templates
|
788
1891
|
#
|
789
1892
|
# @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
@@ -794,12 +1897,76 @@ module StackOne
|
|
794
1897
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingListOmniChannelTemplatesRequest, request)
|
795
1898
|
headers['Accept'] = 'application/json'
|
796
1899
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1900
|
+
retries ||= @sdk_configuration.retry_config
|
1901
|
+
retries ||= Utils::RetryConfig.new(
|
1902
|
+
backoff: Utils::BackoffStrategy.new(
|
1903
|
+
exponent: 1.5,
|
1904
|
+
initial_interval: 500,
|
1905
|
+
max_elapsed_time: 3_600_000,
|
1906
|
+
max_interval: 60_000
|
1907
|
+
),
|
1908
|
+
retry_connection_errors: true,
|
1909
|
+
strategy: 'backoff'
|
1910
|
+
)
|
1911
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1912
|
+
retry_options[:retry_statuses] = [429, 408]
|
797
1913
|
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
1914
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1915
|
+
|
1916
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1917
|
+
timeout ||= @sdk_configuration.timeout
|
1918
|
+
|
1919
|
+
connection = @sdk_configuration.client.dup
|
1920
|
+
connection.request :retry, retry_options
|
1921
|
+
|
1922
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1923
|
+
base_url: base_url,
|
1924
|
+
oauth2_scopes: [],
|
1925
|
+
operation_id: 'marketing_list_omni_channel_templates',
|
1926
|
+
security_source: @sdk_configuration.security_source
|
1927
|
+
)
|
1928
|
+
|
1929
|
+
error = T.let(nil, T.nilable(StandardError))
|
1930
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1931
|
+
|
1932
|
+
begin
|
1933
|
+
r = connection.get(url) do |req|
|
1934
|
+
req.headers.merge!(headers)
|
1935
|
+
req.options.timeout = timeout unless timeout.nil?
|
1936
|
+
req.params = query_params
|
1937
|
+
Utils.configure_request_security(req, security)
|
1938
|
+
|
1939
|
+
@sdk_configuration.hooks.before_request(
|
1940
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1941
|
+
hook_ctx: hook_ctx
|
1942
|
+
),
|
1943
|
+
request: req
|
1944
|
+
)
|
1945
|
+
end
|
1946
|
+
rescue StandardError => e
|
1947
|
+
error = e
|
1948
|
+
ensure
|
1949
|
+
if r.nil? || Utils.error_status?(r.status)
|
1950
|
+
r = @sdk_configuration.hooks.after_error(
|
1951
|
+
error: error,
|
1952
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1953
|
+
hook_ctx: hook_ctx
|
1954
|
+
),
|
1955
|
+
response: r
|
1956
|
+
)
|
1957
|
+
else
|
1958
|
+
r = @sdk_configuration.hooks.after_success(
|
1959
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1960
|
+
hook_ctx: hook_ctx
|
1961
|
+
),
|
1962
|
+
response: r
|
1963
|
+
)
|
1964
|
+
end
|
1965
|
+
|
1966
|
+
if r.nil?
|
1967
|
+
raise error if !error.nil?
|
1968
|
+
raise 'no response'
|
1969
|
+
end
|
803
1970
|
end
|
804
1971
|
|
805
1972
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -822,8 +1989,8 @@ module StackOne
|
|
822
1989
|
end
|
823
1990
|
|
824
1991
|
|
825
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListPushTemplatesRequest)).returns(::StackOne::Operations::MarketingListPushTemplatesResponse) }
|
826
|
-
def list_push_templates(request)
|
1992
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListPushTemplatesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListPushTemplatesResponse) }
|
1993
|
+
def list_push_templates(request, retries = nil, timeout_ms = nil)
|
827
1994
|
# list_push_templates - List Push Templates
|
828
1995
|
url, params = @sdk_configuration.get_server_details
|
829
1996
|
base_url = Utils.template_url(url, params)
|
@@ -832,12 +1999,76 @@ module StackOne
|
|
832
1999
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingListPushTemplatesRequest, request)
|
833
2000
|
headers['Accept'] = 'application/json'
|
834
2001
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2002
|
+
retries ||= @sdk_configuration.retry_config
|
2003
|
+
retries ||= Utils::RetryConfig.new(
|
2004
|
+
backoff: Utils::BackoffStrategy.new(
|
2005
|
+
exponent: 1.5,
|
2006
|
+
initial_interval: 500,
|
2007
|
+
max_elapsed_time: 3_600_000,
|
2008
|
+
max_interval: 60_000
|
2009
|
+
),
|
2010
|
+
retry_connection_errors: true,
|
2011
|
+
strategy: 'backoff'
|
2012
|
+
)
|
2013
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2014
|
+
retry_options[:retry_statuses] = [429, 408]
|
2015
|
+
|
2016
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2017
|
+
|
2018
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2019
|
+
timeout ||= @sdk_configuration.timeout
|
2020
|
+
|
2021
|
+
connection = @sdk_configuration.client.dup
|
2022
|
+
connection.request :retry, retry_options
|
835
2023
|
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
2024
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2025
|
+
base_url: base_url,
|
2026
|
+
oauth2_scopes: [],
|
2027
|
+
operation_id: 'marketing_list_push_templates',
|
2028
|
+
security_source: @sdk_configuration.security_source
|
2029
|
+
)
|
2030
|
+
|
2031
|
+
error = T.let(nil, T.nilable(StandardError))
|
2032
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2033
|
+
|
2034
|
+
begin
|
2035
|
+
r = connection.get(url) do |req|
|
2036
|
+
req.headers.merge!(headers)
|
2037
|
+
req.options.timeout = timeout unless timeout.nil?
|
2038
|
+
req.params = query_params
|
2039
|
+
Utils.configure_request_security(req, security)
|
2040
|
+
|
2041
|
+
@sdk_configuration.hooks.before_request(
|
2042
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2043
|
+
hook_ctx: hook_ctx
|
2044
|
+
),
|
2045
|
+
request: req
|
2046
|
+
)
|
2047
|
+
end
|
2048
|
+
rescue StandardError => e
|
2049
|
+
error = e
|
2050
|
+
ensure
|
2051
|
+
if r.nil? || Utils.error_status?(r.status)
|
2052
|
+
r = @sdk_configuration.hooks.after_error(
|
2053
|
+
error: error,
|
2054
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2055
|
+
hook_ctx: hook_ctx
|
2056
|
+
),
|
2057
|
+
response: r
|
2058
|
+
)
|
2059
|
+
else
|
2060
|
+
r = @sdk_configuration.hooks.after_success(
|
2061
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2062
|
+
hook_ctx: hook_ctx
|
2063
|
+
),
|
2064
|
+
response: r
|
2065
|
+
)
|
2066
|
+
end
|
2067
|
+
|
2068
|
+
if r.nil?
|
2069
|
+
raise error if !error.nil?
|
2070
|
+
raise 'no response'
|
2071
|
+
end
|
841
2072
|
end
|
842
2073
|
|
843
2074
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -860,8 +2091,8 @@ module StackOne
|
|
860
2091
|
end
|
861
2092
|
|
862
2093
|
|
863
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListSmsTemplatesRequest)).returns(::StackOne::Operations::MarketingListSmsTemplatesResponse) }
|
864
|
-
def list_sms_templates(request)
|
2094
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListSmsTemplatesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListSmsTemplatesResponse) }
|
2095
|
+
def list_sms_templates(request, retries = nil, timeout_ms = nil)
|
865
2096
|
# list_sms_templates - List SMS Templates
|
866
2097
|
url, params = @sdk_configuration.get_server_details
|
867
2098
|
base_url = Utils.template_url(url, params)
|
@@ -870,12 +2101,76 @@ module StackOne
|
|
870
2101
|
query_params = Utils.get_query_params(::StackOne::Operations::MarketingListSmsTemplatesRequest, request)
|
871
2102
|
headers['Accept'] = 'application/json'
|
872
2103
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2104
|
+
retries ||= @sdk_configuration.retry_config
|
2105
|
+
retries ||= Utils::RetryConfig.new(
|
2106
|
+
backoff: Utils::BackoffStrategy.new(
|
2107
|
+
exponent: 1.5,
|
2108
|
+
initial_interval: 500,
|
2109
|
+
max_elapsed_time: 3_600_000,
|
2110
|
+
max_interval: 60_000
|
2111
|
+
),
|
2112
|
+
retry_connection_errors: true,
|
2113
|
+
strategy: 'backoff'
|
2114
|
+
)
|
2115
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2116
|
+
retry_options[:retry_statuses] = [429, 408]
|
2117
|
+
|
2118
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2119
|
+
|
2120
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2121
|
+
timeout ||= @sdk_configuration.timeout
|
2122
|
+
|
2123
|
+
connection = @sdk_configuration.client.dup
|
2124
|
+
connection.request :retry, retry_options
|
2125
|
+
|
2126
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2127
|
+
base_url: base_url,
|
2128
|
+
oauth2_scopes: [],
|
2129
|
+
operation_id: 'marketing_list_sms_templates',
|
2130
|
+
security_source: @sdk_configuration.security_source
|
2131
|
+
)
|
873
2132
|
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
2133
|
+
error = T.let(nil, T.nilable(StandardError))
|
2134
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2135
|
+
|
2136
|
+
begin
|
2137
|
+
r = connection.get(url) do |req|
|
2138
|
+
req.headers.merge!(headers)
|
2139
|
+
req.options.timeout = timeout unless timeout.nil?
|
2140
|
+
req.params = query_params
|
2141
|
+
Utils.configure_request_security(req, security)
|
2142
|
+
|
2143
|
+
@sdk_configuration.hooks.before_request(
|
2144
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2145
|
+
hook_ctx: hook_ctx
|
2146
|
+
),
|
2147
|
+
request: req
|
2148
|
+
)
|
2149
|
+
end
|
2150
|
+
rescue StandardError => e
|
2151
|
+
error = e
|
2152
|
+
ensure
|
2153
|
+
if r.nil? || Utils.error_status?(r.status)
|
2154
|
+
r = @sdk_configuration.hooks.after_error(
|
2155
|
+
error: error,
|
2156
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2157
|
+
hook_ctx: hook_ctx
|
2158
|
+
),
|
2159
|
+
response: r
|
2160
|
+
)
|
2161
|
+
else
|
2162
|
+
r = @sdk_configuration.hooks.after_success(
|
2163
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2164
|
+
hook_ctx: hook_ctx
|
2165
|
+
),
|
2166
|
+
response: r
|
2167
|
+
)
|
2168
|
+
end
|
2169
|
+
|
2170
|
+
if r.nil?
|
2171
|
+
raise error if !error.nil?
|
2172
|
+
raise 'no response'
|
2173
|
+
end
|
879
2174
|
end
|
880
2175
|
|
881
2176
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -898,8 +2193,8 @@ module StackOne
|
|
898
2193
|
end
|
899
2194
|
|
900
2195
|
|
901
|
-
sig { params(marketing_create_content_blocks_request_dto: ::StackOne::Shared::MarketingCreateContentBlocksRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::MarketingUpdateContentBlockResponse) }
|
902
|
-
def update_content_block(marketing_create_content_blocks_request_dto, id, x_account_id)
|
2196
|
+
sig { params(marketing_create_content_blocks_request_dto: ::StackOne::Shared::MarketingCreateContentBlocksRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingUpdateContentBlockResponse) }
|
2197
|
+
def update_content_block(marketing_create_content_blocks_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
903
2198
|
# update_content_block - Update Content Block
|
904
2199
|
request = ::StackOne::Operations::MarketingUpdateContentBlockRequest.new(
|
905
2200
|
|
@@ -919,19 +2214,85 @@ module StackOne
|
|
919
2214
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_content_blocks_request_dto, :json)
|
920
2215
|
headers['content-type'] = req_content_type
|
921
2216
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
2217
|
+
|
2218
|
+
if form
|
2219
|
+
body = Utils.encode_form(form)
|
2220
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
2221
|
+
body = URI.encode_www_form(data)
|
2222
|
+
else
|
2223
|
+
body = data
|
2224
|
+
end
|
922
2225
|
headers['Accept'] = 'application/json'
|
923
2226
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2227
|
+
retries ||= @sdk_configuration.retry_config
|
2228
|
+
retries ||= Utils::RetryConfig.new(
|
2229
|
+
backoff: Utils::BackoffStrategy.new(
|
2230
|
+
exponent: 1.5,
|
2231
|
+
initial_interval: 500,
|
2232
|
+
max_elapsed_time: 3_600_000,
|
2233
|
+
max_interval: 60_000
|
2234
|
+
),
|
2235
|
+
retry_connection_errors: true,
|
2236
|
+
strategy: 'backoff'
|
2237
|
+
)
|
2238
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2239
|
+
retry_options[:retry_statuses] = [429, 408]
|
2240
|
+
|
2241
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
924
2242
|
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
2243
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2244
|
+
timeout ||= @sdk_configuration.timeout
|
2245
|
+
|
2246
|
+
connection = @sdk_configuration.client.dup
|
2247
|
+
connection.request :retry, retry_options
|
2248
|
+
|
2249
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2250
|
+
base_url: base_url,
|
2251
|
+
oauth2_scopes: [],
|
2252
|
+
operation_id: 'marketing_update_content_block',
|
2253
|
+
security_source: @sdk_configuration.security_source
|
2254
|
+
)
|
2255
|
+
|
2256
|
+
error = T.let(nil, T.nilable(StandardError))
|
2257
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2258
|
+
|
2259
|
+
begin
|
2260
|
+
r = connection.patch(url) do |req|
|
2261
|
+
req.body = body
|
2262
|
+
req.headers.merge!(headers)
|
2263
|
+
req.options.timeout = timeout unless timeout.nil?
|
2264
|
+
Utils.configure_request_security(req, security)
|
2265
|
+
|
2266
|
+
@sdk_configuration.hooks.before_request(
|
2267
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2268
|
+
hook_ctx: hook_ctx
|
2269
|
+
),
|
2270
|
+
request: req
|
2271
|
+
)
|
2272
|
+
end
|
2273
|
+
rescue StandardError => e
|
2274
|
+
error = e
|
2275
|
+
ensure
|
2276
|
+
if r.nil? || Utils.error_status?(r.status)
|
2277
|
+
r = @sdk_configuration.hooks.after_error(
|
2278
|
+
error: error,
|
2279
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2280
|
+
hook_ctx: hook_ctx
|
2281
|
+
),
|
2282
|
+
response: r
|
2283
|
+
)
|
933
2284
|
else
|
934
|
-
|
2285
|
+
r = @sdk_configuration.hooks.after_success(
|
2286
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2287
|
+
hook_ctx: hook_ctx
|
2288
|
+
),
|
2289
|
+
response: r
|
2290
|
+
)
|
2291
|
+
end
|
2292
|
+
|
2293
|
+
if r.nil?
|
2294
|
+
raise error if !error.nil?
|
2295
|
+
raise 'no response'
|
935
2296
|
end
|
936
2297
|
end
|
937
2298
|
|
@@ -955,8 +2316,8 @@ module StackOne
|
|
955
2316
|
end
|
956
2317
|
|
957
2318
|
|
958
|
-
sig { params(marketing_create_email_template_request_dto: ::StackOne::Shared::MarketingCreateEmailTemplateRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::MarketingUpdateEmailTemplateResponse) }
|
959
|
-
def update_email_template(marketing_create_email_template_request_dto, id, x_account_id)
|
2319
|
+
sig { params(marketing_create_email_template_request_dto: ::StackOne::Shared::MarketingCreateEmailTemplateRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingUpdateEmailTemplateResponse) }
|
2320
|
+
def update_email_template(marketing_create_email_template_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
960
2321
|
# update_email_template - Update Email Templates
|
961
2322
|
request = ::StackOne::Operations::MarketingUpdateEmailTemplateRequest.new(
|
962
2323
|
|
@@ -976,19 +2337,85 @@ module StackOne
|
|
976
2337
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_email_template_request_dto, :json)
|
977
2338
|
headers['content-type'] = req_content_type
|
978
2339
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
2340
|
+
|
2341
|
+
if form
|
2342
|
+
body = Utils.encode_form(form)
|
2343
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
2344
|
+
body = URI.encode_www_form(data)
|
2345
|
+
else
|
2346
|
+
body = data
|
2347
|
+
end
|
979
2348
|
headers['Accept'] = 'application/json'
|
980
2349
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2350
|
+
retries ||= @sdk_configuration.retry_config
|
2351
|
+
retries ||= Utils::RetryConfig.new(
|
2352
|
+
backoff: Utils::BackoffStrategy.new(
|
2353
|
+
exponent: 1.5,
|
2354
|
+
initial_interval: 500,
|
2355
|
+
max_elapsed_time: 3_600_000,
|
2356
|
+
max_interval: 60_000
|
2357
|
+
),
|
2358
|
+
retry_connection_errors: true,
|
2359
|
+
strategy: 'backoff'
|
2360
|
+
)
|
2361
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2362
|
+
retry_options[:retry_statuses] = [429, 408]
|
2363
|
+
|
2364
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2365
|
+
|
2366
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2367
|
+
timeout ||= @sdk_configuration.timeout
|
981
2368
|
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
2369
|
+
connection = @sdk_configuration.client.dup
|
2370
|
+
connection.request :retry, retry_options
|
2371
|
+
|
2372
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2373
|
+
base_url: base_url,
|
2374
|
+
oauth2_scopes: [],
|
2375
|
+
operation_id: 'marketing_update_email_template',
|
2376
|
+
security_source: @sdk_configuration.security_source
|
2377
|
+
)
|
2378
|
+
|
2379
|
+
error = T.let(nil, T.nilable(StandardError))
|
2380
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2381
|
+
|
2382
|
+
begin
|
2383
|
+
r = connection.patch(url) do |req|
|
2384
|
+
req.body = body
|
2385
|
+
req.headers.merge!(headers)
|
2386
|
+
req.options.timeout = timeout unless timeout.nil?
|
2387
|
+
Utils.configure_request_security(req, security)
|
2388
|
+
|
2389
|
+
@sdk_configuration.hooks.before_request(
|
2390
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2391
|
+
hook_ctx: hook_ctx
|
2392
|
+
),
|
2393
|
+
request: req
|
2394
|
+
)
|
2395
|
+
end
|
2396
|
+
rescue StandardError => e
|
2397
|
+
error = e
|
2398
|
+
ensure
|
2399
|
+
if r.nil? || Utils.error_status?(r.status)
|
2400
|
+
r = @sdk_configuration.hooks.after_error(
|
2401
|
+
error: error,
|
2402
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2403
|
+
hook_ctx: hook_ctx
|
2404
|
+
),
|
2405
|
+
response: r
|
2406
|
+
)
|
990
2407
|
else
|
991
|
-
|
2408
|
+
r = @sdk_configuration.hooks.after_success(
|
2409
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2410
|
+
hook_ctx: hook_ctx
|
2411
|
+
),
|
2412
|
+
response: r
|
2413
|
+
)
|
2414
|
+
end
|
2415
|
+
|
2416
|
+
if r.nil?
|
2417
|
+
raise error if !error.nil?
|
2418
|
+
raise 'no response'
|
992
2419
|
end
|
993
2420
|
end
|
994
2421
|
|
@@ -1012,8 +2439,8 @@ module StackOne
|
|
1012
2439
|
end
|
1013
2440
|
|
1014
2441
|
|
1015
|
-
sig { params(marketing_create_in_app_template_request_dto: ::StackOne::Shared::MarketingCreateInAppTemplateRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::MarketingUpdateInAppTemplateResponse) }
|
1016
|
-
def update_in_app_template(marketing_create_in_app_template_request_dto, id, x_account_id)
|
2442
|
+
sig { params(marketing_create_in_app_template_request_dto: ::StackOne::Shared::MarketingCreateInAppTemplateRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingUpdateInAppTemplateResponse) }
|
2443
|
+
def update_in_app_template(marketing_create_in_app_template_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1017
2444
|
# update_in_app_template - Update In-App Template
|
1018
2445
|
request = ::StackOne::Operations::MarketingUpdateInAppTemplateRequest.new(
|
1019
2446
|
|
@@ -1033,19 +2460,85 @@ module StackOne
|
|
1033
2460
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_in_app_template_request_dto, :json)
|
1034
2461
|
headers['content-type'] = req_content_type
|
1035
2462
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
2463
|
+
|
2464
|
+
if form
|
2465
|
+
body = Utils.encode_form(form)
|
2466
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
2467
|
+
body = URI.encode_www_form(data)
|
2468
|
+
else
|
2469
|
+
body = data
|
2470
|
+
end
|
1036
2471
|
headers['Accept'] = 'application/json'
|
1037
2472
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2473
|
+
retries ||= @sdk_configuration.retry_config
|
2474
|
+
retries ||= Utils::RetryConfig.new(
|
2475
|
+
backoff: Utils::BackoffStrategy.new(
|
2476
|
+
exponent: 1.5,
|
2477
|
+
initial_interval: 500,
|
2478
|
+
max_elapsed_time: 3_600_000,
|
2479
|
+
max_interval: 60_000
|
2480
|
+
),
|
2481
|
+
retry_connection_errors: true,
|
2482
|
+
strategy: 'backoff'
|
2483
|
+
)
|
2484
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2485
|
+
retry_options[:retry_statuses] = [429, 408]
|
2486
|
+
|
2487
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2488
|
+
|
2489
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2490
|
+
timeout ||= @sdk_configuration.timeout
|
1038
2491
|
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
2492
|
+
connection = @sdk_configuration.client.dup
|
2493
|
+
connection.request :retry, retry_options
|
2494
|
+
|
2495
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2496
|
+
base_url: base_url,
|
2497
|
+
oauth2_scopes: [],
|
2498
|
+
operation_id: 'marketing_update_in_app_template',
|
2499
|
+
security_source: @sdk_configuration.security_source
|
2500
|
+
)
|
2501
|
+
|
2502
|
+
error = T.let(nil, T.nilable(StandardError))
|
2503
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2504
|
+
|
2505
|
+
begin
|
2506
|
+
r = connection.patch(url) do |req|
|
2507
|
+
req.body = body
|
2508
|
+
req.headers.merge!(headers)
|
2509
|
+
req.options.timeout = timeout unless timeout.nil?
|
2510
|
+
Utils.configure_request_security(req, security)
|
2511
|
+
|
2512
|
+
@sdk_configuration.hooks.before_request(
|
2513
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2514
|
+
hook_ctx: hook_ctx
|
2515
|
+
),
|
2516
|
+
request: req
|
2517
|
+
)
|
2518
|
+
end
|
2519
|
+
rescue StandardError => e
|
2520
|
+
error = e
|
2521
|
+
ensure
|
2522
|
+
if r.nil? || Utils.error_status?(r.status)
|
2523
|
+
r = @sdk_configuration.hooks.after_error(
|
2524
|
+
error: error,
|
2525
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2526
|
+
hook_ctx: hook_ctx
|
2527
|
+
),
|
2528
|
+
response: r
|
2529
|
+
)
|
1047
2530
|
else
|
1048
|
-
|
2531
|
+
r = @sdk_configuration.hooks.after_success(
|
2532
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2533
|
+
hook_ctx: hook_ctx
|
2534
|
+
),
|
2535
|
+
response: r
|
2536
|
+
)
|
2537
|
+
end
|
2538
|
+
|
2539
|
+
if r.nil?
|
2540
|
+
raise error if !error.nil?
|
2541
|
+
raise 'no response'
|
1049
2542
|
end
|
1050
2543
|
end
|
1051
2544
|
|
@@ -1069,8 +2562,8 @@ module StackOne
|
|
1069
2562
|
end
|
1070
2563
|
|
1071
2564
|
|
1072
|
-
sig { params(marketing_create_template_request_dto: ::StackOne::Shared::MarketingCreateTemplateRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::MarketingUpdateOmniChannelTemplateResponse) }
|
1073
|
-
def update_omni_channel_template(marketing_create_template_request_dto, id, x_account_id)
|
2565
|
+
sig { params(marketing_create_template_request_dto: ::StackOne::Shared::MarketingCreateTemplateRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingUpdateOmniChannelTemplateResponse) }
|
2566
|
+
def update_omni_channel_template(marketing_create_template_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1074
2567
|
# update_omni_channel_template - Update Omni-Channel Template
|
1075
2568
|
#
|
1076
2569
|
# @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
@@ -1092,19 +2585,85 @@ module StackOne
|
|
1092
2585
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_template_request_dto, :json)
|
1093
2586
|
headers['content-type'] = req_content_type
|
1094
2587
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
2588
|
+
|
2589
|
+
if form
|
2590
|
+
body = Utils.encode_form(form)
|
2591
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
2592
|
+
body = URI.encode_www_form(data)
|
2593
|
+
else
|
2594
|
+
body = data
|
2595
|
+
end
|
1095
2596
|
headers['Accept'] = 'application/json'
|
1096
2597
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2598
|
+
retries ||= @sdk_configuration.retry_config
|
2599
|
+
retries ||= Utils::RetryConfig.new(
|
2600
|
+
backoff: Utils::BackoffStrategy.new(
|
2601
|
+
exponent: 1.5,
|
2602
|
+
initial_interval: 500,
|
2603
|
+
max_elapsed_time: 3_600_000,
|
2604
|
+
max_interval: 60_000
|
2605
|
+
),
|
2606
|
+
retry_connection_errors: true,
|
2607
|
+
strategy: 'backoff'
|
2608
|
+
)
|
2609
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2610
|
+
retry_options[:retry_statuses] = [429, 408]
|
2611
|
+
|
2612
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2613
|
+
|
2614
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2615
|
+
timeout ||= @sdk_configuration.timeout
|
2616
|
+
|
2617
|
+
connection = @sdk_configuration.client.dup
|
2618
|
+
connection.request :retry, retry_options
|
2619
|
+
|
2620
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2621
|
+
base_url: base_url,
|
2622
|
+
oauth2_scopes: [],
|
2623
|
+
operation_id: 'marketing_update_omni_channel_template',
|
2624
|
+
security_source: @sdk_configuration.security_source
|
2625
|
+
)
|
1097
2626
|
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
req.body =
|
1104
|
-
|
1105
|
-
req.
|
2627
|
+
error = T.let(nil, T.nilable(StandardError))
|
2628
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2629
|
+
|
2630
|
+
begin
|
2631
|
+
r = connection.patch(url) do |req|
|
2632
|
+
req.body = body
|
2633
|
+
req.headers.merge!(headers)
|
2634
|
+
req.options.timeout = timeout unless timeout.nil?
|
2635
|
+
Utils.configure_request_security(req, security)
|
2636
|
+
|
2637
|
+
@sdk_configuration.hooks.before_request(
|
2638
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2639
|
+
hook_ctx: hook_ctx
|
2640
|
+
),
|
2641
|
+
request: req
|
2642
|
+
)
|
2643
|
+
end
|
2644
|
+
rescue StandardError => e
|
2645
|
+
error = e
|
2646
|
+
ensure
|
2647
|
+
if r.nil? || Utils.error_status?(r.status)
|
2648
|
+
r = @sdk_configuration.hooks.after_error(
|
2649
|
+
error: error,
|
2650
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2651
|
+
hook_ctx: hook_ctx
|
2652
|
+
),
|
2653
|
+
response: r
|
2654
|
+
)
|
1106
2655
|
else
|
1107
|
-
|
2656
|
+
r = @sdk_configuration.hooks.after_success(
|
2657
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2658
|
+
hook_ctx: hook_ctx
|
2659
|
+
),
|
2660
|
+
response: r
|
2661
|
+
)
|
2662
|
+
end
|
2663
|
+
|
2664
|
+
if r.nil?
|
2665
|
+
raise error if !error.nil?
|
2666
|
+
raise 'no response'
|
1108
2667
|
end
|
1109
2668
|
end
|
1110
2669
|
|
@@ -1128,8 +2687,8 @@ module StackOne
|
|
1128
2687
|
end
|
1129
2688
|
|
1130
2689
|
|
1131
|
-
sig { params(marketing_create_push_template_request_dto: ::StackOne::Shared::MarketingCreatePushTemplateRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::MarketingUpdatePushTemplateResponse) }
|
1132
|
-
def update_push_template(marketing_create_push_template_request_dto, id, x_account_id)
|
2690
|
+
sig { params(marketing_create_push_template_request_dto: ::StackOne::Shared::MarketingCreatePushTemplateRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingUpdatePushTemplateResponse) }
|
2691
|
+
def update_push_template(marketing_create_push_template_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1133
2692
|
# update_push_template - Update Push Template
|
1134
2693
|
request = ::StackOne::Operations::MarketingUpdatePushTemplateRequest.new(
|
1135
2694
|
|
@@ -1149,19 +2708,85 @@ module StackOne
|
|
1149
2708
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_push_template_request_dto, :json)
|
1150
2709
|
headers['content-type'] = req_content_type
|
1151
2710
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
2711
|
+
|
2712
|
+
if form
|
2713
|
+
body = Utils.encode_form(form)
|
2714
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
2715
|
+
body = URI.encode_www_form(data)
|
2716
|
+
else
|
2717
|
+
body = data
|
2718
|
+
end
|
1152
2719
|
headers['Accept'] = 'application/json'
|
1153
2720
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2721
|
+
retries ||= @sdk_configuration.retry_config
|
2722
|
+
retries ||= Utils::RetryConfig.new(
|
2723
|
+
backoff: Utils::BackoffStrategy.new(
|
2724
|
+
exponent: 1.5,
|
2725
|
+
initial_interval: 500,
|
2726
|
+
max_elapsed_time: 3_600_000,
|
2727
|
+
max_interval: 60_000
|
2728
|
+
),
|
2729
|
+
retry_connection_errors: true,
|
2730
|
+
strategy: 'backoff'
|
2731
|
+
)
|
2732
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2733
|
+
retry_options[:retry_statuses] = [429, 408]
|
2734
|
+
|
2735
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2736
|
+
|
2737
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2738
|
+
timeout ||= @sdk_configuration.timeout
|
1154
2739
|
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
2740
|
+
connection = @sdk_configuration.client.dup
|
2741
|
+
connection.request :retry, retry_options
|
2742
|
+
|
2743
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2744
|
+
base_url: base_url,
|
2745
|
+
oauth2_scopes: [],
|
2746
|
+
operation_id: 'marketing_update_push_template',
|
2747
|
+
security_source: @sdk_configuration.security_source
|
2748
|
+
)
|
2749
|
+
|
2750
|
+
error = T.let(nil, T.nilable(StandardError))
|
2751
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2752
|
+
|
2753
|
+
begin
|
2754
|
+
r = connection.patch(url) do |req|
|
2755
|
+
req.body = body
|
2756
|
+
req.headers.merge!(headers)
|
2757
|
+
req.options.timeout = timeout unless timeout.nil?
|
2758
|
+
Utils.configure_request_security(req, security)
|
2759
|
+
|
2760
|
+
@sdk_configuration.hooks.before_request(
|
2761
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2762
|
+
hook_ctx: hook_ctx
|
2763
|
+
),
|
2764
|
+
request: req
|
2765
|
+
)
|
2766
|
+
end
|
2767
|
+
rescue StandardError => e
|
2768
|
+
error = e
|
2769
|
+
ensure
|
2770
|
+
if r.nil? || Utils.error_status?(r.status)
|
2771
|
+
r = @sdk_configuration.hooks.after_error(
|
2772
|
+
error: error,
|
2773
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2774
|
+
hook_ctx: hook_ctx
|
2775
|
+
),
|
2776
|
+
response: r
|
2777
|
+
)
|
1163
2778
|
else
|
1164
|
-
|
2779
|
+
r = @sdk_configuration.hooks.after_success(
|
2780
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2781
|
+
hook_ctx: hook_ctx
|
2782
|
+
),
|
2783
|
+
response: r
|
2784
|
+
)
|
2785
|
+
end
|
2786
|
+
|
2787
|
+
if r.nil?
|
2788
|
+
raise error if !error.nil?
|
2789
|
+
raise 'no response'
|
1165
2790
|
end
|
1166
2791
|
end
|
1167
2792
|
|
@@ -1185,8 +2810,8 @@ module StackOne
|
|
1185
2810
|
end
|
1186
2811
|
|
1187
2812
|
|
1188
|
-
sig { params(marketing_create_sms_template_request_dto: ::StackOne::Shared::MarketingCreateSmsTemplateRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::MarketingUpdateSmsTemplateResponse) }
|
1189
|
-
def update_sms_template(marketing_create_sms_template_request_dto, id, x_account_id)
|
2813
|
+
sig { params(marketing_create_sms_template_request_dto: ::StackOne::Shared::MarketingCreateSmsTemplateRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingUpdateSmsTemplateResponse) }
|
2814
|
+
def update_sms_template(marketing_create_sms_template_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1190
2815
|
# update_sms_template - Update SMS Template
|
1191
2816
|
request = ::StackOne::Operations::MarketingUpdateSmsTemplateRequest.new(
|
1192
2817
|
|
@@ -1206,19 +2831,85 @@ module StackOne
|
|
1206
2831
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_sms_template_request_dto, :json)
|
1207
2832
|
headers['content-type'] = req_content_type
|
1208
2833
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
2834
|
+
|
2835
|
+
if form
|
2836
|
+
body = Utils.encode_form(form)
|
2837
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
2838
|
+
body = URI.encode_www_form(data)
|
2839
|
+
else
|
2840
|
+
body = data
|
2841
|
+
end
|
1209
2842
|
headers['Accept'] = 'application/json'
|
1210
2843
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2844
|
+
retries ||= @sdk_configuration.retry_config
|
2845
|
+
retries ||= Utils::RetryConfig.new(
|
2846
|
+
backoff: Utils::BackoffStrategy.new(
|
2847
|
+
exponent: 1.5,
|
2848
|
+
initial_interval: 500,
|
2849
|
+
max_elapsed_time: 3_600_000,
|
2850
|
+
max_interval: 60_000
|
2851
|
+
),
|
2852
|
+
retry_connection_errors: true,
|
2853
|
+
strategy: 'backoff'
|
2854
|
+
)
|
2855
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2856
|
+
retry_options[:retry_statuses] = [429, 408]
|
1211
2857
|
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
2858
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2859
|
+
|
2860
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2861
|
+
timeout ||= @sdk_configuration.timeout
|
2862
|
+
|
2863
|
+
connection = @sdk_configuration.client.dup
|
2864
|
+
connection.request :retry, retry_options
|
2865
|
+
|
2866
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2867
|
+
base_url: base_url,
|
2868
|
+
oauth2_scopes: [],
|
2869
|
+
operation_id: 'marketing_update_sms_template',
|
2870
|
+
security_source: @sdk_configuration.security_source
|
2871
|
+
)
|
2872
|
+
|
2873
|
+
error = T.let(nil, T.nilable(StandardError))
|
2874
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2875
|
+
|
2876
|
+
begin
|
2877
|
+
r = connection.patch(url) do |req|
|
2878
|
+
req.body = body
|
2879
|
+
req.headers.merge!(headers)
|
2880
|
+
req.options.timeout = timeout unless timeout.nil?
|
2881
|
+
Utils.configure_request_security(req, security)
|
2882
|
+
|
2883
|
+
@sdk_configuration.hooks.before_request(
|
2884
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2885
|
+
hook_ctx: hook_ctx
|
2886
|
+
),
|
2887
|
+
request: req
|
2888
|
+
)
|
2889
|
+
end
|
2890
|
+
rescue StandardError => e
|
2891
|
+
error = e
|
2892
|
+
ensure
|
2893
|
+
if r.nil? || Utils.error_status?(r.status)
|
2894
|
+
r = @sdk_configuration.hooks.after_error(
|
2895
|
+
error: error,
|
2896
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2897
|
+
hook_ctx: hook_ctx
|
2898
|
+
),
|
2899
|
+
response: r
|
2900
|
+
)
|
1220
2901
|
else
|
1221
|
-
|
2902
|
+
r = @sdk_configuration.hooks.after_success(
|
2903
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2904
|
+
hook_ctx: hook_ctx
|
2905
|
+
),
|
2906
|
+
response: r
|
2907
|
+
)
|
2908
|
+
end
|
2909
|
+
|
2910
|
+
if r.nil?
|
2911
|
+
raise error if !error.nil?
|
2912
|
+
raise 'no response'
|
1222
2913
|
end
|
1223
2914
|
end
|
1224
2915
|
|