stackone_client 0.6.0 → 0.7.1
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 +549 -46
- data/lib/stack_one/ats.rb +8352 -753
- data/lib/stack_one/connect_sessions.rb +231 -26
- data/lib/stack_one/connectors.rb +219 -18
- data/lib/stack_one/crm.rb +1153 -98
- data/lib/stack_one/hris.rb +7091 -621
- data/lib/stack_one/iam.rb +1261 -72
- data/lib/stack_one/lms.rb +3134 -282
- data/lib/stack_one/marketing.rb +3045 -290
- data/lib/stack_one/models/operations/ats_create_application_note_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_application_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_background_check_package_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_candidate_note_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_candidate_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_job_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_offer_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_delete_background_check_package_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_download_application_document_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_custom_field_definition_queryparam_filter.rb +24 -0
- 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_custom_field_definition_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_document_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_note_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_offer_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_scheduled_interview_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_scorecard_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_assessments_package_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_assessments_request_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_assessments_result_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_background_check_package_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_background_check_request_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_background_check_result_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_candidate_custom_field_definition_queryparam_filter.rb +24 -0
- 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_custom_field_definition_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_candidate_note_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_candidate_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_department_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_interview_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_interview_stage_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_job_custom_field_definition_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_job_posting_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_job_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_list_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_location_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_offer_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_rejected_reason_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_user_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_application_custom_field_definitions_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_application_documents_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_application_notes_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_application_scorecards_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_applications_offers_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_applications_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_applications_scheduled_interviews_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_assessments_packages_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_background_check_packages_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_background_check_request_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_candidate_custom_field_definitions_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_candidate_notes_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_candidates_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_departments_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_interview_stages_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_interviews_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_job_custom_field_definitions_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_job_postings_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_jobs_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_lists_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_locations_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_offers_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_rejected_reasons_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_users_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_move_application_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_order_assessments_request_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_order_background_check_request_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_reject_application_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_application_note_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_application_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_assessments_result_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_background_check_package_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_background_check_result_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_candidate_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_job_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_upload_application_document_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_create_contact_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_get_account_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_get_contact_custom_field_definition_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_get_contact_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_get_list_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_list_accounts_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_list_contact_custom_field_definitions_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_list_contacts_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_list_lists_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_update_contact_response.rb +38 -2
- data/lib/stack_one/models/operations/filter.rb +56 -5
- data/lib/stack_one/models/operations/hris_batch_upload_employee_document_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_employee_employment_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_employee_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_employee_skill_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_employee_time_off_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_employee_work_eligibility_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_time_off_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_download_employee_document_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_benefit_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_company_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_cost_center_group_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_department_group_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_custom_field_definition_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_document_category_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_document_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_employment_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_skill_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_time_off_balance_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employees_time_off_request_request.rb +5 -2
- data/lib/stack_one/models/operations/hris_get_employees_time_off_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employees_work_eligibility_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employment_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_group_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_job_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_location_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_team_group_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_time_entries_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_time_off_policy_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_time_off_request_request.rb +5 -2
- data/lib/stack_one/models/operations/hris_get_time_off_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_time_off_type_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_invite_employee_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_benefits_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_companies_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_cost_center_groups_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_department_groups_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_categories_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_custom_field_definitions_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_documents_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_employments_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_skills_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_time_off_balances_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_time_off_policies_queryparam_filter.rb +24 -0
- data/lib/stack_one/models/operations/hris_list_employee_time_off_policies_request.rb +55 -0
- data/lib/stack_one/models/operations/hris_list_employee_time_off_policies_response.rb +72 -0
- data/lib/stack_one/models/operations/hris_list_employee_time_off_requests_request.rb +5 -2
- data/lib/stack_one/models/operations/hris_list_employee_time_off_requests_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_work_eligibility_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employees_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employments_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_groups_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_jobs_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_locations_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_team_groups_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_time_entries_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_time_off_policies_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_time_off_requests_request.rb +5 -2
- data/lib/stack_one/models/operations/hris_list_time_off_requests_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_time_off_types_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_update_employee_employment_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_update_employee_response.rb +40 -4
- 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 +72 -0
- data/lib/stack_one/models/operations/hris_update_employee_work_eligibility_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_update_time_off_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_upload_employee_document_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_delete_user_request.rb +27 -0
- data/lib/stack_one/models/operations/iam_delete_user_response.rb +72 -0
- data/lib/stack_one/models/operations/iam_get_group_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_get_policy_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_get_role_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_get_user_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_list_groups_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_list_policies_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_list_roles_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_list_users_response.rb +38 -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 +72 -0
- data/lib/stack_one/models/operations/include.rb +18 -0
- data/lib/stack_one/models/operations/lms_batch_upsert_content_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_batch_upsert_course_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_create_collection_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_create_user_assignment_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_create_user_completion_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_delete_user_completion_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_assignment_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_category_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_completion_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_content_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_course_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_skill_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_user_assignment_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_user_completion_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_user_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_assignments_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_categories_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_completions_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_content_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_courses_queryparam_filter.rb +6 -3
- data/lib/stack_one/models/operations/lms_list_courses_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_list_courses_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_skills_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_user_assignments_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_user_completions_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_users_queryparam_filter.rb +5 -2
- data/lib/stack_one/models/operations/lms_list_users_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_update_collection_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_upsert_content_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_upsert_course_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_content_block_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_email_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_in_app_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_omni_channel_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_push_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_sms_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_campaign_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_content_block_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_email_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_in_app_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_omni_channel_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_push_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_sms_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_campaigns_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_content_blocks_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_email_templates_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_in_app_templates_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_omni_channel_templates_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_push_templates_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_sms_templates_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_content_block_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_email_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_in_app_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_omni_channel_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_push_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_sms_template_response.rb +38 -2
- data/lib/stack_one/models/operations/order_by.rb +21 -0
- data/lib/stack_one/models/operations/order_direction.rb +18 -0
- data/lib/stack_one/models/operations/queryparam_filter.rb +47 -5
- data/lib/stack_one/models/operations/queryparam_include.rb +17 -0
- data/lib/stack_one/models/operations/queryparam_order_by.rb +21 -0
- data/lib/stack_one/models/operations/queryparam_order_direction.rb +18 -0
- data/lib/stack_one/models/operations/stackone_authenticate_connect_session_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_create_connect_session_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_delete_account_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_get_account_meta_info_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_get_account_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_get_connector_meta_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_get_log_request.rb +27 -0
- data/lib/stack_one/models/operations/stackone_get_log_response.rb +69 -0
- data/lib/stack_one/models/operations/stackone_list_connectors_meta_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_list_linked_accounts_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_list_logs_request.rb +39 -0
- data/lib/stack_one/models/operations/stackone_list_logs_response.rb +69 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_include.rb +18 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_order_by.rb +21 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_order_direction.rb +18 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_request_logs_order_by.rb +21 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_request_logs_order_direction.rb +18 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_request.rb +39 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_response.rb +69 -0
- data/lib/stack_one/models/operations/stackone_proxy_request_response.rb +38 -2
- data/lib/stack_one/models/operations/stackone_update_account_response.rb +35 -2
- data/lib/stack_one/models/operations.rb +30 -2
- 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/badgatewayresponse.rb +30 -0
- data/lib/stack_one/models/shared/badrequestresponse.rb +36 -0
- data/lib/stack_one/models/shared/badrequestresponse_headers.rb +20 -0
- data/lib/stack_one/models/shared/conflictresponse.rb +30 -0
- data/lib/stack_one/models/shared/connectsession.rb +5 -2
- data/lib/stack_one/models/shared/connectsessiontokenauthlink.rb +5 -2
- data/lib/stack_one/models/shared/custommappingerror.rb +30 -0
- data/lib/stack_one/models/shared/data.rb +30 -0
- data/lib/stack_one/models/shared/forbiddenresponse.rb +30 -0
- data/lib/stack_one/models/shared/headers.rb +1 -1
- 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/hriscreatetimeoffrequestdto_value.rb +1 -0
- 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/internalservererrorresponse.rb +30 -0
- data/lib/stack_one/models/shared/job.rb +5 -2
- data/lib/stack_one/models/shared/notfoundresponse.rb +30 -0
- data/lib/stack_one/models/shared/notimplementedresponse.rb +30 -0
- data/lib/stack_one/models/shared/policy.rb +4 -4
- data/lib/stack_one/models/shared/preconditionfailedresponse.rb +30 -0
- data/lib/stack_one/models/shared/providererror.rb +33 -0
- data/lib/stack_one/models/shared/providererrorapimodel.rb +3 -3
- data/lib/stack_one/models/shared/providererrorapimodel_headers.rb +20 -0
- data/lib/stack_one/models/shared/providererrorapimodel_raw.rb +20 -0
- data/lib/stack_one/models/shared/raw.rb +1 -1
- data/lib/stack_one/models/shared/rawresponse.rb +2 -2
- data/lib/stack_one/models/shared/request.rb +36 -0
- data/lib/stack_one/models/shared/requesttimedoutresponse.rb +30 -0
- data/lib/stack_one/models/shared/response.rb +36 -0
- data/lib/stack_one/models/shared/steplogsapimodel.rb +84 -0
- data/lib/stack_one/models/shared/steplogspaginated.rb +27 -0
- data/lib/stack_one/models/shared/timeoff.rb +7 -2
- data/lib/stack_one/models/shared/timeoff_duration_unit.rb +27 -0
- data/lib/stack_one/models/shared/timeoff_schemas_policy_type_value.rb +26 -0
- data/lib/stack_one/models/shared/timeoff_schemas_policy_value.rb +23 -0
- data/lib/stack_one/models/shared/timeoff_schemas_type.rb +27 -0
- data/lib/stack_one/models/shared/timeoff_type.rb +2 -0
- data/lib/stack_one/models/shared/timeoff_value.rb +1 -0
- data/lib/stack_one/models/shared/timeoffbalances.rb +2 -2
- data/lib/stack_one/models/shared/timeoffbalances_policy.rb +48 -0
- data/lib/stack_one/models/shared/toomanyrequestsresponse.rb +30 -0
- data/lib/stack_one/models/shared/unauthorizedresponse.rb +30 -0
- data/lib/stack_one/models/shared/unifiedlogresult.rb +24 -0
- data/lib/stack_one/models/shared/unifiedlogs.rb +96 -0
- data/lib/stack_one/models/shared/unifiedlogs_request.rb +36 -0
- data/lib/stack_one/models/shared/unifiedlogs_response.rb +36 -0
- data/lib/stack_one/models/shared/unifiedlogs_url.rb +33 -0
- data/lib/stack_one/models/shared/unifiedlogspaginated.rb +27 -0
- data/lib/stack_one/models/shared/unprocessableentityresponse.rb +30 -0
- data/lib/stack_one/models/shared/url.rb +33 -0
- data/lib/stack_one/models/shared.rb +41 -42
- data/lib/stack_one/proxy.rb +122 -14
- data/lib/stack_one/request_logs.rb +496 -0
- 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 +11 -4
- data/lib/stack_one/stackone.rb +24 -9
- data/lib/stack_one/utils/utils.rb +10 -0
- data/lib/stackone_client.rb +1 -0
- metadata +70 -40
- data/lib/stack_one/models/shared/updateemployeeapimodel.rb +0 -142
- data/lib/stack_one/models/shared/updateemployeeapimodel_avatar.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_country.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_employment.rb +0 -56
- data/lib/stack_one/models/shared/updateemployeeapimodel_employment_contract_type.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_employment_status.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_employment_type.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_ethnicity.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_gender.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_home_location.rb +0 -51
- data/lib/stack_one/models/shared/updateemployeeapimodel_marital_status.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_national_identity_number.rb +0 -32
- data/lib/stack_one/models/shared/updateemployeeapimodel_pay_frequency.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_pay_period.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_preferred_language.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_country.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_contract_type.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_employment_contract_type_value.rb +0 -20
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_employment_type_value.rb +0 -33
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_pay_period_value.rb +0 -29
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_type.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_type_value.rb +0 -33
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_value.rb +0 -31
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_ethnicity_value.rb +0 -26
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_gender_value.rb +0 -23
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_home_location_value.rb +0 -265
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_marital_status_value.rb +0 -26
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_national_identity_number_type_value.rb +0 -159
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_national_identity_number_value.rb +0 -265
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_preferred_language_value.rb +0 -115
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_state.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_value.rb +0 -23
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_work_location_country.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_work_location_value.rb +0 -265
- data/lib/stack_one/models/shared/updateemployeeapimodel_state.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_type.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_value.rb +0 -20
- data/lib/stack_one/models/shared/updateemployeeapimodel_work_location.rb +0 -51
data/lib/stack_one/marketing.rb
CHANGED
@@ -7,6 +7,7 @@ require 'faraday'
|
|
7
7
|
require 'faraday/multipart'
|
8
8
|
require 'faraday/retry'
|
9
9
|
require 'sorbet-runtime'
|
10
|
+
require_relative 'sdk_hooks/hooks'
|
10
11
|
require_relative 'utils/retries'
|
11
12
|
|
12
13
|
module StackOne
|
@@ -21,8 +22,8 @@ module StackOne
|
|
21
22
|
end
|
22
23
|
|
23
24
|
|
24
|
-
sig { params(marketing_create_content_blocks_request_dto: ::StackOne::Shared::MarketingCreateContentBlocksRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingCreateContentBlockResponse) }
|
25
|
-
def create_content_block(marketing_create_content_blocks_request_dto, x_account_id, retries = nil)
|
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)
|
26
27
|
# create_content_block - Create Content Block
|
27
28
|
request = ::StackOne::Operations::MarketingCreateContentBlockRequest.new(
|
28
29
|
|
@@ -36,6 +37,14 @@ module StackOne
|
|
36
37
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_content_blocks_request_dto, :json)
|
37
38
|
headers['content-type'] = req_content_type
|
38
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
|
39
48
|
headers['Accept'] = 'application/json'
|
40
49
|
headers['user-agent'] = @sdk_configuration.user_agent
|
41
50
|
retries ||= @sdk_configuration.retry_config
|
@@ -52,19 +61,61 @@ module StackOne
|
|
52
61
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
53
62
|
retry_options[:retry_statuses] = [429, 408]
|
54
63
|
|
64
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
65
|
+
|
66
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
67
|
+
timeout ||= @sdk_configuration.timeout
|
68
|
+
|
55
69
|
connection = @sdk_configuration.client.dup
|
56
70
|
connection.request :retry, retry_options
|
57
71
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
72
|
+
hook_ctx = SDKHooks::HookContext.new(
|
73
|
+
base_url: base_url,
|
74
|
+
oauth2_scopes: nil,
|
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
|
+
)
|
66
107
|
else
|
67
|
-
|
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'
|
68
119
|
end
|
69
120
|
end
|
70
121
|
|
@@ -78,18 +129,75 @@ module StackOne
|
|
78
129
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
79
130
|
res.create_result = out
|
80
131
|
end
|
132
|
+
elsif r.status == 400
|
133
|
+
if Utils.match_content_type(content_type, 'application/json')
|
134
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
135
|
+
res.bad_request_response = out
|
136
|
+
end
|
137
|
+
elsif r.status == 401
|
138
|
+
if Utils.match_content_type(content_type, 'application/json')
|
139
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
140
|
+
res.unauthorized_response = out
|
141
|
+
end
|
142
|
+
elsif r.status == 403
|
143
|
+
if Utils.match_content_type(content_type, 'application/json')
|
144
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
145
|
+
res.forbidden_response = out
|
146
|
+
end
|
147
|
+
elsif r.status == 404
|
148
|
+
if Utils.match_content_type(content_type, 'application/json')
|
149
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
150
|
+
res.not_found_response = out
|
151
|
+
end
|
81
152
|
elsif r.status == 408
|
82
153
|
res.headers = r.headers
|
83
|
-
|
84
|
-
|
154
|
+
if Utils.match_content_type(content_type, 'application/json')
|
155
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
156
|
+
res.request_timed_out_response = out
|
157
|
+
end
|
158
|
+
elsif r.status == 409
|
159
|
+
if Utils.match_content_type(content_type, 'application/json')
|
160
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
161
|
+
res.conflict_response = out
|
162
|
+
end
|
163
|
+
elsif r.status == 412
|
164
|
+
if Utils.match_content_type(content_type, 'application/json')
|
165
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
166
|
+
res.precondition_failed_response = out
|
167
|
+
end
|
168
|
+
elsif r.status == 422
|
169
|
+
if Utils.match_content_type(content_type, 'application/json')
|
170
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
171
|
+
res.unprocessable_entity_response = out
|
172
|
+
end
|
173
|
+
elsif r.status == 429
|
174
|
+
if Utils.match_content_type(content_type, 'application/json')
|
175
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
176
|
+
res.too_many_requests_response = out
|
177
|
+
end
|
178
|
+
elsif r.status == 500
|
179
|
+
if Utils.match_content_type(content_type, 'application/json')
|
180
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
181
|
+
res.internal_server_error_response = out
|
182
|
+
end
|
183
|
+
elsif r.status == 501
|
184
|
+
if Utils.match_content_type(content_type, 'application/json')
|
185
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
186
|
+
res.not_implemented_response = out
|
187
|
+
end
|
188
|
+
elsif r.status == 502
|
189
|
+
if Utils.match_content_type(content_type, 'application/json')
|
190
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
191
|
+
res.bad_gateway_response = out
|
192
|
+
end
|
85
193
|
end
|
86
194
|
|
87
195
|
res
|
88
196
|
end
|
89
197
|
|
90
198
|
|
91
|
-
sig { params(marketing_create_email_template_request_dto: ::StackOne::Shared::MarketingCreateEmailTemplateRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingCreateEmailTemplateResponse) }
|
92
|
-
def create_email_template(marketing_create_email_template_request_dto, x_account_id, retries = nil)
|
199
|
+
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) }
|
200
|
+
def create_email_template(marketing_create_email_template_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
93
201
|
# create_email_template - Create Email Templates
|
94
202
|
request = ::StackOne::Operations::MarketingCreateEmailTemplateRequest.new(
|
95
203
|
|
@@ -103,6 +211,14 @@ module StackOne
|
|
103
211
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_email_template_request_dto, :json)
|
104
212
|
headers['content-type'] = req_content_type
|
105
213
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
214
|
+
|
215
|
+
if form
|
216
|
+
body = Utils.encode_form(form)
|
217
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
218
|
+
body = URI.encode_www_form(data)
|
219
|
+
else
|
220
|
+
body = data
|
221
|
+
end
|
106
222
|
headers['Accept'] = 'application/json'
|
107
223
|
headers['user-agent'] = @sdk_configuration.user_agent
|
108
224
|
retries ||= @sdk_configuration.retry_config
|
@@ -119,19 +235,61 @@ module StackOne
|
|
119
235
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
120
236
|
retry_options[:retry_statuses] = [429, 408]
|
121
237
|
|
238
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
239
|
+
|
240
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
241
|
+
timeout ||= @sdk_configuration.timeout
|
242
|
+
|
122
243
|
connection = @sdk_configuration.client.dup
|
123
244
|
connection.request :retry, retry_options
|
124
245
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
246
|
+
hook_ctx = SDKHooks::HookContext.new(
|
247
|
+
base_url: base_url,
|
248
|
+
oauth2_scopes: nil,
|
249
|
+
operation_id: 'marketing_create_email_template',
|
250
|
+
security_source: @sdk_configuration.security_source
|
251
|
+
)
|
252
|
+
|
253
|
+
error = T.let(nil, T.nilable(StandardError))
|
254
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
255
|
+
|
256
|
+
begin
|
257
|
+
r = connection.post(url) do |req|
|
258
|
+
req.body = body
|
259
|
+
req.headers.merge!(headers)
|
260
|
+
req.options.timeout = timeout unless timeout.nil?
|
261
|
+
Utils.configure_request_security(req, security)
|
262
|
+
|
263
|
+
@sdk_configuration.hooks.before_request(
|
264
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
265
|
+
hook_ctx: hook_ctx
|
266
|
+
),
|
267
|
+
request: req
|
268
|
+
)
|
269
|
+
end
|
270
|
+
rescue StandardError => e
|
271
|
+
error = e
|
272
|
+
ensure
|
273
|
+
if r.nil? || Utils.error_status?(r.status)
|
274
|
+
r = @sdk_configuration.hooks.after_error(
|
275
|
+
error: error,
|
276
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
277
|
+
hook_ctx: hook_ctx
|
278
|
+
),
|
279
|
+
response: r
|
280
|
+
)
|
133
281
|
else
|
134
|
-
|
282
|
+
r = @sdk_configuration.hooks.after_success(
|
283
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
284
|
+
hook_ctx: hook_ctx
|
285
|
+
),
|
286
|
+
response: r
|
287
|
+
)
|
288
|
+
end
|
289
|
+
|
290
|
+
if r.nil?
|
291
|
+
raise error if !error.nil?
|
292
|
+
raise 'no response'
|
135
293
|
end
|
136
294
|
end
|
137
295
|
|
@@ -145,18 +303,75 @@ module StackOne
|
|
145
303
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
146
304
|
res.create_result = out
|
147
305
|
end
|
306
|
+
elsif r.status == 400
|
307
|
+
if Utils.match_content_type(content_type, 'application/json')
|
308
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
309
|
+
res.bad_request_response = out
|
310
|
+
end
|
311
|
+
elsif r.status == 401
|
312
|
+
if Utils.match_content_type(content_type, 'application/json')
|
313
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
314
|
+
res.unauthorized_response = out
|
315
|
+
end
|
316
|
+
elsif r.status == 403
|
317
|
+
if Utils.match_content_type(content_type, 'application/json')
|
318
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
319
|
+
res.forbidden_response = out
|
320
|
+
end
|
321
|
+
elsif r.status == 404
|
322
|
+
if Utils.match_content_type(content_type, 'application/json')
|
323
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
324
|
+
res.not_found_response = out
|
325
|
+
end
|
148
326
|
elsif r.status == 408
|
149
327
|
res.headers = r.headers
|
150
|
-
|
151
|
-
|
328
|
+
if Utils.match_content_type(content_type, 'application/json')
|
329
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
330
|
+
res.request_timed_out_response = out
|
331
|
+
end
|
332
|
+
elsif r.status == 409
|
333
|
+
if Utils.match_content_type(content_type, 'application/json')
|
334
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
335
|
+
res.conflict_response = out
|
336
|
+
end
|
337
|
+
elsif r.status == 412
|
338
|
+
if Utils.match_content_type(content_type, 'application/json')
|
339
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
340
|
+
res.precondition_failed_response = out
|
341
|
+
end
|
342
|
+
elsif r.status == 422
|
343
|
+
if Utils.match_content_type(content_type, 'application/json')
|
344
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
345
|
+
res.unprocessable_entity_response = out
|
346
|
+
end
|
347
|
+
elsif r.status == 429
|
348
|
+
if Utils.match_content_type(content_type, 'application/json')
|
349
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
350
|
+
res.too_many_requests_response = out
|
351
|
+
end
|
352
|
+
elsif r.status == 500
|
353
|
+
if Utils.match_content_type(content_type, 'application/json')
|
354
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
355
|
+
res.internal_server_error_response = out
|
356
|
+
end
|
357
|
+
elsif r.status == 501
|
358
|
+
if Utils.match_content_type(content_type, 'application/json')
|
359
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
360
|
+
res.not_implemented_response = out
|
361
|
+
end
|
362
|
+
elsif r.status == 502
|
363
|
+
if Utils.match_content_type(content_type, 'application/json')
|
364
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
365
|
+
res.bad_gateway_response = out
|
366
|
+
end
|
152
367
|
end
|
153
368
|
|
154
369
|
res
|
155
370
|
end
|
156
371
|
|
157
372
|
|
158
|
-
sig { params(marketing_create_in_app_template_request_dto: ::StackOne::Shared::MarketingCreateInAppTemplateRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingCreateInAppTemplateResponse) }
|
159
|
-
def create_in_app_template(marketing_create_in_app_template_request_dto, x_account_id, retries = nil)
|
373
|
+
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) }
|
374
|
+
def create_in_app_template(marketing_create_in_app_template_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
160
375
|
# create_in_app_template - Create In-App Template
|
161
376
|
request = ::StackOne::Operations::MarketingCreateInAppTemplateRequest.new(
|
162
377
|
|
@@ -170,6 +385,14 @@ module StackOne
|
|
170
385
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_in_app_template_request_dto, :json)
|
171
386
|
headers['content-type'] = req_content_type
|
172
387
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
388
|
+
|
389
|
+
if form
|
390
|
+
body = Utils.encode_form(form)
|
391
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
392
|
+
body = URI.encode_www_form(data)
|
393
|
+
else
|
394
|
+
body = data
|
395
|
+
end
|
173
396
|
headers['Accept'] = 'application/json'
|
174
397
|
headers['user-agent'] = @sdk_configuration.user_agent
|
175
398
|
retries ||= @sdk_configuration.retry_config
|
@@ -186,19 +409,61 @@ module StackOne
|
|
186
409
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
187
410
|
retry_options[:retry_statuses] = [429, 408]
|
188
411
|
|
412
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
413
|
+
|
414
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
415
|
+
timeout ||= @sdk_configuration.timeout
|
416
|
+
|
189
417
|
connection = @sdk_configuration.client.dup
|
190
418
|
connection.request :retry, retry_options
|
191
419
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
420
|
+
hook_ctx = SDKHooks::HookContext.new(
|
421
|
+
base_url: base_url,
|
422
|
+
oauth2_scopes: nil,
|
423
|
+
operation_id: 'marketing_create_in_app_template',
|
424
|
+
security_source: @sdk_configuration.security_source
|
425
|
+
)
|
426
|
+
|
427
|
+
error = T.let(nil, T.nilable(StandardError))
|
428
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
429
|
+
|
430
|
+
begin
|
431
|
+
r = connection.post(url) do |req|
|
432
|
+
req.body = body
|
433
|
+
req.headers.merge!(headers)
|
434
|
+
req.options.timeout = timeout unless timeout.nil?
|
435
|
+
Utils.configure_request_security(req, security)
|
436
|
+
|
437
|
+
@sdk_configuration.hooks.before_request(
|
438
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
439
|
+
hook_ctx: hook_ctx
|
440
|
+
),
|
441
|
+
request: req
|
442
|
+
)
|
443
|
+
end
|
444
|
+
rescue StandardError => e
|
445
|
+
error = e
|
446
|
+
ensure
|
447
|
+
if r.nil? || Utils.error_status?(r.status)
|
448
|
+
r = @sdk_configuration.hooks.after_error(
|
449
|
+
error: error,
|
450
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
451
|
+
hook_ctx: hook_ctx
|
452
|
+
),
|
453
|
+
response: r
|
454
|
+
)
|
200
455
|
else
|
201
|
-
|
456
|
+
r = @sdk_configuration.hooks.after_success(
|
457
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
458
|
+
hook_ctx: hook_ctx
|
459
|
+
),
|
460
|
+
response: r
|
461
|
+
)
|
462
|
+
end
|
463
|
+
|
464
|
+
if r.nil?
|
465
|
+
raise error if !error.nil?
|
466
|
+
raise 'no response'
|
202
467
|
end
|
203
468
|
end
|
204
469
|
|
@@ -212,18 +477,75 @@ module StackOne
|
|
212
477
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
213
478
|
res.create_result = out
|
214
479
|
end
|
480
|
+
elsif r.status == 400
|
481
|
+
if Utils.match_content_type(content_type, 'application/json')
|
482
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
483
|
+
res.bad_request_response = out
|
484
|
+
end
|
485
|
+
elsif r.status == 401
|
486
|
+
if Utils.match_content_type(content_type, 'application/json')
|
487
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
488
|
+
res.unauthorized_response = out
|
489
|
+
end
|
490
|
+
elsif r.status == 403
|
491
|
+
if Utils.match_content_type(content_type, 'application/json')
|
492
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
493
|
+
res.forbidden_response = out
|
494
|
+
end
|
495
|
+
elsif r.status == 404
|
496
|
+
if Utils.match_content_type(content_type, 'application/json')
|
497
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
498
|
+
res.not_found_response = out
|
499
|
+
end
|
215
500
|
elsif r.status == 408
|
216
501
|
res.headers = r.headers
|
217
|
-
|
218
|
-
|
502
|
+
if Utils.match_content_type(content_type, 'application/json')
|
503
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
504
|
+
res.request_timed_out_response = out
|
505
|
+
end
|
506
|
+
elsif r.status == 409
|
507
|
+
if Utils.match_content_type(content_type, 'application/json')
|
508
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
509
|
+
res.conflict_response = out
|
510
|
+
end
|
511
|
+
elsif r.status == 412
|
512
|
+
if Utils.match_content_type(content_type, 'application/json')
|
513
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
514
|
+
res.precondition_failed_response = out
|
515
|
+
end
|
516
|
+
elsif r.status == 422
|
517
|
+
if Utils.match_content_type(content_type, 'application/json')
|
518
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
519
|
+
res.unprocessable_entity_response = out
|
520
|
+
end
|
521
|
+
elsif r.status == 429
|
522
|
+
if Utils.match_content_type(content_type, 'application/json')
|
523
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
524
|
+
res.too_many_requests_response = out
|
525
|
+
end
|
526
|
+
elsif r.status == 500
|
527
|
+
if Utils.match_content_type(content_type, 'application/json')
|
528
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
529
|
+
res.internal_server_error_response = out
|
530
|
+
end
|
531
|
+
elsif r.status == 501
|
532
|
+
if Utils.match_content_type(content_type, 'application/json')
|
533
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
534
|
+
res.not_implemented_response = out
|
535
|
+
end
|
536
|
+
elsif r.status == 502
|
537
|
+
if Utils.match_content_type(content_type, 'application/json')
|
538
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
539
|
+
res.bad_gateway_response = out
|
540
|
+
end
|
219
541
|
end
|
220
542
|
|
221
543
|
res
|
222
544
|
end
|
223
545
|
|
224
546
|
|
225
|
-
sig { params(marketing_create_template_request_dto: ::StackOne::Shared::MarketingCreateTemplateRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingCreateOmniChannelTemplateResponse) }
|
226
|
-
def create_omni_channel_template(marketing_create_template_request_dto, x_account_id, retries = nil)
|
547
|
+
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) }
|
548
|
+
def create_omni_channel_template(marketing_create_template_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
227
549
|
# create_omni_channel_template - Create Omni-Channel Template
|
228
550
|
#
|
229
551
|
# @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
@@ -239,6 +561,14 @@ module StackOne
|
|
239
561
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_template_request_dto, :json)
|
240
562
|
headers['content-type'] = req_content_type
|
241
563
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
564
|
+
|
565
|
+
if form
|
566
|
+
body = Utils.encode_form(form)
|
567
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
568
|
+
body = URI.encode_www_form(data)
|
569
|
+
else
|
570
|
+
body = data
|
571
|
+
end
|
242
572
|
headers['Accept'] = 'application/json'
|
243
573
|
headers['user-agent'] = @sdk_configuration.user_agent
|
244
574
|
retries ||= @sdk_configuration.retry_config
|
@@ -255,19 +585,61 @@ module StackOne
|
|
255
585
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
256
586
|
retry_options[:retry_statuses] = [429, 408]
|
257
587
|
|
588
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
589
|
+
|
590
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
591
|
+
timeout ||= @sdk_configuration.timeout
|
592
|
+
|
258
593
|
connection = @sdk_configuration.client.dup
|
259
594
|
connection.request :retry, retry_options
|
260
595
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
596
|
+
hook_ctx = SDKHooks::HookContext.new(
|
597
|
+
base_url: base_url,
|
598
|
+
oauth2_scopes: nil,
|
599
|
+
operation_id: 'marketing_create_omni_channel_template',
|
600
|
+
security_source: @sdk_configuration.security_source
|
601
|
+
)
|
602
|
+
|
603
|
+
error = T.let(nil, T.nilable(StandardError))
|
604
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
605
|
+
|
606
|
+
begin
|
607
|
+
r = connection.post(url) do |req|
|
608
|
+
req.body = body
|
609
|
+
req.headers.merge!(headers)
|
610
|
+
req.options.timeout = timeout unless timeout.nil?
|
611
|
+
Utils.configure_request_security(req, security)
|
612
|
+
|
613
|
+
@sdk_configuration.hooks.before_request(
|
614
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
615
|
+
hook_ctx: hook_ctx
|
616
|
+
),
|
617
|
+
request: req
|
618
|
+
)
|
619
|
+
end
|
620
|
+
rescue StandardError => e
|
621
|
+
error = e
|
622
|
+
ensure
|
623
|
+
if r.nil? || Utils.error_status?(r.status)
|
624
|
+
r = @sdk_configuration.hooks.after_error(
|
625
|
+
error: error,
|
626
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
627
|
+
hook_ctx: hook_ctx
|
628
|
+
),
|
629
|
+
response: r
|
630
|
+
)
|
269
631
|
else
|
270
|
-
|
632
|
+
r = @sdk_configuration.hooks.after_success(
|
633
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
634
|
+
hook_ctx: hook_ctx
|
635
|
+
),
|
636
|
+
response: r
|
637
|
+
)
|
638
|
+
end
|
639
|
+
|
640
|
+
if r.nil?
|
641
|
+
raise error if !error.nil?
|
642
|
+
raise 'no response'
|
271
643
|
end
|
272
644
|
end
|
273
645
|
|
@@ -281,18 +653,75 @@ module StackOne
|
|
281
653
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
282
654
|
res.create_result = out
|
283
655
|
end
|
656
|
+
elsif r.status == 400
|
657
|
+
if Utils.match_content_type(content_type, 'application/json')
|
658
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
659
|
+
res.bad_request_response = out
|
660
|
+
end
|
661
|
+
elsif r.status == 401
|
662
|
+
if Utils.match_content_type(content_type, 'application/json')
|
663
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
664
|
+
res.unauthorized_response = out
|
665
|
+
end
|
666
|
+
elsif r.status == 403
|
667
|
+
if Utils.match_content_type(content_type, 'application/json')
|
668
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
669
|
+
res.forbidden_response = out
|
670
|
+
end
|
671
|
+
elsif r.status == 404
|
672
|
+
if Utils.match_content_type(content_type, 'application/json')
|
673
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
674
|
+
res.not_found_response = out
|
675
|
+
end
|
284
676
|
elsif r.status == 408
|
285
677
|
res.headers = r.headers
|
286
|
-
|
287
|
-
|
678
|
+
if Utils.match_content_type(content_type, 'application/json')
|
679
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
680
|
+
res.request_timed_out_response = out
|
681
|
+
end
|
682
|
+
elsif r.status == 409
|
683
|
+
if Utils.match_content_type(content_type, 'application/json')
|
684
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
685
|
+
res.conflict_response = out
|
686
|
+
end
|
687
|
+
elsif r.status == 412
|
688
|
+
if Utils.match_content_type(content_type, 'application/json')
|
689
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
690
|
+
res.precondition_failed_response = out
|
691
|
+
end
|
692
|
+
elsif r.status == 422
|
693
|
+
if Utils.match_content_type(content_type, 'application/json')
|
694
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
695
|
+
res.unprocessable_entity_response = out
|
696
|
+
end
|
697
|
+
elsif r.status == 429
|
698
|
+
if Utils.match_content_type(content_type, 'application/json')
|
699
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
700
|
+
res.too_many_requests_response = out
|
701
|
+
end
|
702
|
+
elsif r.status == 500
|
703
|
+
if Utils.match_content_type(content_type, 'application/json')
|
704
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
705
|
+
res.internal_server_error_response = out
|
706
|
+
end
|
707
|
+
elsif r.status == 501
|
708
|
+
if Utils.match_content_type(content_type, 'application/json')
|
709
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
710
|
+
res.not_implemented_response = out
|
711
|
+
end
|
712
|
+
elsif r.status == 502
|
713
|
+
if Utils.match_content_type(content_type, 'application/json')
|
714
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
715
|
+
res.bad_gateway_response = out
|
716
|
+
end
|
288
717
|
end
|
289
718
|
|
290
719
|
res
|
291
720
|
end
|
292
721
|
|
293
722
|
|
294
|
-
sig { params(marketing_create_push_template_request_dto: ::StackOne::Shared::MarketingCreatePushTemplateRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingCreatePushTemplateResponse) }
|
295
|
-
def create_push_template(marketing_create_push_template_request_dto, x_account_id, retries = nil)
|
723
|
+
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) }
|
724
|
+
def create_push_template(marketing_create_push_template_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
296
725
|
# create_push_template - Create Push Template
|
297
726
|
request = ::StackOne::Operations::MarketingCreatePushTemplateRequest.new(
|
298
727
|
|
@@ -306,6 +735,14 @@ module StackOne
|
|
306
735
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_push_template_request_dto, :json)
|
307
736
|
headers['content-type'] = req_content_type
|
308
737
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
738
|
+
|
739
|
+
if form
|
740
|
+
body = Utils.encode_form(form)
|
741
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
742
|
+
body = URI.encode_www_form(data)
|
743
|
+
else
|
744
|
+
body = data
|
745
|
+
end
|
309
746
|
headers['Accept'] = 'application/json'
|
310
747
|
headers['user-agent'] = @sdk_configuration.user_agent
|
311
748
|
retries ||= @sdk_configuration.retry_config
|
@@ -322,19 +759,61 @@ module StackOne
|
|
322
759
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
323
760
|
retry_options[:retry_statuses] = [429, 408]
|
324
761
|
|
762
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
763
|
+
|
764
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
765
|
+
timeout ||= @sdk_configuration.timeout
|
766
|
+
|
325
767
|
connection = @sdk_configuration.client.dup
|
326
768
|
connection.request :retry, retry_options
|
327
769
|
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
770
|
+
hook_ctx = SDKHooks::HookContext.new(
|
771
|
+
base_url: base_url,
|
772
|
+
oauth2_scopes: nil,
|
773
|
+
operation_id: 'marketing_create_push_template',
|
774
|
+
security_source: @sdk_configuration.security_source
|
775
|
+
)
|
776
|
+
|
777
|
+
error = T.let(nil, T.nilable(StandardError))
|
778
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
779
|
+
|
780
|
+
begin
|
781
|
+
r = connection.post(url) do |req|
|
782
|
+
req.body = body
|
783
|
+
req.headers.merge!(headers)
|
784
|
+
req.options.timeout = timeout unless timeout.nil?
|
785
|
+
Utils.configure_request_security(req, security)
|
786
|
+
|
787
|
+
@sdk_configuration.hooks.before_request(
|
788
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
789
|
+
hook_ctx: hook_ctx
|
790
|
+
),
|
791
|
+
request: req
|
792
|
+
)
|
793
|
+
end
|
794
|
+
rescue StandardError => e
|
795
|
+
error = e
|
796
|
+
ensure
|
797
|
+
if r.nil? || Utils.error_status?(r.status)
|
798
|
+
r = @sdk_configuration.hooks.after_error(
|
799
|
+
error: error,
|
800
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
801
|
+
hook_ctx: hook_ctx
|
802
|
+
),
|
803
|
+
response: r
|
804
|
+
)
|
336
805
|
else
|
337
|
-
|
806
|
+
r = @sdk_configuration.hooks.after_success(
|
807
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
808
|
+
hook_ctx: hook_ctx
|
809
|
+
),
|
810
|
+
response: r
|
811
|
+
)
|
812
|
+
end
|
813
|
+
|
814
|
+
if r.nil?
|
815
|
+
raise error if !error.nil?
|
816
|
+
raise 'no response'
|
338
817
|
end
|
339
818
|
end
|
340
819
|
|
@@ -348,18 +827,75 @@ module StackOne
|
|
348
827
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
349
828
|
res.create_result = out
|
350
829
|
end
|
830
|
+
elsif r.status == 400
|
831
|
+
if Utils.match_content_type(content_type, 'application/json')
|
832
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
833
|
+
res.bad_request_response = out
|
834
|
+
end
|
835
|
+
elsif r.status == 401
|
836
|
+
if Utils.match_content_type(content_type, 'application/json')
|
837
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
838
|
+
res.unauthorized_response = out
|
839
|
+
end
|
840
|
+
elsif r.status == 403
|
841
|
+
if Utils.match_content_type(content_type, 'application/json')
|
842
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
843
|
+
res.forbidden_response = out
|
844
|
+
end
|
845
|
+
elsif r.status == 404
|
846
|
+
if Utils.match_content_type(content_type, 'application/json')
|
847
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
848
|
+
res.not_found_response = out
|
849
|
+
end
|
351
850
|
elsif r.status == 408
|
352
851
|
res.headers = r.headers
|
353
|
-
|
354
|
-
|
852
|
+
if Utils.match_content_type(content_type, 'application/json')
|
853
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
854
|
+
res.request_timed_out_response = out
|
855
|
+
end
|
856
|
+
elsif r.status == 409
|
857
|
+
if Utils.match_content_type(content_type, 'application/json')
|
858
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
859
|
+
res.conflict_response = out
|
860
|
+
end
|
861
|
+
elsif r.status == 412
|
862
|
+
if Utils.match_content_type(content_type, 'application/json')
|
863
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
864
|
+
res.precondition_failed_response = out
|
865
|
+
end
|
866
|
+
elsif r.status == 422
|
867
|
+
if Utils.match_content_type(content_type, 'application/json')
|
868
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
869
|
+
res.unprocessable_entity_response = out
|
870
|
+
end
|
871
|
+
elsif r.status == 429
|
872
|
+
if Utils.match_content_type(content_type, 'application/json')
|
873
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
874
|
+
res.too_many_requests_response = out
|
875
|
+
end
|
876
|
+
elsif r.status == 500
|
877
|
+
if Utils.match_content_type(content_type, 'application/json')
|
878
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
879
|
+
res.internal_server_error_response = out
|
880
|
+
end
|
881
|
+
elsif r.status == 501
|
882
|
+
if Utils.match_content_type(content_type, 'application/json')
|
883
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
884
|
+
res.not_implemented_response = out
|
885
|
+
end
|
886
|
+
elsif r.status == 502
|
887
|
+
if Utils.match_content_type(content_type, 'application/json')
|
888
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
889
|
+
res.bad_gateway_response = out
|
890
|
+
end
|
355
891
|
end
|
356
892
|
|
357
893
|
res
|
358
894
|
end
|
359
895
|
|
360
896
|
|
361
|
-
sig { params(marketing_create_sms_template_request_dto: ::StackOne::Shared::MarketingCreateSmsTemplateRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingCreateSmsTemplateResponse) }
|
362
|
-
def create_sms_template(marketing_create_sms_template_request_dto, x_account_id, retries = nil)
|
897
|
+
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) }
|
898
|
+
def create_sms_template(marketing_create_sms_template_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
363
899
|
# create_sms_template - Create SMS Template
|
364
900
|
request = ::StackOne::Operations::MarketingCreateSmsTemplateRequest.new(
|
365
901
|
|
@@ -373,6 +909,14 @@ module StackOne
|
|
373
909
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_sms_template_request_dto, :json)
|
374
910
|
headers['content-type'] = req_content_type
|
375
911
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
912
|
+
|
913
|
+
if form
|
914
|
+
body = Utils.encode_form(form)
|
915
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
916
|
+
body = URI.encode_www_form(data)
|
917
|
+
else
|
918
|
+
body = data
|
919
|
+
end
|
376
920
|
headers['Accept'] = 'application/json'
|
377
921
|
headers['user-agent'] = @sdk_configuration.user_agent
|
378
922
|
retries ||= @sdk_configuration.retry_config
|
@@ -389,19 +933,61 @@ module StackOne
|
|
389
933
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
390
934
|
retry_options[:retry_statuses] = [429, 408]
|
391
935
|
|
936
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
937
|
+
|
938
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
939
|
+
timeout ||= @sdk_configuration.timeout
|
940
|
+
|
392
941
|
connection = @sdk_configuration.client.dup
|
393
942
|
connection.request :retry, retry_options
|
394
943
|
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
944
|
+
hook_ctx = SDKHooks::HookContext.new(
|
945
|
+
base_url: base_url,
|
946
|
+
oauth2_scopes: nil,
|
947
|
+
operation_id: 'marketing_create_sms_template',
|
948
|
+
security_source: @sdk_configuration.security_source
|
949
|
+
)
|
950
|
+
|
951
|
+
error = T.let(nil, T.nilable(StandardError))
|
952
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
953
|
+
|
954
|
+
begin
|
955
|
+
r = connection.post(url) do |req|
|
956
|
+
req.body = body
|
957
|
+
req.headers.merge!(headers)
|
958
|
+
req.options.timeout = timeout unless timeout.nil?
|
959
|
+
Utils.configure_request_security(req, security)
|
960
|
+
|
961
|
+
@sdk_configuration.hooks.before_request(
|
962
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
963
|
+
hook_ctx: hook_ctx
|
964
|
+
),
|
965
|
+
request: req
|
966
|
+
)
|
967
|
+
end
|
968
|
+
rescue StandardError => e
|
969
|
+
error = e
|
970
|
+
ensure
|
971
|
+
if r.nil? || Utils.error_status?(r.status)
|
972
|
+
r = @sdk_configuration.hooks.after_error(
|
973
|
+
error: error,
|
974
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
975
|
+
hook_ctx: hook_ctx
|
976
|
+
),
|
977
|
+
response: r
|
978
|
+
)
|
403
979
|
else
|
404
|
-
|
980
|
+
r = @sdk_configuration.hooks.after_success(
|
981
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
982
|
+
hook_ctx: hook_ctx
|
983
|
+
),
|
984
|
+
response: r
|
985
|
+
)
|
986
|
+
end
|
987
|
+
|
988
|
+
if r.nil?
|
989
|
+
raise error if !error.nil?
|
990
|
+
raise 'no response'
|
405
991
|
end
|
406
992
|
end
|
407
993
|
|
@@ -415,18 +1001,75 @@ module StackOne
|
|
415
1001
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
416
1002
|
res.create_result = out
|
417
1003
|
end
|
1004
|
+
elsif r.status == 400
|
1005
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1006
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1007
|
+
res.bad_request_response = out
|
1008
|
+
end
|
1009
|
+
elsif r.status == 401
|
1010
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1011
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1012
|
+
res.unauthorized_response = out
|
1013
|
+
end
|
1014
|
+
elsif r.status == 403
|
1015
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1016
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1017
|
+
res.forbidden_response = out
|
1018
|
+
end
|
1019
|
+
elsif r.status == 404
|
1020
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1021
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1022
|
+
res.not_found_response = out
|
1023
|
+
end
|
418
1024
|
elsif r.status == 408
|
419
1025
|
res.headers = r.headers
|
420
|
-
|
421
|
-
|
1026
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1027
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1028
|
+
res.request_timed_out_response = out
|
1029
|
+
end
|
1030
|
+
elsif r.status == 409
|
1031
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1032
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1033
|
+
res.conflict_response = out
|
1034
|
+
end
|
1035
|
+
elsif r.status == 412
|
1036
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1037
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1038
|
+
res.precondition_failed_response = out
|
1039
|
+
end
|
1040
|
+
elsif r.status == 422
|
1041
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1042
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1043
|
+
res.unprocessable_entity_response = out
|
1044
|
+
end
|
1045
|
+
elsif r.status == 429
|
1046
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1047
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1048
|
+
res.too_many_requests_response = out
|
1049
|
+
end
|
1050
|
+
elsif r.status == 500
|
1051
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1052
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1053
|
+
res.internal_server_error_response = out
|
1054
|
+
end
|
1055
|
+
elsif r.status == 501
|
1056
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1057
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1058
|
+
res.not_implemented_response = out
|
1059
|
+
end
|
1060
|
+
elsif r.status == 502
|
1061
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1062
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1063
|
+
res.bad_gateway_response = out
|
1064
|
+
end
|
422
1065
|
end
|
423
1066
|
|
424
1067
|
res
|
425
1068
|
end
|
426
1069
|
|
427
1070
|
|
428
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetCampaignRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingGetCampaignResponse) }
|
429
|
-
def get_campaign(request, retries = nil)
|
1071
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetCampaignRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetCampaignResponse) }
|
1072
|
+
def get_campaign(request, retries = nil, timeout_ms = nil)
|
430
1073
|
# get_campaign - Get campaign
|
431
1074
|
url, params = @sdk_configuration.get_server_details
|
432
1075
|
base_url = Utils.template_url(url, params)
|
@@ -454,14 +1097,62 @@ module StackOne
|
|
454
1097
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
455
1098
|
retry_options[:retry_statuses] = [429, 408]
|
456
1099
|
|
1100
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1101
|
+
|
1102
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1103
|
+
timeout ||= @sdk_configuration.timeout
|
1104
|
+
|
457
1105
|
connection = @sdk_configuration.client.dup
|
458
1106
|
connection.request :retry, retry_options
|
459
1107
|
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
1108
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1109
|
+
base_url: base_url,
|
1110
|
+
oauth2_scopes: nil,
|
1111
|
+
operation_id: 'marketing_get_campaign',
|
1112
|
+
security_source: @sdk_configuration.security_source
|
1113
|
+
)
|
1114
|
+
|
1115
|
+
error = T.let(nil, T.nilable(StandardError))
|
1116
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1117
|
+
|
1118
|
+
begin
|
1119
|
+
r = connection.get(url) do |req|
|
1120
|
+
req.headers.merge!(headers)
|
1121
|
+
req.options.timeout = timeout unless timeout.nil?
|
1122
|
+
req.params = query_params
|
1123
|
+
Utils.configure_request_security(req, security)
|
1124
|
+
|
1125
|
+
@sdk_configuration.hooks.before_request(
|
1126
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1127
|
+
hook_ctx: hook_ctx
|
1128
|
+
),
|
1129
|
+
request: req
|
1130
|
+
)
|
1131
|
+
end
|
1132
|
+
rescue StandardError => e
|
1133
|
+
error = e
|
1134
|
+
ensure
|
1135
|
+
if r.nil? || Utils.error_status?(r.status)
|
1136
|
+
r = @sdk_configuration.hooks.after_error(
|
1137
|
+
error: error,
|
1138
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1139
|
+
hook_ctx: hook_ctx
|
1140
|
+
),
|
1141
|
+
response: r
|
1142
|
+
)
|
1143
|
+
else
|
1144
|
+
r = @sdk_configuration.hooks.after_success(
|
1145
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1146
|
+
hook_ctx: hook_ctx
|
1147
|
+
),
|
1148
|
+
response: r
|
1149
|
+
)
|
1150
|
+
end
|
1151
|
+
|
1152
|
+
if r.nil?
|
1153
|
+
raise error if !error.nil?
|
1154
|
+
raise 'no response'
|
1155
|
+
end
|
465
1156
|
end
|
466
1157
|
|
467
1158
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -474,18 +1165,75 @@ module StackOne
|
|
474
1165
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CampaignResult)
|
475
1166
|
res.campaign_result = out
|
476
1167
|
end
|
1168
|
+
elsif r.status == 400
|
1169
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1170
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1171
|
+
res.bad_request_response = out
|
1172
|
+
end
|
1173
|
+
elsif r.status == 401
|
1174
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1175
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1176
|
+
res.unauthorized_response = out
|
1177
|
+
end
|
1178
|
+
elsif r.status == 403
|
1179
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1180
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1181
|
+
res.forbidden_response = out
|
1182
|
+
end
|
1183
|
+
elsif r.status == 404
|
1184
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1185
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1186
|
+
res.not_found_response = out
|
1187
|
+
end
|
477
1188
|
elsif r.status == 408
|
478
1189
|
res.headers = r.headers
|
479
|
-
|
480
|
-
|
1190
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1191
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1192
|
+
res.request_timed_out_response = out
|
1193
|
+
end
|
1194
|
+
elsif r.status == 409
|
1195
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1196
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1197
|
+
res.conflict_response = out
|
1198
|
+
end
|
1199
|
+
elsif r.status == 412
|
1200
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1201
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1202
|
+
res.precondition_failed_response = out
|
1203
|
+
end
|
1204
|
+
elsif r.status == 422
|
1205
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1206
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1207
|
+
res.unprocessable_entity_response = out
|
1208
|
+
end
|
1209
|
+
elsif r.status == 429
|
1210
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1211
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1212
|
+
res.too_many_requests_response = out
|
1213
|
+
end
|
1214
|
+
elsif r.status == 500
|
1215
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1216
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1217
|
+
res.internal_server_error_response = out
|
1218
|
+
end
|
1219
|
+
elsif r.status == 501
|
1220
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1221
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1222
|
+
res.not_implemented_response = out
|
1223
|
+
end
|
1224
|
+
elsif r.status == 502
|
1225
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1226
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1227
|
+
res.bad_gateway_response = out
|
1228
|
+
end
|
481
1229
|
end
|
482
1230
|
|
483
1231
|
res
|
484
1232
|
end
|
485
1233
|
|
486
1234
|
|
487
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetContentBlockRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingGetContentBlockResponse) }
|
488
|
-
def get_content_block(request, retries = nil)
|
1235
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetContentBlockRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetContentBlockResponse) }
|
1236
|
+
def get_content_block(request, retries = nil, timeout_ms = nil)
|
489
1237
|
# get_content_block - Get Content Blocks
|
490
1238
|
url, params = @sdk_configuration.get_server_details
|
491
1239
|
base_url = Utils.template_url(url, params)
|
@@ -513,14 +1261,62 @@ module StackOne
|
|
513
1261
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
514
1262
|
retry_options[:retry_statuses] = [429, 408]
|
515
1263
|
|
1264
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1265
|
+
|
1266
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1267
|
+
timeout ||= @sdk_configuration.timeout
|
1268
|
+
|
516
1269
|
connection = @sdk_configuration.client.dup
|
517
1270
|
connection.request :retry, retry_options
|
518
1271
|
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
1272
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1273
|
+
base_url: base_url,
|
1274
|
+
oauth2_scopes: nil,
|
1275
|
+
operation_id: 'marketing_get_content_block',
|
1276
|
+
security_source: @sdk_configuration.security_source
|
1277
|
+
)
|
1278
|
+
|
1279
|
+
error = T.let(nil, T.nilable(StandardError))
|
1280
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1281
|
+
|
1282
|
+
begin
|
1283
|
+
r = connection.get(url) do |req|
|
1284
|
+
req.headers.merge!(headers)
|
1285
|
+
req.options.timeout = timeout unless timeout.nil?
|
1286
|
+
req.params = query_params
|
1287
|
+
Utils.configure_request_security(req, security)
|
1288
|
+
|
1289
|
+
@sdk_configuration.hooks.before_request(
|
1290
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1291
|
+
hook_ctx: hook_ctx
|
1292
|
+
),
|
1293
|
+
request: req
|
1294
|
+
)
|
1295
|
+
end
|
1296
|
+
rescue StandardError => e
|
1297
|
+
error = e
|
1298
|
+
ensure
|
1299
|
+
if r.nil? || Utils.error_status?(r.status)
|
1300
|
+
r = @sdk_configuration.hooks.after_error(
|
1301
|
+
error: error,
|
1302
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1303
|
+
hook_ctx: hook_ctx
|
1304
|
+
),
|
1305
|
+
response: r
|
1306
|
+
)
|
1307
|
+
else
|
1308
|
+
r = @sdk_configuration.hooks.after_success(
|
1309
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1310
|
+
hook_ctx: hook_ctx
|
1311
|
+
),
|
1312
|
+
response: r
|
1313
|
+
)
|
1314
|
+
end
|
1315
|
+
|
1316
|
+
if r.nil?
|
1317
|
+
raise error if !error.nil?
|
1318
|
+
raise 'no response'
|
1319
|
+
end
|
524
1320
|
end
|
525
1321
|
|
526
1322
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -533,20 +1329,77 @@ module StackOne
|
|
533
1329
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ContentBlockResult)
|
534
1330
|
res.content_block_result = out
|
535
1331
|
end
|
1332
|
+
elsif r.status == 400
|
1333
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1334
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1335
|
+
res.bad_request_response = out
|
1336
|
+
end
|
1337
|
+
elsif r.status == 401
|
1338
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1339
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1340
|
+
res.unauthorized_response = out
|
1341
|
+
end
|
1342
|
+
elsif r.status == 403
|
1343
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1344
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1345
|
+
res.forbidden_response = out
|
1346
|
+
end
|
1347
|
+
elsif r.status == 404
|
1348
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1349
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1350
|
+
res.not_found_response = out
|
1351
|
+
end
|
536
1352
|
elsif r.status == 408
|
537
1353
|
res.headers = r.headers
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
1354
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1355
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1356
|
+
res.request_timed_out_response = out
|
1357
|
+
end
|
1358
|
+
elsif r.status == 409
|
1359
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1360
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1361
|
+
res.conflict_response = out
|
1362
|
+
end
|
1363
|
+
elsif r.status == 412
|
1364
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1365
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1366
|
+
res.precondition_failed_response = out
|
1367
|
+
end
|
1368
|
+
elsif r.status == 422
|
1369
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1370
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1371
|
+
res.unprocessable_entity_response = out
|
1372
|
+
end
|
1373
|
+
elsif r.status == 429
|
1374
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1375
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1376
|
+
res.too_many_requests_response = out
|
1377
|
+
end
|
1378
|
+
elsif r.status == 500
|
1379
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1380
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1381
|
+
res.internal_server_error_response = out
|
1382
|
+
end
|
1383
|
+
elsif r.status == 501
|
1384
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1385
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1386
|
+
res.not_implemented_response = out
|
1387
|
+
end
|
1388
|
+
elsif r.status == 502
|
1389
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1390
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1391
|
+
res.bad_gateway_response = out
|
1392
|
+
end
|
1393
|
+
end
|
1394
|
+
|
1395
|
+
res
|
1396
|
+
end
|
1397
|
+
|
1398
|
+
|
1399
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetEmailTemplateRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetEmailTemplateResponse) }
|
1400
|
+
def get_email_template(request, retries = nil, timeout_ms = nil)
|
1401
|
+
# get_email_template - Get Email Templates
|
1402
|
+
url, params = @sdk_configuration.get_server_details
|
550
1403
|
base_url = Utils.template_url(url, params)
|
551
1404
|
url = Utils.generate_url(
|
552
1405
|
::StackOne::Operations::MarketingGetEmailTemplateRequest,
|
@@ -572,14 +1425,62 @@ module StackOne
|
|
572
1425
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
573
1426
|
retry_options[:retry_statuses] = [429, 408]
|
574
1427
|
|
1428
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1429
|
+
|
1430
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1431
|
+
timeout ||= @sdk_configuration.timeout
|
1432
|
+
|
575
1433
|
connection = @sdk_configuration.client.dup
|
576
1434
|
connection.request :retry, retry_options
|
577
1435
|
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
1436
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1437
|
+
base_url: base_url,
|
1438
|
+
oauth2_scopes: nil,
|
1439
|
+
operation_id: 'marketing_get_email_template',
|
1440
|
+
security_source: @sdk_configuration.security_source
|
1441
|
+
)
|
1442
|
+
|
1443
|
+
error = T.let(nil, T.nilable(StandardError))
|
1444
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1445
|
+
|
1446
|
+
begin
|
1447
|
+
r = connection.get(url) do |req|
|
1448
|
+
req.headers.merge!(headers)
|
1449
|
+
req.options.timeout = timeout unless timeout.nil?
|
1450
|
+
req.params = query_params
|
1451
|
+
Utils.configure_request_security(req, security)
|
1452
|
+
|
1453
|
+
@sdk_configuration.hooks.before_request(
|
1454
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1455
|
+
hook_ctx: hook_ctx
|
1456
|
+
),
|
1457
|
+
request: req
|
1458
|
+
)
|
1459
|
+
end
|
1460
|
+
rescue StandardError => e
|
1461
|
+
error = e
|
1462
|
+
ensure
|
1463
|
+
if r.nil? || Utils.error_status?(r.status)
|
1464
|
+
r = @sdk_configuration.hooks.after_error(
|
1465
|
+
error: error,
|
1466
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1467
|
+
hook_ctx: hook_ctx
|
1468
|
+
),
|
1469
|
+
response: r
|
1470
|
+
)
|
1471
|
+
else
|
1472
|
+
r = @sdk_configuration.hooks.after_success(
|
1473
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1474
|
+
hook_ctx: hook_ctx
|
1475
|
+
),
|
1476
|
+
response: r
|
1477
|
+
)
|
1478
|
+
end
|
1479
|
+
|
1480
|
+
if r.nil?
|
1481
|
+
raise error if !error.nil?
|
1482
|
+
raise 'no response'
|
1483
|
+
end
|
583
1484
|
end
|
584
1485
|
|
585
1486
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -592,18 +1493,75 @@ module StackOne
|
|
592
1493
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::EmailTemplateResult)
|
593
1494
|
res.email_template_result = out
|
594
1495
|
end
|
1496
|
+
elsif r.status == 400
|
1497
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1498
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1499
|
+
res.bad_request_response = out
|
1500
|
+
end
|
1501
|
+
elsif r.status == 401
|
1502
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1503
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1504
|
+
res.unauthorized_response = out
|
1505
|
+
end
|
1506
|
+
elsif r.status == 403
|
1507
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1508
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1509
|
+
res.forbidden_response = out
|
1510
|
+
end
|
1511
|
+
elsif r.status == 404
|
1512
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1513
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1514
|
+
res.not_found_response = out
|
1515
|
+
end
|
595
1516
|
elsif r.status == 408
|
596
1517
|
res.headers = r.headers
|
597
|
-
|
598
|
-
|
1518
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1519
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1520
|
+
res.request_timed_out_response = out
|
1521
|
+
end
|
1522
|
+
elsif r.status == 409
|
1523
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1524
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1525
|
+
res.conflict_response = out
|
1526
|
+
end
|
1527
|
+
elsif r.status == 412
|
1528
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1529
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1530
|
+
res.precondition_failed_response = out
|
1531
|
+
end
|
1532
|
+
elsif r.status == 422
|
1533
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1534
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1535
|
+
res.unprocessable_entity_response = out
|
1536
|
+
end
|
1537
|
+
elsif r.status == 429
|
1538
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1539
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1540
|
+
res.too_many_requests_response = out
|
1541
|
+
end
|
1542
|
+
elsif r.status == 500
|
1543
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1544
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1545
|
+
res.internal_server_error_response = out
|
1546
|
+
end
|
1547
|
+
elsif r.status == 501
|
1548
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1549
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1550
|
+
res.not_implemented_response = out
|
1551
|
+
end
|
1552
|
+
elsif r.status == 502
|
1553
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1554
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1555
|
+
res.bad_gateway_response = out
|
1556
|
+
end
|
599
1557
|
end
|
600
1558
|
|
601
1559
|
res
|
602
1560
|
end
|
603
1561
|
|
604
1562
|
|
605
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetInAppTemplateRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingGetInAppTemplateResponse) }
|
606
|
-
def get_in_app_template(request, retries = nil)
|
1563
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetInAppTemplateRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetInAppTemplateResponse) }
|
1564
|
+
def get_in_app_template(request, retries = nil, timeout_ms = nil)
|
607
1565
|
# get_in_app_template - Get In-App Template
|
608
1566
|
url, params = @sdk_configuration.get_server_details
|
609
1567
|
base_url = Utils.template_url(url, params)
|
@@ -631,14 +1589,62 @@ module StackOne
|
|
631
1589
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
632
1590
|
retry_options[:retry_statuses] = [429, 408]
|
633
1591
|
|
1592
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1593
|
+
|
1594
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1595
|
+
timeout ||= @sdk_configuration.timeout
|
1596
|
+
|
634
1597
|
connection = @sdk_configuration.client.dup
|
635
1598
|
connection.request :retry, retry_options
|
636
1599
|
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
1600
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1601
|
+
base_url: base_url,
|
1602
|
+
oauth2_scopes: nil,
|
1603
|
+
operation_id: 'marketing_get_in_app_template',
|
1604
|
+
security_source: @sdk_configuration.security_source
|
1605
|
+
)
|
1606
|
+
|
1607
|
+
error = T.let(nil, T.nilable(StandardError))
|
1608
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1609
|
+
|
1610
|
+
begin
|
1611
|
+
r = connection.get(url) do |req|
|
1612
|
+
req.headers.merge!(headers)
|
1613
|
+
req.options.timeout = timeout unless timeout.nil?
|
1614
|
+
req.params = query_params
|
1615
|
+
Utils.configure_request_security(req, security)
|
1616
|
+
|
1617
|
+
@sdk_configuration.hooks.before_request(
|
1618
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1619
|
+
hook_ctx: hook_ctx
|
1620
|
+
),
|
1621
|
+
request: req
|
1622
|
+
)
|
1623
|
+
end
|
1624
|
+
rescue StandardError => e
|
1625
|
+
error = e
|
1626
|
+
ensure
|
1627
|
+
if r.nil? || Utils.error_status?(r.status)
|
1628
|
+
r = @sdk_configuration.hooks.after_error(
|
1629
|
+
error: error,
|
1630
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1631
|
+
hook_ctx: hook_ctx
|
1632
|
+
),
|
1633
|
+
response: r
|
1634
|
+
)
|
1635
|
+
else
|
1636
|
+
r = @sdk_configuration.hooks.after_success(
|
1637
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1638
|
+
hook_ctx: hook_ctx
|
1639
|
+
),
|
1640
|
+
response: r
|
1641
|
+
)
|
1642
|
+
end
|
1643
|
+
|
1644
|
+
if r.nil?
|
1645
|
+
raise error if !error.nil?
|
1646
|
+
raise 'no response'
|
1647
|
+
end
|
642
1648
|
end
|
643
1649
|
|
644
1650
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -651,18 +1657,75 @@ module StackOne
|
|
651
1657
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InAppTemplateResult)
|
652
1658
|
res.in_app_template_result = out
|
653
1659
|
end
|
1660
|
+
elsif r.status == 400
|
1661
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1662
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1663
|
+
res.bad_request_response = out
|
1664
|
+
end
|
1665
|
+
elsif r.status == 401
|
1666
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1667
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1668
|
+
res.unauthorized_response = out
|
1669
|
+
end
|
1670
|
+
elsif r.status == 403
|
1671
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1672
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1673
|
+
res.forbidden_response = out
|
1674
|
+
end
|
1675
|
+
elsif r.status == 404
|
1676
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1677
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1678
|
+
res.not_found_response = out
|
1679
|
+
end
|
654
1680
|
elsif r.status == 408
|
655
1681
|
res.headers = r.headers
|
656
|
-
|
657
|
-
|
1682
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1683
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1684
|
+
res.request_timed_out_response = out
|
1685
|
+
end
|
1686
|
+
elsif r.status == 409
|
1687
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1688
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1689
|
+
res.conflict_response = out
|
1690
|
+
end
|
1691
|
+
elsif r.status == 412
|
1692
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1693
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1694
|
+
res.precondition_failed_response = out
|
1695
|
+
end
|
1696
|
+
elsif r.status == 422
|
1697
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1698
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1699
|
+
res.unprocessable_entity_response = out
|
1700
|
+
end
|
1701
|
+
elsif r.status == 429
|
1702
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1703
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1704
|
+
res.too_many_requests_response = out
|
1705
|
+
end
|
1706
|
+
elsif r.status == 500
|
1707
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1708
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1709
|
+
res.internal_server_error_response = out
|
1710
|
+
end
|
1711
|
+
elsif r.status == 501
|
1712
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1713
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1714
|
+
res.not_implemented_response = out
|
1715
|
+
end
|
1716
|
+
elsif r.status == 502
|
1717
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1718
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1719
|
+
res.bad_gateway_response = out
|
1720
|
+
end
|
658
1721
|
end
|
659
1722
|
|
660
1723
|
res
|
661
1724
|
end
|
662
1725
|
|
663
1726
|
|
664
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetOmniChannelTemplateRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingGetOmniChannelTemplateResponse) }
|
665
|
-
def get_omni_channel_template(request, retries = nil)
|
1727
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetOmniChannelTemplateRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetOmniChannelTemplateResponse) }
|
1728
|
+
def get_omni_channel_template(request, retries = nil, timeout_ms = nil)
|
666
1729
|
# get_omni_channel_template - Get Omni-Channel Template
|
667
1730
|
#
|
668
1731
|
# @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
@@ -692,14 +1755,62 @@ module StackOne
|
|
692
1755
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
693
1756
|
retry_options[:retry_statuses] = [429, 408]
|
694
1757
|
|
1758
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1759
|
+
|
1760
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1761
|
+
timeout ||= @sdk_configuration.timeout
|
1762
|
+
|
695
1763
|
connection = @sdk_configuration.client.dup
|
696
1764
|
connection.request :retry, retry_options
|
697
1765
|
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
1766
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1767
|
+
base_url: base_url,
|
1768
|
+
oauth2_scopes: nil,
|
1769
|
+
operation_id: 'marketing_get_omni_channel_template',
|
1770
|
+
security_source: @sdk_configuration.security_source
|
1771
|
+
)
|
1772
|
+
|
1773
|
+
error = T.let(nil, T.nilable(StandardError))
|
1774
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1775
|
+
|
1776
|
+
begin
|
1777
|
+
r = connection.get(url) do |req|
|
1778
|
+
req.headers.merge!(headers)
|
1779
|
+
req.options.timeout = timeout unless timeout.nil?
|
1780
|
+
req.params = query_params
|
1781
|
+
Utils.configure_request_security(req, security)
|
1782
|
+
|
1783
|
+
@sdk_configuration.hooks.before_request(
|
1784
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1785
|
+
hook_ctx: hook_ctx
|
1786
|
+
),
|
1787
|
+
request: req
|
1788
|
+
)
|
1789
|
+
end
|
1790
|
+
rescue StandardError => e
|
1791
|
+
error = e
|
1792
|
+
ensure
|
1793
|
+
if r.nil? || Utils.error_status?(r.status)
|
1794
|
+
r = @sdk_configuration.hooks.after_error(
|
1795
|
+
error: error,
|
1796
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1797
|
+
hook_ctx: hook_ctx
|
1798
|
+
),
|
1799
|
+
response: r
|
1800
|
+
)
|
1801
|
+
else
|
1802
|
+
r = @sdk_configuration.hooks.after_success(
|
1803
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1804
|
+
hook_ctx: hook_ctx
|
1805
|
+
),
|
1806
|
+
response: r
|
1807
|
+
)
|
1808
|
+
end
|
1809
|
+
|
1810
|
+
if r.nil?
|
1811
|
+
raise error if !error.nil?
|
1812
|
+
raise 'no response'
|
1813
|
+
end
|
703
1814
|
end
|
704
1815
|
|
705
1816
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -712,18 +1823,75 @@ module StackOne
|
|
712
1823
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TemplateResult)
|
713
1824
|
res.template_result = out
|
714
1825
|
end
|
1826
|
+
elsif r.status == 400
|
1827
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1828
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1829
|
+
res.bad_request_response = out
|
1830
|
+
end
|
1831
|
+
elsif r.status == 401
|
1832
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1833
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1834
|
+
res.unauthorized_response = out
|
1835
|
+
end
|
1836
|
+
elsif r.status == 403
|
1837
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1838
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1839
|
+
res.forbidden_response = out
|
1840
|
+
end
|
1841
|
+
elsif r.status == 404
|
1842
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1843
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1844
|
+
res.not_found_response = out
|
1845
|
+
end
|
715
1846
|
elsif r.status == 408
|
716
1847
|
res.headers = r.headers
|
717
|
-
|
718
|
-
|
1848
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1849
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1850
|
+
res.request_timed_out_response = out
|
1851
|
+
end
|
1852
|
+
elsif r.status == 409
|
1853
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1854
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1855
|
+
res.conflict_response = out
|
1856
|
+
end
|
1857
|
+
elsif r.status == 412
|
1858
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1859
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1860
|
+
res.precondition_failed_response = out
|
1861
|
+
end
|
1862
|
+
elsif r.status == 422
|
1863
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1864
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1865
|
+
res.unprocessable_entity_response = out
|
1866
|
+
end
|
1867
|
+
elsif r.status == 429
|
1868
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1869
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1870
|
+
res.too_many_requests_response = out
|
1871
|
+
end
|
1872
|
+
elsif r.status == 500
|
1873
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1874
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1875
|
+
res.internal_server_error_response = out
|
1876
|
+
end
|
1877
|
+
elsif r.status == 501
|
1878
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1879
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1880
|
+
res.not_implemented_response = out
|
1881
|
+
end
|
1882
|
+
elsif r.status == 502
|
1883
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1884
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1885
|
+
res.bad_gateway_response = out
|
1886
|
+
end
|
719
1887
|
end
|
720
1888
|
|
721
1889
|
res
|
722
1890
|
end
|
723
1891
|
|
724
1892
|
|
725
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetPushTemplateRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingGetPushTemplateResponse) }
|
726
|
-
def get_push_template(request, retries = nil)
|
1893
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetPushTemplateRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetPushTemplateResponse) }
|
1894
|
+
def get_push_template(request, retries = nil, timeout_ms = nil)
|
727
1895
|
# get_push_template - Get Push Template
|
728
1896
|
url, params = @sdk_configuration.get_server_details
|
729
1897
|
base_url = Utils.template_url(url, params)
|
@@ -751,14 +1919,62 @@ module StackOne
|
|
751
1919
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
752
1920
|
retry_options[:retry_statuses] = [429, 408]
|
753
1921
|
|
1922
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1923
|
+
|
1924
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1925
|
+
timeout ||= @sdk_configuration.timeout
|
1926
|
+
|
754
1927
|
connection = @sdk_configuration.client.dup
|
755
1928
|
connection.request :retry, retry_options
|
756
1929
|
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
1930
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1931
|
+
base_url: base_url,
|
1932
|
+
oauth2_scopes: nil,
|
1933
|
+
operation_id: 'marketing_get_push_template',
|
1934
|
+
security_source: @sdk_configuration.security_source
|
1935
|
+
)
|
1936
|
+
|
1937
|
+
error = T.let(nil, T.nilable(StandardError))
|
1938
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1939
|
+
|
1940
|
+
begin
|
1941
|
+
r = connection.get(url) do |req|
|
1942
|
+
req.headers.merge!(headers)
|
1943
|
+
req.options.timeout = timeout unless timeout.nil?
|
1944
|
+
req.params = query_params
|
1945
|
+
Utils.configure_request_security(req, security)
|
1946
|
+
|
1947
|
+
@sdk_configuration.hooks.before_request(
|
1948
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1949
|
+
hook_ctx: hook_ctx
|
1950
|
+
),
|
1951
|
+
request: req
|
1952
|
+
)
|
1953
|
+
end
|
1954
|
+
rescue StandardError => e
|
1955
|
+
error = e
|
1956
|
+
ensure
|
1957
|
+
if r.nil? || Utils.error_status?(r.status)
|
1958
|
+
r = @sdk_configuration.hooks.after_error(
|
1959
|
+
error: error,
|
1960
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1961
|
+
hook_ctx: hook_ctx
|
1962
|
+
),
|
1963
|
+
response: r
|
1964
|
+
)
|
1965
|
+
else
|
1966
|
+
r = @sdk_configuration.hooks.after_success(
|
1967
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1968
|
+
hook_ctx: hook_ctx
|
1969
|
+
),
|
1970
|
+
response: r
|
1971
|
+
)
|
1972
|
+
end
|
1973
|
+
|
1974
|
+
if r.nil?
|
1975
|
+
raise error if !error.nil?
|
1976
|
+
raise 'no response'
|
1977
|
+
end
|
762
1978
|
end
|
763
1979
|
|
764
1980
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -771,18 +1987,75 @@ module StackOne
|
|
771
1987
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PushTemplateResult)
|
772
1988
|
res.push_template_result = out
|
773
1989
|
end
|
1990
|
+
elsif r.status == 400
|
1991
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1992
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1993
|
+
res.bad_request_response = out
|
1994
|
+
end
|
1995
|
+
elsif r.status == 401
|
1996
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1997
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1998
|
+
res.unauthorized_response = out
|
1999
|
+
end
|
2000
|
+
elsif r.status == 403
|
2001
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2002
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2003
|
+
res.forbidden_response = out
|
2004
|
+
end
|
2005
|
+
elsif r.status == 404
|
2006
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2007
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2008
|
+
res.not_found_response = out
|
2009
|
+
end
|
774
2010
|
elsif r.status == 408
|
775
2011
|
res.headers = r.headers
|
776
|
-
|
777
|
-
|
2012
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2013
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2014
|
+
res.request_timed_out_response = out
|
2015
|
+
end
|
2016
|
+
elsif r.status == 409
|
2017
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2018
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2019
|
+
res.conflict_response = out
|
2020
|
+
end
|
2021
|
+
elsif r.status == 412
|
2022
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2023
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2024
|
+
res.precondition_failed_response = out
|
2025
|
+
end
|
2026
|
+
elsif r.status == 422
|
2027
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2028
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2029
|
+
res.unprocessable_entity_response = out
|
2030
|
+
end
|
2031
|
+
elsif r.status == 429
|
2032
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2033
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2034
|
+
res.too_many_requests_response = out
|
2035
|
+
end
|
2036
|
+
elsif r.status == 500
|
2037
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2038
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2039
|
+
res.internal_server_error_response = out
|
2040
|
+
end
|
2041
|
+
elsif r.status == 501
|
2042
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2043
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2044
|
+
res.not_implemented_response = out
|
2045
|
+
end
|
2046
|
+
elsif r.status == 502
|
2047
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2048
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2049
|
+
res.bad_gateway_response = out
|
2050
|
+
end
|
778
2051
|
end
|
779
2052
|
|
780
2053
|
res
|
781
2054
|
end
|
782
2055
|
|
783
2056
|
|
784
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetSmsTemplateRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingGetSmsTemplateResponse) }
|
785
|
-
def get_sms_template(request, retries = nil)
|
2057
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingGetSmsTemplateRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingGetSmsTemplateResponse) }
|
2058
|
+
def get_sms_template(request, retries = nil, timeout_ms = nil)
|
786
2059
|
# get_sms_template - Get SMS Template
|
787
2060
|
url, params = @sdk_configuration.get_server_details
|
788
2061
|
base_url = Utils.template_url(url, params)
|
@@ -810,14 +2083,62 @@ module StackOne
|
|
810
2083
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
811
2084
|
retry_options[:retry_statuses] = [429, 408]
|
812
2085
|
|
2086
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2087
|
+
|
2088
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2089
|
+
timeout ||= @sdk_configuration.timeout
|
2090
|
+
|
813
2091
|
connection = @sdk_configuration.client.dup
|
814
2092
|
connection.request :retry, retry_options
|
815
2093
|
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
2094
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2095
|
+
base_url: base_url,
|
2096
|
+
oauth2_scopes: nil,
|
2097
|
+
operation_id: 'marketing_get_sms_template',
|
2098
|
+
security_source: @sdk_configuration.security_source
|
2099
|
+
)
|
2100
|
+
|
2101
|
+
error = T.let(nil, T.nilable(StandardError))
|
2102
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2103
|
+
|
2104
|
+
begin
|
2105
|
+
r = connection.get(url) do |req|
|
2106
|
+
req.headers.merge!(headers)
|
2107
|
+
req.options.timeout = timeout unless timeout.nil?
|
2108
|
+
req.params = query_params
|
2109
|
+
Utils.configure_request_security(req, security)
|
2110
|
+
|
2111
|
+
@sdk_configuration.hooks.before_request(
|
2112
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2113
|
+
hook_ctx: hook_ctx
|
2114
|
+
),
|
2115
|
+
request: req
|
2116
|
+
)
|
2117
|
+
end
|
2118
|
+
rescue StandardError => e
|
2119
|
+
error = e
|
2120
|
+
ensure
|
2121
|
+
if r.nil? || Utils.error_status?(r.status)
|
2122
|
+
r = @sdk_configuration.hooks.after_error(
|
2123
|
+
error: error,
|
2124
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2125
|
+
hook_ctx: hook_ctx
|
2126
|
+
),
|
2127
|
+
response: r
|
2128
|
+
)
|
2129
|
+
else
|
2130
|
+
r = @sdk_configuration.hooks.after_success(
|
2131
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2132
|
+
hook_ctx: hook_ctx
|
2133
|
+
),
|
2134
|
+
response: r
|
2135
|
+
)
|
2136
|
+
end
|
2137
|
+
|
2138
|
+
if r.nil?
|
2139
|
+
raise error if !error.nil?
|
2140
|
+
raise 'no response'
|
2141
|
+
end
|
821
2142
|
end
|
822
2143
|
|
823
2144
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -830,18 +2151,75 @@ module StackOne
|
|
830
2151
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::SmsTemplateResult)
|
831
2152
|
res.sms_template_result = out
|
832
2153
|
end
|
2154
|
+
elsif r.status == 400
|
2155
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2156
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2157
|
+
res.bad_request_response = out
|
2158
|
+
end
|
2159
|
+
elsif r.status == 401
|
2160
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2161
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2162
|
+
res.unauthorized_response = out
|
2163
|
+
end
|
2164
|
+
elsif r.status == 403
|
2165
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2166
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2167
|
+
res.forbidden_response = out
|
2168
|
+
end
|
2169
|
+
elsif r.status == 404
|
2170
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2171
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2172
|
+
res.not_found_response = out
|
2173
|
+
end
|
833
2174
|
elsif r.status == 408
|
834
2175
|
res.headers = r.headers
|
835
|
-
|
836
|
-
|
2176
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2177
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2178
|
+
res.request_timed_out_response = out
|
2179
|
+
end
|
2180
|
+
elsif r.status == 409
|
2181
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2182
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2183
|
+
res.conflict_response = out
|
2184
|
+
end
|
2185
|
+
elsif r.status == 412
|
2186
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2187
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2188
|
+
res.precondition_failed_response = out
|
2189
|
+
end
|
2190
|
+
elsif r.status == 422
|
2191
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2192
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2193
|
+
res.unprocessable_entity_response = out
|
2194
|
+
end
|
2195
|
+
elsif r.status == 429
|
2196
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2197
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2198
|
+
res.too_many_requests_response = out
|
2199
|
+
end
|
2200
|
+
elsif r.status == 500
|
2201
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2202
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2203
|
+
res.internal_server_error_response = out
|
2204
|
+
end
|
2205
|
+
elsif r.status == 501
|
2206
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2207
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2208
|
+
res.not_implemented_response = out
|
2209
|
+
end
|
2210
|
+
elsif r.status == 502
|
2211
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2212
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2213
|
+
res.bad_gateway_response = out
|
2214
|
+
end
|
837
2215
|
end
|
838
2216
|
|
839
2217
|
res
|
840
2218
|
end
|
841
2219
|
|
842
2220
|
|
843
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListCampaignsRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingListCampaignsResponse) }
|
844
|
-
def list_campaigns(request, retries = nil)
|
2221
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListCampaignsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListCampaignsResponse) }
|
2222
|
+
def list_campaigns(request, retries = nil, timeout_ms = nil)
|
845
2223
|
# list_campaigns - List campaigns
|
846
2224
|
url, params = @sdk_configuration.get_server_details
|
847
2225
|
base_url = Utils.template_url(url, params)
|
@@ -864,14 +2242,62 @@ module StackOne
|
|
864
2242
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
865
2243
|
retry_options[:retry_statuses] = [429, 408]
|
866
2244
|
|
2245
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2246
|
+
|
2247
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2248
|
+
timeout ||= @sdk_configuration.timeout
|
2249
|
+
|
867
2250
|
connection = @sdk_configuration.client.dup
|
868
2251
|
connection.request :retry, retry_options
|
869
2252
|
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
2253
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2254
|
+
base_url: base_url,
|
2255
|
+
oauth2_scopes: nil,
|
2256
|
+
operation_id: 'marketing_list_campaigns',
|
2257
|
+
security_source: @sdk_configuration.security_source
|
2258
|
+
)
|
2259
|
+
|
2260
|
+
error = T.let(nil, T.nilable(StandardError))
|
2261
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2262
|
+
|
2263
|
+
begin
|
2264
|
+
r = connection.get(url) do |req|
|
2265
|
+
req.headers.merge!(headers)
|
2266
|
+
req.options.timeout = timeout unless timeout.nil?
|
2267
|
+
req.params = query_params
|
2268
|
+
Utils.configure_request_security(req, security)
|
2269
|
+
|
2270
|
+
@sdk_configuration.hooks.before_request(
|
2271
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2272
|
+
hook_ctx: hook_ctx
|
2273
|
+
),
|
2274
|
+
request: req
|
2275
|
+
)
|
2276
|
+
end
|
2277
|
+
rescue StandardError => e
|
2278
|
+
error = e
|
2279
|
+
ensure
|
2280
|
+
if r.nil? || Utils.error_status?(r.status)
|
2281
|
+
r = @sdk_configuration.hooks.after_error(
|
2282
|
+
error: error,
|
2283
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2284
|
+
hook_ctx: hook_ctx
|
2285
|
+
),
|
2286
|
+
response: r
|
2287
|
+
)
|
2288
|
+
else
|
2289
|
+
r = @sdk_configuration.hooks.after_success(
|
2290
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2291
|
+
hook_ctx: hook_ctx
|
2292
|
+
),
|
2293
|
+
response: r
|
2294
|
+
)
|
2295
|
+
end
|
2296
|
+
|
2297
|
+
if r.nil?
|
2298
|
+
raise error if !error.nil?
|
2299
|
+
raise 'no response'
|
2300
|
+
end
|
875
2301
|
end
|
876
2302
|
|
877
2303
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -884,18 +2310,75 @@ module StackOne
|
|
884
2310
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CampaignsPaginated)
|
885
2311
|
res.campaigns_paginated = out
|
886
2312
|
end
|
2313
|
+
elsif r.status == 400
|
2314
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2315
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2316
|
+
res.bad_request_response = out
|
2317
|
+
end
|
2318
|
+
elsif r.status == 401
|
2319
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2320
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2321
|
+
res.unauthorized_response = out
|
2322
|
+
end
|
2323
|
+
elsif r.status == 403
|
2324
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2325
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2326
|
+
res.forbidden_response = out
|
2327
|
+
end
|
2328
|
+
elsif r.status == 404
|
2329
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2330
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2331
|
+
res.not_found_response = out
|
2332
|
+
end
|
887
2333
|
elsif r.status == 408
|
888
2334
|
res.headers = r.headers
|
889
|
-
|
890
|
-
|
2335
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2336
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2337
|
+
res.request_timed_out_response = out
|
2338
|
+
end
|
2339
|
+
elsif r.status == 409
|
2340
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2341
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2342
|
+
res.conflict_response = out
|
2343
|
+
end
|
2344
|
+
elsif r.status == 412
|
2345
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2346
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2347
|
+
res.precondition_failed_response = out
|
2348
|
+
end
|
2349
|
+
elsif r.status == 422
|
2350
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2351
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2352
|
+
res.unprocessable_entity_response = out
|
2353
|
+
end
|
2354
|
+
elsif r.status == 429
|
2355
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2356
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2357
|
+
res.too_many_requests_response = out
|
2358
|
+
end
|
2359
|
+
elsif r.status == 500
|
2360
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2361
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2362
|
+
res.internal_server_error_response = out
|
2363
|
+
end
|
2364
|
+
elsif r.status == 501
|
2365
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2366
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2367
|
+
res.not_implemented_response = out
|
2368
|
+
end
|
2369
|
+
elsif r.status == 502
|
2370
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2371
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2372
|
+
res.bad_gateway_response = out
|
2373
|
+
end
|
891
2374
|
end
|
892
2375
|
|
893
2376
|
res
|
894
2377
|
end
|
895
2378
|
|
896
2379
|
|
897
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListContentBlocksRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingListContentBlocksResponse) }
|
898
|
-
def list_content_blocks(request, retries = nil)
|
2380
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListContentBlocksRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListContentBlocksResponse) }
|
2381
|
+
def list_content_blocks(request, retries = nil, timeout_ms = nil)
|
899
2382
|
# list_content_blocks - List Content Blocks
|
900
2383
|
url, params = @sdk_configuration.get_server_details
|
901
2384
|
base_url = Utils.template_url(url, params)
|
@@ -918,14 +2401,62 @@ module StackOne
|
|
918
2401
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
919
2402
|
retry_options[:retry_statuses] = [429, 408]
|
920
2403
|
|
2404
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2405
|
+
|
2406
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2407
|
+
timeout ||= @sdk_configuration.timeout
|
2408
|
+
|
921
2409
|
connection = @sdk_configuration.client.dup
|
922
2410
|
connection.request :retry, retry_options
|
923
2411
|
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
2412
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2413
|
+
base_url: base_url,
|
2414
|
+
oauth2_scopes: nil,
|
2415
|
+
operation_id: 'marketing_list_content_blocks',
|
2416
|
+
security_source: @sdk_configuration.security_source
|
2417
|
+
)
|
2418
|
+
|
2419
|
+
error = T.let(nil, T.nilable(StandardError))
|
2420
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2421
|
+
|
2422
|
+
begin
|
2423
|
+
r = connection.get(url) do |req|
|
2424
|
+
req.headers.merge!(headers)
|
2425
|
+
req.options.timeout = timeout unless timeout.nil?
|
2426
|
+
req.params = query_params
|
2427
|
+
Utils.configure_request_security(req, security)
|
2428
|
+
|
2429
|
+
@sdk_configuration.hooks.before_request(
|
2430
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2431
|
+
hook_ctx: hook_ctx
|
2432
|
+
),
|
2433
|
+
request: req
|
2434
|
+
)
|
2435
|
+
end
|
2436
|
+
rescue StandardError => e
|
2437
|
+
error = e
|
2438
|
+
ensure
|
2439
|
+
if r.nil? || Utils.error_status?(r.status)
|
2440
|
+
r = @sdk_configuration.hooks.after_error(
|
2441
|
+
error: error,
|
2442
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2443
|
+
hook_ctx: hook_ctx
|
2444
|
+
),
|
2445
|
+
response: r
|
2446
|
+
)
|
2447
|
+
else
|
2448
|
+
r = @sdk_configuration.hooks.after_success(
|
2449
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2450
|
+
hook_ctx: hook_ctx
|
2451
|
+
),
|
2452
|
+
response: r
|
2453
|
+
)
|
2454
|
+
end
|
2455
|
+
|
2456
|
+
if r.nil?
|
2457
|
+
raise error if !error.nil?
|
2458
|
+
raise 'no response'
|
2459
|
+
end
|
929
2460
|
end
|
930
2461
|
|
931
2462
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -938,18 +2469,75 @@ module StackOne
|
|
938
2469
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ContentBlocksPaginated)
|
939
2470
|
res.content_blocks_paginated = out
|
940
2471
|
end
|
2472
|
+
elsif r.status == 400
|
2473
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2474
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2475
|
+
res.bad_request_response = out
|
2476
|
+
end
|
2477
|
+
elsif r.status == 401
|
2478
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2479
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2480
|
+
res.unauthorized_response = out
|
2481
|
+
end
|
2482
|
+
elsif r.status == 403
|
2483
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2484
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2485
|
+
res.forbidden_response = out
|
2486
|
+
end
|
2487
|
+
elsif r.status == 404
|
2488
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2489
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2490
|
+
res.not_found_response = out
|
2491
|
+
end
|
941
2492
|
elsif r.status == 408
|
942
2493
|
res.headers = r.headers
|
943
|
-
|
944
|
-
|
2494
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2495
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2496
|
+
res.request_timed_out_response = out
|
2497
|
+
end
|
2498
|
+
elsif r.status == 409
|
2499
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2500
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2501
|
+
res.conflict_response = out
|
2502
|
+
end
|
2503
|
+
elsif r.status == 412
|
2504
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2505
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2506
|
+
res.precondition_failed_response = out
|
2507
|
+
end
|
2508
|
+
elsif r.status == 422
|
2509
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2510
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2511
|
+
res.unprocessable_entity_response = out
|
2512
|
+
end
|
2513
|
+
elsif r.status == 429
|
2514
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2515
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2516
|
+
res.too_many_requests_response = out
|
2517
|
+
end
|
2518
|
+
elsif r.status == 500
|
2519
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2520
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2521
|
+
res.internal_server_error_response = out
|
2522
|
+
end
|
2523
|
+
elsif r.status == 501
|
2524
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2525
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2526
|
+
res.not_implemented_response = out
|
2527
|
+
end
|
2528
|
+
elsif r.status == 502
|
2529
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2530
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2531
|
+
res.bad_gateway_response = out
|
2532
|
+
end
|
945
2533
|
end
|
946
2534
|
|
947
2535
|
res
|
948
2536
|
end
|
949
2537
|
|
950
2538
|
|
951
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListEmailTemplatesRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingListEmailTemplatesResponse) }
|
952
|
-
def list_email_templates(request, retries = nil)
|
2539
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListEmailTemplatesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListEmailTemplatesResponse) }
|
2540
|
+
def list_email_templates(request, retries = nil, timeout_ms = nil)
|
953
2541
|
# list_email_templates - List Email Templates
|
954
2542
|
url, params = @sdk_configuration.get_server_details
|
955
2543
|
base_url = Utils.template_url(url, params)
|
@@ -972,14 +2560,62 @@ module StackOne
|
|
972
2560
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
973
2561
|
retry_options[:retry_statuses] = [429, 408]
|
974
2562
|
|
2563
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2564
|
+
|
2565
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2566
|
+
timeout ||= @sdk_configuration.timeout
|
2567
|
+
|
975
2568
|
connection = @sdk_configuration.client.dup
|
976
2569
|
connection.request :retry, retry_options
|
977
2570
|
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
2571
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2572
|
+
base_url: base_url,
|
2573
|
+
oauth2_scopes: nil,
|
2574
|
+
operation_id: 'marketing_list_email_templates',
|
2575
|
+
security_source: @sdk_configuration.security_source
|
2576
|
+
)
|
2577
|
+
|
2578
|
+
error = T.let(nil, T.nilable(StandardError))
|
2579
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2580
|
+
|
2581
|
+
begin
|
2582
|
+
r = connection.get(url) do |req|
|
2583
|
+
req.headers.merge!(headers)
|
2584
|
+
req.options.timeout = timeout unless timeout.nil?
|
2585
|
+
req.params = query_params
|
2586
|
+
Utils.configure_request_security(req, security)
|
2587
|
+
|
2588
|
+
@sdk_configuration.hooks.before_request(
|
2589
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2590
|
+
hook_ctx: hook_ctx
|
2591
|
+
),
|
2592
|
+
request: req
|
2593
|
+
)
|
2594
|
+
end
|
2595
|
+
rescue StandardError => e
|
2596
|
+
error = e
|
2597
|
+
ensure
|
2598
|
+
if r.nil? || Utils.error_status?(r.status)
|
2599
|
+
r = @sdk_configuration.hooks.after_error(
|
2600
|
+
error: error,
|
2601
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2602
|
+
hook_ctx: hook_ctx
|
2603
|
+
),
|
2604
|
+
response: r
|
2605
|
+
)
|
2606
|
+
else
|
2607
|
+
r = @sdk_configuration.hooks.after_success(
|
2608
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2609
|
+
hook_ctx: hook_ctx
|
2610
|
+
),
|
2611
|
+
response: r
|
2612
|
+
)
|
2613
|
+
end
|
2614
|
+
|
2615
|
+
if r.nil?
|
2616
|
+
raise error if !error.nil?
|
2617
|
+
raise 'no response'
|
2618
|
+
end
|
983
2619
|
end
|
984
2620
|
|
985
2621
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -992,18 +2628,75 @@ module StackOne
|
|
992
2628
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::EmailTemplatesPaginated)
|
993
2629
|
res.email_templates_paginated = out
|
994
2630
|
end
|
2631
|
+
elsif r.status == 400
|
2632
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2633
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2634
|
+
res.bad_request_response = out
|
2635
|
+
end
|
2636
|
+
elsif r.status == 401
|
2637
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2638
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2639
|
+
res.unauthorized_response = out
|
2640
|
+
end
|
2641
|
+
elsif r.status == 403
|
2642
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2643
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2644
|
+
res.forbidden_response = out
|
2645
|
+
end
|
2646
|
+
elsif r.status == 404
|
2647
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2648
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2649
|
+
res.not_found_response = out
|
2650
|
+
end
|
995
2651
|
elsif r.status == 408
|
996
2652
|
res.headers = r.headers
|
997
|
-
|
998
|
-
|
2653
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2654
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2655
|
+
res.request_timed_out_response = out
|
2656
|
+
end
|
2657
|
+
elsif r.status == 409
|
2658
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2659
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2660
|
+
res.conflict_response = out
|
2661
|
+
end
|
2662
|
+
elsif r.status == 412
|
2663
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2664
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2665
|
+
res.precondition_failed_response = out
|
2666
|
+
end
|
2667
|
+
elsif r.status == 422
|
2668
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2669
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2670
|
+
res.unprocessable_entity_response = out
|
2671
|
+
end
|
2672
|
+
elsif r.status == 429
|
2673
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2674
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2675
|
+
res.too_many_requests_response = out
|
2676
|
+
end
|
2677
|
+
elsif r.status == 500
|
2678
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2679
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2680
|
+
res.internal_server_error_response = out
|
2681
|
+
end
|
2682
|
+
elsif r.status == 501
|
2683
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2684
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2685
|
+
res.not_implemented_response = out
|
2686
|
+
end
|
2687
|
+
elsif r.status == 502
|
2688
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2689
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2690
|
+
res.bad_gateway_response = out
|
2691
|
+
end
|
999
2692
|
end
|
1000
2693
|
|
1001
2694
|
res
|
1002
2695
|
end
|
1003
2696
|
|
1004
2697
|
|
1005
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListInAppTemplatesRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingListInAppTemplatesResponse) }
|
1006
|
-
def list_in_app_templates(request, retries = nil)
|
2698
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListInAppTemplatesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListInAppTemplatesResponse) }
|
2699
|
+
def list_in_app_templates(request, retries = nil, timeout_ms = nil)
|
1007
2700
|
# list_in_app_templates - List In-App Templates
|
1008
2701
|
url, params = @sdk_configuration.get_server_details
|
1009
2702
|
base_url = Utils.template_url(url, params)
|
@@ -1026,14 +2719,62 @@ module StackOne
|
|
1026
2719
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1027
2720
|
retry_options[:retry_statuses] = [429, 408]
|
1028
2721
|
|
2722
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2723
|
+
|
2724
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2725
|
+
timeout ||= @sdk_configuration.timeout
|
2726
|
+
|
1029
2727
|
connection = @sdk_configuration.client.dup
|
1030
2728
|
connection.request :retry, retry_options
|
1031
2729
|
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
2730
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2731
|
+
base_url: base_url,
|
2732
|
+
oauth2_scopes: nil,
|
2733
|
+
operation_id: 'marketing_list_in_app_templates',
|
2734
|
+
security_source: @sdk_configuration.security_source
|
2735
|
+
)
|
2736
|
+
|
2737
|
+
error = T.let(nil, T.nilable(StandardError))
|
2738
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2739
|
+
|
2740
|
+
begin
|
2741
|
+
r = connection.get(url) do |req|
|
2742
|
+
req.headers.merge!(headers)
|
2743
|
+
req.options.timeout = timeout unless timeout.nil?
|
2744
|
+
req.params = query_params
|
2745
|
+
Utils.configure_request_security(req, security)
|
2746
|
+
|
2747
|
+
@sdk_configuration.hooks.before_request(
|
2748
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2749
|
+
hook_ctx: hook_ctx
|
2750
|
+
),
|
2751
|
+
request: req
|
2752
|
+
)
|
2753
|
+
end
|
2754
|
+
rescue StandardError => e
|
2755
|
+
error = e
|
2756
|
+
ensure
|
2757
|
+
if r.nil? || Utils.error_status?(r.status)
|
2758
|
+
r = @sdk_configuration.hooks.after_error(
|
2759
|
+
error: error,
|
2760
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2761
|
+
hook_ctx: hook_ctx
|
2762
|
+
),
|
2763
|
+
response: r
|
2764
|
+
)
|
2765
|
+
else
|
2766
|
+
r = @sdk_configuration.hooks.after_success(
|
2767
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2768
|
+
hook_ctx: hook_ctx
|
2769
|
+
),
|
2770
|
+
response: r
|
2771
|
+
)
|
2772
|
+
end
|
2773
|
+
|
2774
|
+
if r.nil?
|
2775
|
+
raise error if !error.nil?
|
2776
|
+
raise 'no response'
|
2777
|
+
end
|
1037
2778
|
end
|
1038
2779
|
|
1039
2780
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1046,18 +2787,75 @@ module StackOne
|
|
1046
2787
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InAppTemplatesPaginated)
|
1047
2788
|
res.in_app_templates_paginated = out
|
1048
2789
|
end
|
2790
|
+
elsif r.status == 400
|
2791
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2792
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2793
|
+
res.bad_request_response = out
|
2794
|
+
end
|
2795
|
+
elsif r.status == 401
|
2796
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2797
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2798
|
+
res.unauthorized_response = out
|
2799
|
+
end
|
2800
|
+
elsif r.status == 403
|
2801
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2802
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2803
|
+
res.forbidden_response = out
|
2804
|
+
end
|
2805
|
+
elsif r.status == 404
|
2806
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2807
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2808
|
+
res.not_found_response = out
|
2809
|
+
end
|
1049
2810
|
elsif r.status == 408
|
1050
2811
|
res.headers = r.headers
|
1051
|
-
|
1052
|
-
|
2812
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2813
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2814
|
+
res.request_timed_out_response = out
|
2815
|
+
end
|
2816
|
+
elsif r.status == 409
|
2817
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2818
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2819
|
+
res.conflict_response = out
|
2820
|
+
end
|
2821
|
+
elsif r.status == 412
|
2822
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2823
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2824
|
+
res.precondition_failed_response = out
|
2825
|
+
end
|
2826
|
+
elsif r.status == 422
|
2827
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2828
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2829
|
+
res.unprocessable_entity_response = out
|
2830
|
+
end
|
2831
|
+
elsif r.status == 429
|
2832
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2833
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2834
|
+
res.too_many_requests_response = out
|
2835
|
+
end
|
2836
|
+
elsif r.status == 500
|
2837
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2838
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2839
|
+
res.internal_server_error_response = out
|
2840
|
+
end
|
2841
|
+
elsif r.status == 501
|
2842
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2843
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2844
|
+
res.not_implemented_response = out
|
2845
|
+
end
|
2846
|
+
elsif r.status == 502
|
2847
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2848
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2849
|
+
res.bad_gateway_response = out
|
2850
|
+
end
|
1053
2851
|
end
|
1054
2852
|
|
1055
2853
|
res
|
1056
2854
|
end
|
1057
2855
|
|
1058
2856
|
|
1059
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListOmniChannelTemplatesRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingListOmniChannelTemplatesResponse) }
|
1060
|
-
def list_omni_channel_templates(request, retries = nil)
|
2857
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListOmniChannelTemplatesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListOmniChannelTemplatesResponse) }
|
2858
|
+
def list_omni_channel_templates(request, retries = nil, timeout_ms = nil)
|
1061
2859
|
# list_omni_channel_templates - List Omni-Channel Templates
|
1062
2860
|
#
|
1063
2861
|
# @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
@@ -1082,14 +2880,62 @@ module StackOne
|
|
1082
2880
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1083
2881
|
retry_options[:retry_statuses] = [429, 408]
|
1084
2882
|
|
2883
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2884
|
+
|
2885
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2886
|
+
timeout ||= @sdk_configuration.timeout
|
2887
|
+
|
1085
2888
|
connection = @sdk_configuration.client.dup
|
1086
2889
|
connection.request :retry, retry_options
|
1087
2890
|
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
2891
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2892
|
+
base_url: base_url,
|
2893
|
+
oauth2_scopes: nil,
|
2894
|
+
operation_id: 'marketing_list_omni_channel_templates',
|
2895
|
+
security_source: @sdk_configuration.security_source
|
2896
|
+
)
|
2897
|
+
|
2898
|
+
error = T.let(nil, T.nilable(StandardError))
|
2899
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2900
|
+
|
2901
|
+
begin
|
2902
|
+
r = connection.get(url) do |req|
|
2903
|
+
req.headers.merge!(headers)
|
2904
|
+
req.options.timeout = timeout unless timeout.nil?
|
2905
|
+
req.params = query_params
|
2906
|
+
Utils.configure_request_security(req, security)
|
2907
|
+
|
2908
|
+
@sdk_configuration.hooks.before_request(
|
2909
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2910
|
+
hook_ctx: hook_ctx
|
2911
|
+
),
|
2912
|
+
request: req
|
2913
|
+
)
|
2914
|
+
end
|
2915
|
+
rescue StandardError => e
|
2916
|
+
error = e
|
2917
|
+
ensure
|
2918
|
+
if r.nil? || Utils.error_status?(r.status)
|
2919
|
+
r = @sdk_configuration.hooks.after_error(
|
2920
|
+
error: error,
|
2921
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2922
|
+
hook_ctx: hook_ctx
|
2923
|
+
),
|
2924
|
+
response: r
|
2925
|
+
)
|
2926
|
+
else
|
2927
|
+
r = @sdk_configuration.hooks.after_success(
|
2928
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2929
|
+
hook_ctx: hook_ctx
|
2930
|
+
),
|
2931
|
+
response: r
|
2932
|
+
)
|
2933
|
+
end
|
2934
|
+
|
2935
|
+
if r.nil?
|
2936
|
+
raise error if !error.nil?
|
2937
|
+
raise 'no response'
|
2938
|
+
end
|
1093
2939
|
end
|
1094
2940
|
|
1095
2941
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1102,18 +2948,75 @@ module StackOne
|
|
1102
2948
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TemplatesPaginated)
|
1103
2949
|
res.templates_paginated = out
|
1104
2950
|
end
|
2951
|
+
elsif r.status == 400
|
2952
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2953
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2954
|
+
res.bad_request_response = out
|
2955
|
+
end
|
2956
|
+
elsif r.status == 401
|
2957
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2958
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2959
|
+
res.unauthorized_response = out
|
2960
|
+
end
|
2961
|
+
elsif r.status == 403
|
2962
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2963
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2964
|
+
res.forbidden_response = out
|
2965
|
+
end
|
2966
|
+
elsif r.status == 404
|
2967
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2968
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2969
|
+
res.not_found_response = out
|
2970
|
+
end
|
1105
2971
|
elsif r.status == 408
|
1106
2972
|
res.headers = r.headers
|
1107
|
-
|
1108
|
-
|
2973
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2974
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2975
|
+
res.request_timed_out_response = out
|
2976
|
+
end
|
2977
|
+
elsif r.status == 409
|
2978
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2979
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2980
|
+
res.conflict_response = out
|
2981
|
+
end
|
2982
|
+
elsif r.status == 412
|
2983
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2984
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2985
|
+
res.precondition_failed_response = out
|
2986
|
+
end
|
2987
|
+
elsif r.status == 422
|
2988
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2989
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2990
|
+
res.unprocessable_entity_response = out
|
2991
|
+
end
|
2992
|
+
elsif r.status == 429
|
2993
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2994
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2995
|
+
res.too_many_requests_response = out
|
2996
|
+
end
|
2997
|
+
elsif r.status == 500
|
2998
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2999
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3000
|
+
res.internal_server_error_response = out
|
3001
|
+
end
|
3002
|
+
elsif r.status == 501
|
3003
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3004
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3005
|
+
res.not_implemented_response = out
|
3006
|
+
end
|
3007
|
+
elsif r.status == 502
|
3008
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3009
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3010
|
+
res.bad_gateway_response = out
|
3011
|
+
end
|
1109
3012
|
end
|
1110
3013
|
|
1111
3014
|
res
|
1112
3015
|
end
|
1113
3016
|
|
1114
3017
|
|
1115
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListPushTemplatesRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingListPushTemplatesResponse) }
|
1116
|
-
def list_push_templates(request, retries = nil)
|
3018
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListPushTemplatesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListPushTemplatesResponse) }
|
3019
|
+
def list_push_templates(request, retries = nil, timeout_ms = nil)
|
1117
3020
|
# list_push_templates - List Push Templates
|
1118
3021
|
url, params = @sdk_configuration.get_server_details
|
1119
3022
|
base_url = Utils.template_url(url, params)
|
@@ -1136,14 +3039,62 @@ module StackOne
|
|
1136
3039
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1137
3040
|
retry_options[:retry_statuses] = [429, 408]
|
1138
3041
|
|
3042
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3043
|
+
|
3044
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3045
|
+
timeout ||= @sdk_configuration.timeout
|
3046
|
+
|
1139
3047
|
connection = @sdk_configuration.client.dup
|
1140
3048
|
connection.request :retry, retry_options
|
1141
3049
|
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
3050
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3051
|
+
base_url: base_url,
|
3052
|
+
oauth2_scopes: nil,
|
3053
|
+
operation_id: 'marketing_list_push_templates',
|
3054
|
+
security_source: @sdk_configuration.security_source
|
3055
|
+
)
|
3056
|
+
|
3057
|
+
error = T.let(nil, T.nilable(StandardError))
|
3058
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3059
|
+
|
3060
|
+
begin
|
3061
|
+
r = connection.get(url) do |req|
|
3062
|
+
req.headers.merge!(headers)
|
3063
|
+
req.options.timeout = timeout unless timeout.nil?
|
3064
|
+
req.params = query_params
|
3065
|
+
Utils.configure_request_security(req, security)
|
3066
|
+
|
3067
|
+
@sdk_configuration.hooks.before_request(
|
3068
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3069
|
+
hook_ctx: hook_ctx
|
3070
|
+
),
|
3071
|
+
request: req
|
3072
|
+
)
|
3073
|
+
end
|
3074
|
+
rescue StandardError => e
|
3075
|
+
error = e
|
3076
|
+
ensure
|
3077
|
+
if r.nil? || Utils.error_status?(r.status)
|
3078
|
+
r = @sdk_configuration.hooks.after_error(
|
3079
|
+
error: error,
|
3080
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3081
|
+
hook_ctx: hook_ctx
|
3082
|
+
),
|
3083
|
+
response: r
|
3084
|
+
)
|
3085
|
+
else
|
3086
|
+
r = @sdk_configuration.hooks.after_success(
|
3087
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3088
|
+
hook_ctx: hook_ctx
|
3089
|
+
),
|
3090
|
+
response: r
|
3091
|
+
)
|
3092
|
+
end
|
3093
|
+
|
3094
|
+
if r.nil?
|
3095
|
+
raise error if !error.nil?
|
3096
|
+
raise 'no response'
|
3097
|
+
end
|
1147
3098
|
end
|
1148
3099
|
|
1149
3100
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1156,18 +3107,75 @@ module StackOne
|
|
1156
3107
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PushTemplatesPaginated)
|
1157
3108
|
res.push_templates_paginated = out
|
1158
3109
|
end
|
3110
|
+
elsif r.status == 400
|
3111
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3112
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3113
|
+
res.bad_request_response = out
|
3114
|
+
end
|
3115
|
+
elsif r.status == 401
|
3116
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3117
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3118
|
+
res.unauthorized_response = out
|
3119
|
+
end
|
3120
|
+
elsif r.status == 403
|
3121
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3122
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
3123
|
+
res.forbidden_response = out
|
3124
|
+
end
|
3125
|
+
elsif r.status == 404
|
3126
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3127
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
3128
|
+
res.not_found_response = out
|
3129
|
+
end
|
1159
3130
|
elsif r.status == 408
|
1160
3131
|
res.headers = r.headers
|
1161
|
-
|
1162
|
-
|
3132
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3133
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
3134
|
+
res.request_timed_out_response = out
|
3135
|
+
end
|
3136
|
+
elsif r.status == 409
|
3137
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3138
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
3139
|
+
res.conflict_response = out
|
3140
|
+
end
|
3141
|
+
elsif r.status == 412
|
3142
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3143
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
3144
|
+
res.precondition_failed_response = out
|
3145
|
+
end
|
3146
|
+
elsif r.status == 422
|
3147
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3148
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3149
|
+
res.unprocessable_entity_response = out
|
3150
|
+
end
|
3151
|
+
elsif r.status == 429
|
3152
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3153
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3154
|
+
res.too_many_requests_response = out
|
3155
|
+
end
|
3156
|
+
elsif r.status == 500
|
3157
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3158
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3159
|
+
res.internal_server_error_response = out
|
3160
|
+
end
|
3161
|
+
elsif r.status == 501
|
3162
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3163
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3164
|
+
res.not_implemented_response = out
|
3165
|
+
end
|
3166
|
+
elsif r.status == 502
|
3167
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3168
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3169
|
+
res.bad_gateway_response = out
|
3170
|
+
end
|
1163
3171
|
end
|
1164
3172
|
|
1165
3173
|
res
|
1166
3174
|
end
|
1167
3175
|
|
1168
3176
|
|
1169
|
-
sig { params(request: T.nilable(::StackOne::Operations::MarketingListSmsTemplatesRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingListSmsTemplatesResponse) }
|
1170
|
-
def list_sms_templates(request, retries = nil)
|
3177
|
+
sig { params(request: T.nilable(::StackOne::Operations::MarketingListSmsTemplatesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::MarketingListSmsTemplatesResponse) }
|
3178
|
+
def list_sms_templates(request, retries = nil, timeout_ms = nil)
|
1171
3179
|
# list_sms_templates - List SMS Templates
|
1172
3180
|
url, params = @sdk_configuration.get_server_details
|
1173
3181
|
base_url = Utils.template_url(url, params)
|
@@ -1190,14 +3198,62 @@ module StackOne
|
|
1190
3198
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1191
3199
|
retry_options[:retry_statuses] = [429, 408]
|
1192
3200
|
|
3201
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3202
|
+
|
3203
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3204
|
+
timeout ||= @sdk_configuration.timeout
|
3205
|
+
|
1193
3206
|
connection = @sdk_configuration.client.dup
|
1194
3207
|
connection.request :retry, retry_options
|
1195
3208
|
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
3209
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3210
|
+
base_url: base_url,
|
3211
|
+
oauth2_scopes: nil,
|
3212
|
+
operation_id: 'marketing_list_sms_templates',
|
3213
|
+
security_source: @sdk_configuration.security_source
|
3214
|
+
)
|
3215
|
+
|
3216
|
+
error = T.let(nil, T.nilable(StandardError))
|
3217
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3218
|
+
|
3219
|
+
begin
|
3220
|
+
r = connection.get(url) do |req|
|
3221
|
+
req.headers.merge!(headers)
|
3222
|
+
req.options.timeout = timeout unless timeout.nil?
|
3223
|
+
req.params = query_params
|
3224
|
+
Utils.configure_request_security(req, security)
|
3225
|
+
|
3226
|
+
@sdk_configuration.hooks.before_request(
|
3227
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3228
|
+
hook_ctx: hook_ctx
|
3229
|
+
),
|
3230
|
+
request: req
|
3231
|
+
)
|
3232
|
+
end
|
3233
|
+
rescue StandardError => e
|
3234
|
+
error = e
|
3235
|
+
ensure
|
3236
|
+
if r.nil? || Utils.error_status?(r.status)
|
3237
|
+
r = @sdk_configuration.hooks.after_error(
|
3238
|
+
error: error,
|
3239
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3240
|
+
hook_ctx: hook_ctx
|
3241
|
+
),
|
3242
|
+
response: r
|
3243
|
+
)
|
3244
|
+
else
|
3245
|
+
r = @sdk_configuration.hooks.after_success(
|
3246
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3247
|
+
hook_ctx: hook_ctx
|
3248
|
+
),
|
3249
|
+
response: r
|
3250
|
+
)
|
3251
|
+
end
|
3252
|
+
|
3253
|
+
if r.nil?
|
3254
|
+
raise error if !error.nil?
|
3255
|
+
raise 'no response'
|
3256
|
+
end
|
1201
3257
|
end
|
1202
3258
|
|
1203
3259
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1210,18 +3266,75 @@ module StackOne
|
|
1210
3266
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::SmsTemplatesPaginated)
|
1211
3267
|
res.sms_templates_paginated = out
|
1212
3268
|
end
|
3269
|
+
elsif r.status == 400
|
3270
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3271
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3272
|
+
res.bad_request_response = out
|
3273
|
+
end
|
3274
|
+
elsif r.status == 401
|
3275
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3276
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3277
|
+
res.unauthorized_response = out
|
3278
|
+
end
|
3279
|
+
elsif r.status == 403
|
3280
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3281
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
3282
|
+
res.forbidden_response = out
|
3283
|
+
end
|
3284
|
+
elsif r.status == 404
|
3285
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3286
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
3287
|
+
res.not_found_response = out
|
3288
|
+
end
|
1213
3289
|
elsif r.status == 408
|
1214
3290
|
res.headers = r.headers
|
1215
|
-
|
1216
|
-
|
3291
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3292
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
3293
|
+
res.request_timed_out_response = out
|
3294
|
+
end
|
3295
|
+
elsif r.status == 409
|
3296
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3297
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
3298
|
+
res.conflict_response = out
|
3299
|
+
end
|
3300
|
+
elsif r.status == 412
|
3301
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3302
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
3303
|
+
res.precondition_failed_response = out
|
3304
|
+
end
|
3305
|
+
elsif r.status == 422
|
3306
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3307
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3308
|
+
res.unprocessable_entity_response = out
|
3309
|
+
end
|
3310
|
+
elsif r.status == 429
|
3311
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3312
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3313
|
+
res.too_many_requests_response = out
|
3314
|
+
end
|
3315
|
+
elsif r.status == 500
|
3316
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3317
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3318
|
+
res.internal_server_error_response = out
|
3319
|
+
end
|
3320
|
+
elsif r.status == 501
|
3321
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3322
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3323
|
+
res.not_implemented_response = out
|
3324
|
+
end
|
3325
|
+
elsif r.status == 502
|
3326
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3327
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3328
|
+
res.bad_gateway_response = out
|
3329
|
+
end
|
1217
3330
|
end
|
1218
3331
|
|
1219
3332
|
res
|
1220
3333
|
end
|
1221
3334
|
|
1222
3335
|
|
1223
|
-
sig { params(marketing_create_content_blocks_request_dto: ::StackOne::Shared::MarketingCreateContentBlocksRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingUpdateContentBlockResponse) }
|
1224
|
-
def update_content_block(marketing_create_content_blocks_request_dto, id, x_account_id, retries = nil)
|
3336
|
+
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) }
|
3337
|
+
def update_content_block(marketing_create_content_blocks_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1225
3338
|
# update_content_block - Update Content Block
|
1226
3339
|
request = ::StackOne::Operations::MarketingUpdateContentBlockRequest.new(
|
1227
3340
|
|
@@ -1241,6 +3354,14 @@ module StackOne
|
|
1241
3354
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_content_blocks_request_dto, :json)
|
1242
3355
|
headers['content-type'] = req_content_type
|
1243
3356
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
3357
|
+
|
3358
|
+
if form
|
3359
|
+
body = Utils.encode_form(form)
|
3360
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
3361
|
+
body = URI.encode_www_form(data)
|
3362
|
+
else
|
3363
|
+
body = data
|
3364
|
+
end
|
1244
3365
|
headers['Accept'] = 'application/json'
|
1245
3366
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1246
3367
|
retries ||= @sdk_configuration.retry_config
|
@@ -1257,19 +3378,61 @@ module StackOne
|
|
1257
3378
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1258
3379
|
retry_options[:retry_statuses] = [429, 408]
|
1259
3380
|
|
3381
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3382
|
+
|
3383
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3384
|
+
timeout ||= @sdk_configuration.timeout
|
3385
|
+
|
1260
3386
|
connection = @sdk_configuration.client.dup
|
1261
3387
|
connection.request :retry, retry_options
|
1262
3388
|
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
3389
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3390
|
+
base_url: base_url,
|
3391
|
+
oauth2_scopes: nil,
|
3392
|
+
operation_id: 'marketing_update_content_block',
|
3393
|
+
security_source: @sdk_configuration.security_source
|
3394
|
+
)
|
3395
|
+
|
3396
|
+
error = T.let(nil, T.nilable(StandardError))
|
3397
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3398
|
+
|
3399
|
+
begin
|
3400
|
+
r = connection.patch(url) do |req|
|
3401
|
+
req.body = body
|
3402
|
+
req.headers.merge!(headers)
|
3403
|
+
req.options.timeout = timeout unless timeout.nil?
|
3404
|
+
Utils.configure_request_security(req, security)
|
3405
|
+
|
3406
|
+
@sdk_configuration.hooks.before_request(
|
3407
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3408
|
+
hook_ctx: hook_ctx
|
3409
|
+
),
|
3410
|
+
request: req
|
3411
|
+
)
|
3412
|
+
end
|
3413
|
+
rescue StandardError => e
|
3414
|
+
error = e
|
3415
|
+
ensure
|
3416
|
+
if r.nil? || Utils.error_status?(r.status)
|
3417
|
+
r = @sdk_configuration.hooks.after_error(
|
3418
|
+
error: error,
|
3419
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3420
|
+
hook_ctx: hook_ctx
|
3421
|
+
),
|
3422
|
+
response: r
|
3423
|
+
)
|
1271
3424
|
else
|
1272
|
-
|
3425
|
+
r = @sdk_configuration.hooks.after_success(
|
3426
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3427
|
+
hook_ctx: hook_ctx
|
3428
|
+
),
|
3429
|
+
response: r
|
3430
|
+
)
|
3431
|
+
end
|
3432
|
+
|
3433
|
+
if r.nil?
|
3434
|
+
raise error if !error.nil?
|
3435
|
+
raise 'no response'
|
1273
3436
|
end
|
1274
3437
|
end
|
1275
3438
|
|
@@ -1283,18 +3446,75 @@ module StackOne
|
|
1283
3446
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
1284
3447
|
res.create_result = out
|
1285
3448
|
end
|
3449
|
+
elsif r.status == 400
|
3450
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3451
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3452
|
+
res.bad_request_response = out
|
3453
|
+
end
|
3454
|
+
elsif r.status == 401
|
3455
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3456
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3457
|
+
res.unauthorized_response = out
|
3458
|
+
end
|
3459
|
+
elsif r.status == 403
|
3460
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3461
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
3462
|
+
res.forbidden_response = out
|
3463
|
+
end
|
3464
|
+
elsif r.status == 404
|
3465
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3466
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
3467
|
+
res.not_found_response = out
|
3468
|
+
end
|
1286
3469
|
elsif r.status == 408
|
1287
3470
|
res.headers = r.headers
|
1288
|
-
|
1289
|
-
|
3471
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3472
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
3473
|
+
res.request_timed_out_response = out
|
3474
|
+
end
|
3475
|
+
elsif r.status == 409
|
3476
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3477
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
3478
|
+
res.conflict_response = out
|
3479
|
+
end
|
3480
|
+
elsif r.status == 412
|
3481
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3482
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
3483
|
+
res.precondition_failed_response = out
|
3484
|
+
end
|
3485
|
+
elsif r.status == 422
|
3486
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3487
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3488
|
+
res.unprocessable_entity_response = out
|
3489
|
+
end
|
3490
|
+
elsif r.status == 429
|
3491
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3492
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3493
|
+
res.too_many_requests_response = out
|
3494
|
+
end
|
3495
|
+
elsif r.status == 500
|
3496
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3497
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3498
|
+
res.internal_server_error_response = out
|
3499
|
+
end
|
3500
|
+
elsif r.status == 501
|
3501
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3502
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3503
|
+
res.not_implemented_response = out
|
3504
|
+
end
|
3505
|
+
elsif r.status == 502
|
3506
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3507
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3508
|
+
res.bad_gateway_response = out
|
3509
|
+
end
|
1290
3510
|
end
|
1291
3511
|
|
1292
3512
|
res
|
1293
3513
|
end
|
1294
3514
|
|
1295
3515
|
|
1296
|
-
sig { params(marketing_create_email_template_request_dto: ::StackOne::Shared::MarketingCreateEmailTemplateRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingUpdateEmailTemplateResponse) }
|
1297
|
-
def update_email_template(marketing_create_email_template_request_dto, id, x_account_id, retries = nil)
|
3516
|
+
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) }
|
3517
|
+
def update_email_template(marketing_create_email_template_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1298
3518
|
# update_email_template - Update Email Templates
|
1299
3519
|
request = ::StackOne::Operations::MarketingUpdateEmailTemplateRequest.new(
|
1300
3520
|
|
@@ -1314,6 +3534,14 @@ module StackOne
|
|
1314
3534
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_email_template_request_dto, :json)
|
1315
3535
|
headers['content-type'] = req_content_type
|
1316
3536
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
3537
|
+
|
3538
|
+
if form
|
3539
|
+
body = Utils.encode_form(form)
|
3540
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
3541
|
+
body = URI.encode_www_form(data)
|
3542
|
+
else
|
3543
|
+
body = data
|
3544
|
+
end
|
1317
3545
|
headers['Accept'] = 'application/json'
|
1318
3546
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1319
3547
|
retries ||= @sdk_configuration.retry_config
|
@@ -1330,19 +3558,61 @@ module StackOne
|
|
1330
3558
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1331
3559
|
retry_options[:retry_statuses] = [429, 408]
|
1332
3560
|
|
3561
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3562
|
+
|
3563
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3564
|
+
timeout ||= @sdk_configuration.timeout
|
3565
|
+
|
1333
3566
|
connection = @sdk_configuration.client.dup
|
1334
3567
|
connection.request :retry, retry_options
|
1335
3568
|
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
3569
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3570
|
+
base_url: base_url,
|
3571
|
+
oauth2_scopes: nil,
|
3572
|
+
operation_id: 'marketing_update_email_template',
|
3573
|
+
security_source: @sdk_configuration.security_source
|
3574
|
+
)
|
3575
|
+
|
3576
|
+
error = T.let(nil, T.nilable(StandardError))
|
3577
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3578
|
+
|
3579
|
+
begin
|
3580
|
+
r = connection.patch(url) do |req|
|
3581
|
+
req.body = body
|
3582
|
+
req.headers.merge!(headers)
|
3583
|
+
req.options.timeout = timeout unless timeout.nil?
|
3584
|
+
Utils.configure_request_security(req, security)
|
3585
|
+
|
3586
|
+
@sdk_configuration.hooks.before_request(
|
3587
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3588
|
+
hook_ctx: hook_ctx
|
3589
|
+
),
|
3590
|
+
request: req
|
3591
|
+
)
|
3592
|
+
end
|
3593
|
+
rescue StandardError => e
|
3594
|
+
error = e
|
3595
|
+
ensure
|
3596
|
+
if r.nil? || Utils.error_status?(r.status)
|
3597
|
+
r = @sdk_configuration.hooks.after_error(
|
3598
|
+
error: error,
|
3599
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3600
|
+
hook_ctx: hook_ctx
|
3601
|
+
),
|
3602
|
+
response: r
|
3603
|
+
)
|
1344
3604
|
else
|
1345
|
-
|
3605
|
+
r = @sdk_configuration.hooks.after_success(
|
3606
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3607
|
+
hook_ctx: hook_ctx
|
3608
|
+
),
|
3609
|
+
response: r
|
3610
|
+
)
|
3611
|
+
end
|
3612
|
+
|
3613
|
+
if r.nil?
|
3614
|
+
raise error if !error.nil?
|
3615
|
+
raise 'no response'
|
1346
3616
|
end
|
1347
3617
|
end
|
1348
3618
|
|
@@ -1356,18 +3626,75 @@ module StackOne
|
|
1356
3626
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
1357
3627
|
res.create_result = out
|
1358
3628
|
end
|
3629
|
+
elsif r.status == 400
|
3630
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3631
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3632
|
+
res.bad_request_response = out
|
3633
|
+
end
|
3634
|
+
elsif r.status == 401
|
3635
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3636
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3637
|
+
res.unauthorized_response = out
|
3638
|
+
end
|
3639
|
+
elsif r.status == 403
|
3640
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3641
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
3642
|
+
res.forbidden_response = out
|
3643
|
+
end
|
3644
|
+
elsif r.status == 404
|
3645
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3646
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
3647
|
+
res.not_found_response = out
|
3648
|
+
end
|
1359
3649
|
elsif r.status == 408
|
1360
3650
|
res.headers = r.headers
|
1361
|
-
|
1362
|
-
|
3651
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3652
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
3653
|
+
res.request_timed_out_response = out
|
3654
|
+
end
|
3655
|
+
elsif r.status == 409
|
3656
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3657
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
3658
|
+
res.conflict_response = out
|
3659
|
+
end
|
3660
|
+
elsif r.status == 412
|
3661
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3662
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
3663
|
+
res.precondition_failed_response = out
|
3664
|
+
end
|
3665
|
+
elsif r.status == 422
|
3666
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3667
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3668
|
+
res.unprocessable_entity_response = out
|
3669
|
+
end
|
3670
|
+
elsif r.status == 429
|
3671
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3672
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3673
|
+
res.too_many_requests_response = out
|
3674
|
+
end
|
3675
|
+
elsif r.status == 500
|
3676
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3677
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3678
|
+
res.internal_server_error_response = out
|
3679
|
+
end
|
3680
|
+
elsif r.status == 501
|
3681
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3682
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3683
|
+
res.not_implemented_response = out
|
3684
|
+
end
|
3685
|
+
elsif r.status == 502
|
3686
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3687
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3688
|
+
res.bad_gateway_response = out
|
3689
|
+
end
|
1363
3690
|
end
|
1364
3691
|
|
1365
3692
|
res
|
1366
3693
|
end
|
1367
3694
|
|
1368
3695
|
|
1369
|
-
sig { params(marketing_create_in_app_template_request_dto: ::StackOne::Shared::MarketingCreateInAppTemplateRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingUpdateInAppTemplateResponse) }
|
1370
|
-
def update_in_app_template(marketing_create_in_app_template_request_dto, id, x_account_id, retries = nil)
|
3696
|
+
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) }
|
3697
|
+
def update_in_app_template(marketing_create_in_app_template_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1371
3698
|
# update_in_app_template - Update In-App Template
|
1372
3699
|
request = ::StackOne::Operations::MarketingUpdateInAppTemplateRequest.new(
|
1373
3700
|
|
@@ -1387,6 +3714,14 @@ module StackOne
|
|
1387
3714
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_in_app_template_request_dto, :json)
|
1388
3715
|
headers['content-type'] = req_content_type
|
1389
3716
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
3717
|
+
|
3718
|
+
if form
|
3719
|
+
body = Utils.encode_form(form)
|
3720
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
3721
|
+
body = URI.encode_www_form(data)
|
3722
|
+
else
|
3723
|
+
body = data
|
3724
|
+
end
|
1390
3725
|
headers['Accept'] = 'application/json'
|
1391
3726
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1392
3727
|
retries ||= @sdk_configuration.retry_config
|
@@ -1403,19 +3738,61 @@ module StackOne
|
|
1403
3738
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1404
3739
|
retry_options[:retry_statuses] = [429, 408]
|
1405
3740
|
|
3741
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3742
|
+
|
3743
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3744
|
+
timeout ||= @sdk_configuration.timeout
|
3745
|
+
|
1406
3746
|
connection = @sdk_configuration.client.dup
|
1407
3747
|
connection.request :retry, retry_options
|
1408
3748
|
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
3749
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3750
|
+
base_url: base_url,
|
3751
|
+
oauth2_scopes: nil,
|
3752
|
+
operation_id: 'marketing_update_in_app_template',
|
3753
|
+
security_source: @sdk_configuration.security_source
|
3754
|
+
)
|
3755
|
+
|
3756
|
+
error = T.let(nil, T.nilable(StandardError))
|
3757
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3758
|
+
|
3759
|
+
begin
|
3760
|
+
r = connection.patch(url) do |req|
|
3761
|
+
req.body = body
|
3762
|
+
req.headers.merge!(headers)
|
3763
|
+
req.options.timeout = timeout unless timeout.nil?
|
3764
|
+
Utils.configure_request_security(req, security)
|
3765
|
+
|
3766
|
+
@sdk_configuration.hooks.before_request(
|
3767
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3768
|
+
hook_ctx: hook_ctx
|
3769
|
+
),
|
3770
|
+
request: req
|
3771
|
+
)
|
3772
|
+
end
|
3773
|
+
rescue StandardError => e
|
3774
|
+
error = e
|
3775
|
+
ensure
|
3776
|
+
if r.nil? || Utils.error_status?(r.status)
|
3777
|
+
r = @sdk_configuration.hooks.after_error(
|
3778
|
+
error: error,
|
3779
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3780
|
+
hook_ctx: hook_ctx
|
3781
|
+
),
|
3782
|
+
response: r
|
3783
|
+
)
|
1417
3784
|
else
|
1418
|
-
|
3785
|
+
r = @sdk_configuration.hooks.after_success(
|
3786
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3787
|
+
hook_ctx: hook_ctx
|
3788
|
+
),
|
3789
|
+
response: r
|
3790
|
+
)
|
3791
|
+
end
|
3792
|
+
|
3793
|
+
if r.nil?
|
3794
|
+
raise error if !error.nil?
|
3795
|
+
raise 'no response'
|
1419
3796
|
end
|
1420
3797
|
end
|
1421
3798
|
|
@@ -1429,18 +3806,75 @@ module StackOne
|
|
1429
3806
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
1430
3807
|
res.create_result = out
|
1431
3808
|
end
|
3809
|
+
elsif r.status == 400
|
3810
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3811
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3812
|
+
res.bad_request_response = out
|
3813
|
+
end
|
3814
|
+
elsif r.status == 401
|
3815
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3816
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3817
|
+
res.unauthorized_response = out
|
3818
|
+
end
|
3819
|
+
elsif r.status == 403
|
3820
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3821
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
3822
|
+
res.forbidden_response = out
|
3823
|
+
end
|
3824
|
+
elsif r.status == 404
|
3825
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3826
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
3827
|
+
res.not_found_response = out
|
3828
|
+
end
|
1432
3829
|
elsif r.status == 408
|
1433
3830
|
res.headers = r.headers
|
1434
|
-
|
1435
|
-
|
3831
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3832
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
3833
|
+
res.request_timed_out_response = out
|
3834
|
+
end
|
3835
|
+
elsif r.status == 409
|
3836
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3837
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
3838
|
+
res.conflict_response = out
|
3839
|
+
end
|
3840
|
+
elsif r.status == 412
|
3841
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3842
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
3843
|
+
res.precondition_failed_response = out
|
3844
|
+
end
|
3845
|
+
elsif r.status == 422
|
3846
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3847
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3848
|
+
res.unprocessable_entity_response = out
|
3849
|
+
end
|
3850
|
+
elsif r.status == 429
|
3851
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3852
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3853
|
+
res.too_many_requests_response = out
|
3854
|
+
end
|
3855
|
+
elsif r.status == 500
|
3856
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3857
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3858
|
+
res.internal_server_error_response = out
|
3859
|
+
end
|
3860
|
+
elsif r.status == 501
|
3861
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3862
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3863
|
+
res.not_implemented_response = out
|
3864
|
+
end
|
3865
|
+
elsif r.status == 502
|
3866
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3867
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3868
|
+
res.bad_gateway_response = out
|
3869
|
+
end
|
1436
3870
|
end
|
1437
3871
|
|
1438
3872
|
res
|
1439
3873
|
end
|
1440
3874
|
|
1441
3875
|
|
1442
|
-
sig { params(marketing_create_template_request_dto: ::StackOne::Shared::MarketingCreateTemplateRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingUpdateOmniChannelTemplateResponse) }
|
1443
|
-
def update_omni_channel_template(marketing_create_template_request_dto, id, x_account_id, retries = nil)
|
3876
|
+
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) }
|
3877
|
+
def update_omni_channel_template(marketing_create_template_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1444
3878
|
# update_omni_channel_template - Update Omni-Channel Template
|
1445
3879
|
#
|
1446
3880
|
# @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
@@ -1462,6 +3896,14 @@ module StackOne
|
|
1462
3896
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_template_request_dto, :json)
|
1463
3897
|
headers['content-type'] = req_content_type
|
1464
3898
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
3899
|
+
|
3900
|
+
if form
|
3901
|
+
body = Utils.encode_form(form)
|
3902
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
3903
|
+
body = URI.encode_www_form(data)
|
3904
|
+
else
|
3905
|
+
body = data
|
3906
|
+
end
|
1465
3907
|
headers['Accept'] = 'application/json'
|
1466
3908
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1467
3909
|
retries ||= @sdk_configuration.retry_config
|
@@ -1478,19 +3920,61 @@ module StackOne
|
|
1478
3920
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1479
3921
|
retry_options[:retry_statuses] = [429, 408]
|
1480
3922
|
|
3923
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3924
|
+
|
3925
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3926
|
+
timeout ||= @sdk_configuration.timeout
|
3927
|
+
|
1481
3928
|
connection = @sdk_configuration.client.dup
|
1482
3929
|
connection.request :retry, retry_options
|
1483
3930
|
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
3931
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3932
|
+
base_url: base_url,
|
3933
|
+
oauth2_scopes: nil,
|
3934
|
+
operation_id: 'marketing_update_omni_channel_template',
|
3935
|
+
security_source: @sdk_configuration.security_source
|
3936
|
+
)
|
3937
|
+
|
3938
|
+
error = T.let(nil, T.nilable(StandardError))
|
3939
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3940
|
+
|
3941
|
+
begin
|
3942
|
+
r = connection.patch(url) do |req|
|
3943
|
+
req.body = body
|
3944
|
+
req.headers.merge!(headers)
|
3945
|
+
req.options.timeout = timeout unless timeout.nil?
|
3946
|
+
Utils.configure_request_security(req, security)
|
3947
|
+
|
3948
|
+
@sdk_configuration.hooks.before_request(
|
3949
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3950
|
+
hook_ctx: hook_ctx
|
3951
|
+
),
|
3952
|
+
request: req
|
3953
|
+
)
|
3954
|
+
end
|
3955
|
+
rescue StandardError => e
|
3956
|
+
error = e
|
3957
|
+
ensure
|
3958
|
+
if r.nil? || Utils.error_status?(r.status)
|
3959
|
+
r = @sdk_configuration.hooks.after_error(
|
3960
|
+
error: error,
|
3961
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3962
|
+
hook_ctx: hook_ctx
|
3963
|
+
),
|
3964
|
+
response: r
|
3965
|
+
)
|
1492
3966
|
else
|
1493
|
-
|
3967
|
+
r = @sdk_configuration.hooks.after_success(
|
3968
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3969
|
+
hook_ctx: hook_ctx
|
3970
|
+
),
|
3971
|
+
response: r
|
3972
|
+
)
|
3973
|
+
end
|
3974
|
+
|
3975
|
+
if r.nil?
|
3976
|
+
raise error if !error.nil?
|
3977
|
+
raise 'no response'
|
1494
3978
|
end
|
1495
3979
|
end
|
1496
3980
|
|
@@ -1504,18 +3988,75 @@ module StackOne
|
|
1504
3988
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
1505
3989
|
res.create_result = out
|
1506
3990
|
end
|
3991
|
+
elsif r.status == 400
|
3992
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3993
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3994
|
+
res.bad_request_response = out
|
3995
|
+
end
|
3996
|
+
elsif r.status == 401
|
3997
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3998
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3999
|
+
res.unauthorized_response = out
|
4000
|
+
end
|
4001
|
+
elsif r.status == 403
|
4002
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4003
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
4004
|
+
res.forbidden_response = out
|
4005
|
+
end
|
4006
|
+
elsif r.status == 404
|
4007
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4008
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
4009
|
+
res.not_found_response = out
|
4010
|
+
end
|
1507
4011
|
elsif r.status == 408
|
1508
4012
|
res.headers = r.headers
|
1509
|
-
|
1510
|
-
|
4013
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4014
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
4015
|
+
res.request_timed_out_response = out
|
4016
|
+
end
|
4017
|
+
elsif r.status == 409
|
4018
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4019
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
4020
|
+
res.conflict_response = out
|
4021
|
+
end
|
4022
|
+
elsif r.status == 412
|
4023
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4024
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
4025
|
+
res.precondition_failed_response = out
|
4026
|
+
end
|
4027
|
+
elsif r.status == 422
|
4028
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4029
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
4030
|
+
res.unprocessable_entity_response = out
|
4031
|
+
end
|
4032
|
+
elsif r.status == 429
|
4033
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4034
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
4035
|
+
res.too_many_requests_response = out
|
4036
|
+
end
|
4037
|
+
elsif r.status == 500
|
4038
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4039
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
4040
|
+
res.internal_server_error_response = out
|
4041
|
+
end
|
4042
|
+
elsif r.status == 501
|
4043
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4044
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
4045
|
+
res.not_implemented_response = out
|
4046
|
+
end
|
4047
|
+
elsif r.status == 502
|
4048
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4049
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
4050
|
+
res.bad_gateway_response = out
|
4051
|
+
end
|
1511
4052
|
end
|
1512
4053
|
|
1513
4054
|
res
|
1514
4055
|
end
|
1515
4056
|
|
1516
4057
|
|
1517
|
-
sig { params(marketing_create_push_template_request_dto: ::StackOne::Shared::MarketingCreatePushTemplateRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingUpdatePushTemplateResponse) }
|
1518
|
-
def update_push_template(marketing_create_push_template_request_dto, id, x_account_id, retries = nil)
|
4058
|
+
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) }
|
4059
|
+
def update_push_template(marketing_create_push_template_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1519
4060
|
# update_push_template - Update Push Template
|
1520
4061
|
request = ::StackOne::Operations::MarketingUpdatePushTemplateRequest.new(
|
1521
4062
|
|
@@ -1535,6 +4076,14 @@ module StackOne
|
|
1535
4076
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_push_template_request_dto, :json)
|
1536
4077
|
headers['content-type'] = req_content_type
|
1537
4078
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
4079
|
+
|
4080
|
+
if form
|
4081
|
+
body = Utils.encode_form(form)
|
4082
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
4083
|
+
body = URI.encode_www_form(data)
|
4084
|
+
else
|
4085
|
+
body = data
|
4086
|
+
end
|
1538
4087
|
headers['Accept'] = 'application/json'
|
1539
4088
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1540
4089
|
retries ||= @sdk_configuration.retry_config
|
@@ -1551,19 +4100,61 @@ module StackOne
|
|
1551
4100
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1552
4101
|
retry_options[:retry_statuses] = [429, 408]
|
1553
4102
|
|
4103
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
4104
|
+
|
4105
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
4106
|
+
timeout ||= @sdk_configuration.timeout
|
4107
|
+
|
1554
4108
|
connection = @sdk_configuration.client.dup
|
1555
4109
|
connection.request :retry, retry_options
|
1556
4110
|
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
4111
|
+
hook_ctx = SDKHooks::HookContext.new(
|
4112
|
+
base_url: base_url,
|
4113
|
+
oauth2_scopes: nil,
|
4114
|
+
operation_id: 'marketing_update_push_template',
|
4115
|
+
security_source: @sdk_configuration.security_source
|
4116
|
+
)
|
4117
|
+
|
4118
|
+
error = T.let(nil, T.nilable(StandardError))
|
4119
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
4120
|
+
|
4121
|
+
begin
|
4122
|
+
r = connection.patch(url) do |req|
|
4123
|
+
req.body = body
|
4124
|
+
req.headers.merge!(headers)
|
4125
|
+
req.options.timeout = timeout unless timeout.nil?
|
4126
|
+
Utils.configure_request_security(req, security)
|
4127
|
+
|
4128
|
+
@sdk_configuration.hooks.before_request(
|
4129
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
4130
|
+
hook_ctx: hook_ctx
|
4131
|
+
),
|
4132
|
+
request: req
|
4133
|
+
)
|
4134
|
+
end
|
4135
|
+
rescue StandardError => e
|
4136
|
+
error = e
|
4137
|
+
ensure
|
4138
|
+
if r.nil? || Utils.error_status?(r.status)
|
4139
|
+
r = @sdk_configuration.hooks.after_error(
|
4140
|
+
error: error,
|
4141
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
4142
|
+
hook_ctx: hook_ctx
|
4143
|
+
),
|
4144
|
+
response: r
|
4145
|
+
)
|
1565
4146
|
else
|
1566
|
-
|
4147
|
+
r = @sdk_configuration.hooks.after_success(
|
4148
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
4149
|
+
hook_ctx: hook_ctx
|
4150
|
+
),
|
4151
|
+
response: r
|
4152
|
+
)
|
4153
|
+
end
|
4154
|
+
|
4155
|
+
if r.nil?
|
4156
|
+
raise error if !error.nil?
|
4157
|
+
raise 'no response'
|
1567
4158
|
end
|
1568
4159
|
end
|
1569
4160
|
|
@@ -1577,18 +4168,75 @@ module StackOne
|
|
1577
4168
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
1578
4169
|
res.create_result = out
|
1579
4170
|
end
|
4171
|
+
elsif r.status == 400
|
4172
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4173
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
4174
|
+
res.bad_request_response = out
|
4175
|
+
end
|
4176
|
+
elsif r.status == 401
|
4177
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4178
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
4179
|
+
res.unauthorized_response = out
|
4180
|
+
end
|
4181
|
+
elsif r.status == 403
|
4182
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4183
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
4184
|
+
res.forbidden_response = out
|
4185
|
+
end
|
4186
|
+
elsif r.status == 404
|
4187
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4188
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
4189
|
+
res.not_found_response = out
|
4190
|
+
end
|
1580
4191
|
elsif r.status == 408
|
1581
4192
|
res.headers = r.headers
|
1582
|
-
|
1583
|
-
|
4193
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4194
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
4195
|
+
res.request_timed_out_response = out
|
4196
|
+
end
|
4197
|
+
elsif r.status == 409
|
4198
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4199
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
4200
|
+
res.conflict_response = out
|
4201
|
+
end
|
4202
|
+
elsif r.status == 412
|
4203
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4204
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
4205
|
+
res.precondition_failed_response = out
|
4206
|
+
end
|
4207
|
+
elsif r.status == 422
|
4208
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4209
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
4210
|
+
res.unprocessable_entity_response = out
|
4211
|
+
end
|
4212
|
+
elsif r.status == 429
|
4213
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4214
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
4215
|
+
res.too_many_requests_response = out
|
4216
|
+
end
|
4217
|
+
elsif r.status == 500
|
4218
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4219
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
4220
|
+
res.internal_server_error_response = out
|
4221
|
+
end
|
4222
|
+
elsif r.status == 501
|
4223
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4224
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
4225
|
+
res.not_implemented_response = out
|
4226
|
+
end
|
4227
|
+
elsif r.status == 502
|
4228
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4229
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
4230
|
+
res.bad_gateway_response = out
|
4231
|
+
end
|
1584
4232
|
end
|
1585
4233
|
|
1586
4234
|
res
|
1587
4235
|
end
|
1588
4236
|
|
1589
4237
|
|
1590
|
-
sig { params(marketing_create_sms_template_request_dto: ::StackOne::Shared::MarketingCreateSmsTemplateRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::MarketingUpdateSmsTemplateResponse) }
|
1591
|
-
def update_sms_template(marketing_create_sms_template_request_dto, id, x_account_id, retries = nil)
|
4238
|
+
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) }
|
4239
|
+
def update_sms_template(marketing_create_sms_template_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1592
4240
|
# update_sms_template - Update SMS Template
|
1593
4241
|
request = ::StackOne::Operations::MarketingUpdateSmsTemplateRequest.new(
|
1594
4242
|
|
@@ -1608,6 +4256,14 @@ module StackOne
|
|
1608
4256
|
req_content_type, data, form = Utils.serialize_request_body(request, :marketing_create_sms_template_request_dto, :json)
|
1609
4257
|
headers['content-type'] = req_content_type
|
1610
4258
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
4259
|
+
|
4260
|
+
if form
|
4261
|
+
body = Utils.encode_form(form)
|
4262
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
4263
|
+
body = URI.encode_www_form(data)
|
4264
|
+
else
|
4265
|
+
body = data
|
4266
|
+
end
|
1611
4267
|
headers['Accept'] = 'application/json'
|
1612
4268
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1613
4269
|
retries ||= @sdk_configuration.retry_config
|
@@ -1624,19 +4280,61 @@ module StackOne
|
|
1624
4280
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1625
4281
|
retry_options[:retry_statuses] = [429, 408]
|
1626
4282
|
|
4283
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
4284
|
+
|
4285
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
4286
|
+
timeout ||= @sdk_configuration.timeout
|
4287
|
+
|
1627
4288
|
connection = @sdk_configuration.client.dup
|
1628
4289
|
connection.request :retry, retry_options
|
1629
4290
|
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
4291
|
+
hook_ctx = SDKHooks::HookContext.new(
|
4292
|
+
base_url: base_url,
|
4293
|
+
oauth2_scopes: nil,
|
4294
|
+
operation_id: 'marketing_update_sms_template',
|
4295
|
+
security_source: @sdk_configuration.security_source
|
4296
|
+
)
|
4297
|
+
|
4298
|
+
error = T.let(nil, T.nilable(StandardError))
|
4299
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
4300
|
+
|
4301
|
+
begin
|
4302
|
+
r = connection.patch(url) do |req|
|
4303
|
+
req.body = body
|
4304
|
+
req.headers.merge!(headers)
|
4305
|
+
req.options.timeout = timeout unless timeout.nil?
|
4306
|
+
Utils.configure_request_security(req, security)
|
4307
|
+
|
4308
|
+
@sdk_configuration.hooks.before_request(
|
4309
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
4310
|
+
hook_ctx: hook_ctx
|
4311
|
+
),
|
4312
|
+
request: req
|
4313
|
+
)
|
4314
|
+
end
|
4315
|
+
rescue StandardError => e
|
4316
|
+
error = e
|
4317
|
+
ensure
|
4318
|
+
if r.nil? || Utils.error_status?(r.status)
|
4319
|
+
r = @sdk_configuration.hooks.after_error(
|
4320
|
+
error: error,
|
4321
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
4322
|
+
hook_ctx: hook_ctx
|
4323
|
+
),
|
4324
|
+
response: r
|
4325
|
+
)
|
1638
4326
|
else
|
1639
|
-
|
4327
|
+
r = @sdk_configuration.hooks.after_success(
|
4328
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
4329
|
+
hook_ctx: hook_ctx
|
4330
|
+
),
|
4331
|
+
response: r
|
4332
|
+
)
|
4333
|
+
end
|
4334
|
+
|
4335
|
+
if r.nil?
|
4336
|
+
raise error if !error.nil?
|
4337
|
+
raise 'no response'
|
1640
4338
|
end
|
1641
4339
|
end
|
1642
4340
|
|
@@ -1650,10 +4348,67 @@ module StackOne
|
|
1650
4348
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
1651
4349
|
res.create_result = out
|
1652
4350
|
end
|
4351
|
+
elsif r.status == 400
|
4352
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4353
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
4354
|
+
res.bad_request_response = out
|
4355
|
+
end
|
4356
|
+
elsif r.status == 401
|
4357
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4358
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
4359
|
+
res.unauthorized_response = out
|
4360
|
+
end
|
4361
|
+
elsif r.status == 403
|
4362
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4363
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
4364
|
+
res.forbidden_response = out
|
4365
|
+
end
|
4366
|
+
elsif r.status == 404
|
4367
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4368
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
4369
|
+
res.not_found_response = out
|
4370
|
+
end
|
1653
4371
|
elsif r.status == 408
|
1654
4372
|
res.headers = r.headers
|
1655
|
-
|
1656
|
-
|
4373
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4374
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
4375
|
+
res.request_timed_out_response = out
|
4376
|
+
end
|
4377
|
+
elsif r.status == 409
|
4378
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4379
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
4380
|
+
res.conflict_response = out
|
4381
|
+
end
|
4382
|
+
elsif r.status == 412
|
4383
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4384
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
4385
|
+
res.precondition_failed_response = out
|
4386
|
+
end
|
4387
|
+
elsif r.status == 422
|
4388
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4389
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
4390
|
+
res.unprocessable_entity_response = out
|
4391
|
+
end
|
4392
|
+
elsif r.status == 429
|
4393
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4394
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
4395
|
+
res.too_many_requests_response = out
|
4396
|
+
end
|
4397
|
+
elsif r.status == 500
|
4398
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4399
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
4400
|
+
res.internal_server_error_response = out
|
4401
|
+
end
|
4402
|
+
elsif r.status == 501
|
4403
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4404
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
4405
|
+
res.not_implemented_response = out
|
4406
|
+
end
|
4407
|
+
elsif r.status == 502
|
4408
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4409
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
4410
|
+
res.bad_gateway_response = out
|
4411
|
+
end
|
1657
4412
|
end
|
1658
4413
|
|
1659
4414
|
res
|