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.
Files changed (363) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stack_one/accounts.rb +549 -46
  3. data/lib/stack_one/ats.rb +8352 -753
  4. data/lib/stack_one/connect_sessions.rb +231 -26
  5. data/lib/stack_one/connectors.rb +219 -18
  6. data/lib/stack_one/crm.rb +1153 -98
  7. data/lib/stack_one/hris.rb +7091 -621
  8. data/lib/stack_one/iam.rb +1261 -72
  9. data/lib/stack_one/lms.rb +3134 -282
  10. data/lib/stack_one/marketing.rb +3045 -290
  11. data/lib/stack_one/models/operations/ats_create_application_note_response.rb +38 -2
  12. data/lib/stack_one/models/operations/ats_create_application_response.rb +38 -2
  13. data/lib/stack_one/models/operations/ats_create_background_check_package_response.rb +38 -2
  14. data/lib/stack_one/models/operations/ats_create_candidate_note_response.rb +38 -2
  15. data/lib/stack_one/models/operations/ats_create_candidate_response.rb +38 -2
  16. data/lib/stack_one/models/operations/ats_create_job_response.rb +38 -2
  17. data/lib/stack_one/models/operations/ats_create_offer_response.rb +38 -2
  18. data/lib/stack_one/models/operations/ats_delete_background_check_package_response.rb +38 -2
  19. data/lib/stack_one/models/operations/ats_download_application_document_response.rb +38 -2
  20. data/lib/stack_one/models/operations/ats_get_application_custom_field_definition_queryparam_filter.rb +24 -0
  21. data/lib/stack_one/models/operations/ats_get_application_custom_field_definition_request.rb +2 -2
  22. data/lib/stack_one/models/operations/ats_get_application_custom_field_definition_response.rb +38 -2
  23. data/lib/stack_one/models/operations/ats_get_application_document_response.rb +38 -2
  24. data/lib/stack_one/models/operations/ats_get_application_note_response.rb +38 -2
  25. data/lib/stack_one/models/operations/ats_get_application_offer_response.rb +38 -2
  26. data/lib/stack_one/models/operations/ats_get_application_response.rb +38 -2
  27. data/lib/stack_one/models/operations/ats_get_application_scheduled_interview_response.rb +38 -2
  28. data/lib/stack_one/models/operations/ats_get_application_scorecard_response.rb +38 -2
  29. data/lib/stack_one/models/operations/ats_get_assessments_package_response.rb +38 -2
  30. data/lib/stack_one/models/operations/ats_get_assessments_request_response.rb +38 -2
  31. data/lib/stack_one/models/operations/ats_get_assessments_result_response.rb +38 -2
  32. data/lib/stack_one/models/operations/ats_get_background_check_package_response.rb +38 -2
  33. data/lib/stack_one/models/operations/ats_get_background_check_request_response.rb +38 -2
  34. data/lib/stack_one/models/operations/ats_get_background_check_result_response.rb +38 -2
  35. data/lib/stack_one/models/operations/ats_get_candidate_custom_field_definition_queryparam_filter.rb +24 -0
  36. data/lib/stack_one/models/operations/ats_get_candidate_custom_field_definition_request.rb +2 -2
  37. data/lib/stack_one/models/operations/ats_get_candidate_custom_field_definition_response.rb +38 -2
  38. data/lib/stack_one/models/operations/ats_get_candidate_note_response.rb +38 -2
  39. data/lib/stack_one/models/operations/ats_get_candidate_response.rb +38 -2
  40. data/lib/stack_one/models/operations/ats_get_department_response.rb +38 -2
  41. data/lib/stack_one/models/operations/ats_get_interview_response.rb +38 -2
  42. data/lib/stack_one/models/operations/ats_get_interview_stage_response.rb +38 -2
  43. data/lib/stack_one/models/operations/ats_get_job_custom_field_definition_response.rb +38 -2
  44. data/lib/stack_one/models/operations/ats_get_job_posting_response.rb +38 -2
  45. data/lib/stack_one/models/operations/ats_get_job_response.rb +38 -2
  46. data/lib/stack_one/models/operations/ats_get_list_response.rb +38 -2
  47. data/lib/stack_one/models/operations/ats_get_location_response.rb +38 -2
  48. data/lib/stack_one/models/operations/ats_get_offer_response.rb +38 -2
  49. data/lib/stack_one/models/operations/ats_get_rejected_reason_response.rb +38 -2
  50. data/lib/stack_one/models/operations/ats_get_user_response.rb +38 -2
  51. data/lib/stack_one/models/operations/ats_list_application_custom_field_definitions_response.rb +38 -2
  52. data/lib/stack_one/models/operations/ats_list_application_documents_response.rb +38 -2
  53. data/lib/stack_one/models/operations/ats_list_application_notes_response.rb +38 -2
  54. data/lib/stack_one/models/operations/ats_list_application_scorecards_response.rb +38 -2
  55. data/lib/stack_one/models/operations/ats_list_applications_offers_response.rb +38 -2
  56. data/lib/stack_one/models/operations/ats_list_applications_response.rb +38 -2
  57. data/lib/stack_one/models/operations/ats_list_applications_scheduled_interviews_response.rb +38 -2
  58. data/lib/stack_one/models/operations/ats_list_assessments_packages_response.rb +38 -2
  59. data/lib/stack_one/models/operations/ats_list_background_check_packages_response.rb +38 -2
  60. data/lib/stack_one/models/operations/ats_list_background_check_request_response.rb +38 -2
  61. data/lib/stack_one/models/operations/ats_list_candidate_custom_field_definitions_response.rb +38 -2
  62. data/lib/stack_one/models/operations/ats_list_candidate_notes_response.rb +38 -2
  63. data/lib/stack_one/models/operations/ats_list_candidates_response.rb +38 -2
  64. data/lib/stack_one/models/operations/ats_list_departments_response.rb +38 -2
  65. data/lib/stack_one/models/operations/ats_list_interview_stages_response.rb +38 -2
  66. data/lib/stack_one/models/operations/ats_list_interviews_response.rb +38 -2
  67. data/lib/stack_one/models/operations/ats_list_job_custom_field_definitions_response.rb +38 -2
  68. data/lib/stack_one/models/operations/ats_list_job_postings_response.rb +38 -2
  69. data/lib/stack_one/models/operations/ats_list_jobs_response.rb +38 -2
  70. data/lib/stack_one/models/operations/ats_list_lists_response.rb +38 -2
  71. data/lib/stack_one/models/operations/ats_list_locations_response.rb +38 -2
  72. data/lib/stack_one/models/operations/ats_list_offers_response.rb +38 -2
  73. data/lib/stack_one/models/operations/ats_list_rejected_reasons_response.rb +38 -2
  74. data/lib/stack_one/models/operations/ats_list_users_response.rb +38 -2
  75. data/lib/stack_one/models/operations/ats_move_application_response.rb +38 -2
  76. data/lib/stack_one/models/operations/ats_order_assessments_request_response.rb +38 -2
  77. data/lib/stack_one/models/operations/ats_order_background_check_request_response.rb +38 -2
  78. data/lib/stack_one/models/operations/ats_reject_application_response.rb +38 -2
  79. data/lib/stack_one/models/operations/ats_update_application_note_response.rb +38 -2
  80. data/lib/stack_one/models/operations/ats_update_application_response.rb +38 -2
  81. data/lib/stack_one/models/operations/ats_update_assessments_result_response.rb +38 -2
  82. data/lib/stack_one/models/operations/ats_update_background_check_package_response.rb +38 -2
  83. data/lib/stack_one/models/operations/ats_update_background_check_result_response.rb +38 -2
  84. data/lib/stack_one/models/operations/ats_update_candidate_response.rb +38 -2
  85. data/lib/stack_one/models/operations/ats_update_job_response.rb +38 -2
  86. data/lib/stack_one/models/operations/ats_upload_application_document_response.rb +38 -2
  87. data/lib/stack_one/models/operations/crm_create_contact_response.rb +38 -2
  88. data/lib/stack_one/models/operations/crm_get_account_response.rb +38 -2
  89. data/lib/stack_one/models/operations/crm_get_contact_custom_field_definition_response.rb +38 -2
  90. data/lib/stack_one/models/operations/crm_get_contact_response.rb +38 -2
  91. data/lib/stack_one/models/operations/crm_get_list_response.rb +38 -2
  92. data/lib/stack_one/models/operations/crm_list_accounts_response.rb +38 -2
  93. data/lib/stack_one/models/operations/crm_list_contact_custom_field_definitions_response.rb +38 -2
  94. data/lib/stack_one/models/operations/crm_list_contacts_response.rb +38 -2
  95. data/lib/stack_one/models/operations/crm_list_lists_response.rb +38 -2
  96. data/lib/stack_one/models/operations/crm_update_contact_response.rb +38 -2
  97. data/lib/stack_one/models/operations/filter.rb +56 -5
  98. data/lib/stack_one/models/operations/hris_batch_upload_employee_document_response.rb +38 -2
  99. data/lib/stack_one/models/operations/hris_create_employee_employment_response.rb +38 -2
  100. data/lib/stack_one/models/operations/hris_create_employee_response.rb +38 -2
  101. data/lib/stack_one/models/operations/hris_create_employee_skill_response.rb +38 -2
  102. data/lib/stack_one/models/operations/hris_create_employee_time_off_request_response.rb +38 -2
  103. data/lib/stack_one/models/operations/hris_create_employee_work_eligibility_request_response.rb +38 -2
  104. data/lib/stack_one/models/operations/hris_create_time_off_request_response.rb +38 -2
  105. data/lib/stack_one/models/operations/hris_download_employee_document_response.rb +38 -2
  106. data/lib/stack_one/models/operations/hris_get_benefit_response.rb +38 -2
  107. data/lib/stack_one/models/operations/hris_get_company_response.rb +38 -2
  108. data/lib/stack_one/models/operations/hris_get_cost_center_group_response.rb +38 -2
  109. data/lib/stack_one/models/operations/hris_get_department_group_response.rb +38 -2
  110. data/lib/stack_one/models/operations/hris_get_employee_custom_field_definition_response.rb +38 -2
  111. data/lib/stack_one/models/operations/hris_get_employee_document_category_response.rb +38 -2
  112. data/lib/stack_one/models/operations/hris_get_employee_document_response.rb +38 -2
  113. data/lib/stack_one/models/operations/hris_get_employee_employment_response.rb +38 -2
  114. data/lib/stack_one/models/operations/hris_get_employee_response.rb +38 -2
  115. data/lib/stack_one/models/operations/hris_get_employee_skill_response.rb +38 -2
  116. data/lib/stack_one/models/operations/hris_get_employee_time_off_balance_response.rb +38 -2
  117. data/lib/stack_one/models/operations/hris_get_employees_time_off_request_request.rb +5 -2
  118. data/lib/stack_one/models/operations/hris_get_employees_time_off_request_response.rb +38 -2
  119. data/lib/stack_one/models/operations/hris_get_employees_work_eligibility_response.rb +38 -2
  120. data/lib/stack_one/models/operations/hris_get_employment_response.rb +38 -2
  121. data/lib/stack_one/models/operations/hris_get_group_response.rb +38 -2
  122. data/lib/stack_one/models/operations/hris_get_job_response.rb +38 -2
  123. data/lib/stack_one/models/operations/hris_get_location_response.rb +38 -2
  124. data/lib/stack_one/models/operations/hris_get_team_group_response.rb +38 -2
  125. data/lib/stack_one/models/operations/hris_get_time_entries_response.rb +38 -2
  126. data/lib/stack_one/models/operations/hris_get_time_off_policy_response.rb +38 -2
  127. data/lib/stack_one/models/operations/hris_get_time_off_request_request.rb +5 -2
  128. data/lib/stack_one/models/operations/hris_get_time_off_request_response.rb +38 -2
  129. data/lib/stack_one/models/operations/hris_get_time_off_type_response.rb +38 -2
  130. data/lib/stack_one/models/operations/hris_invite_employee_response.rb +38 -2
  131. data/lib/stack_one/models/operations/hris_list_benefits_response.rb +38 -2
  132. data/lib/stack_one/models/operations/hris_list_companies_response.rb +38 -2
  133. data/lib/stack_one/models/operations/hris_list_cost_center_groups_response.rb +38 -2
  134. data/lib/stack_one/models/operations/hris_list_department_groups_response.rb +38 -2
  135. data/lib/stack_one/models/operations/hris_list_employee_categories_response.rb +38 -2
  136. data/lib/stack_one/models/operations/hris_list_employee_custom_field_definitions_response.rb +38 -2
  137. data/lib/stack_one/models/operations/hris_list_employee_documents_response.rb +38 -2
  138. data/lib/stack_one/models/operations/hris_list_employee_employments_response.rb +38 -2
  139. data/lib/stack_one/models/operations/hris_list_employee_skills_response.rb +38 -2
  140. data/lib/stack_one/models/operations/hris_list_employee_time_off_balances_response.rb +38 -2
  141. data/lib/stack_one/models/operations/hris_list_employee_time_off_policies_queryparam_filter.rb +24 -0
  142. data/lib/stack_one/models/operations/hris_list_employee_time_off_policies_request.rb +55 -0
  143. data/lib/stack_one/models/operations/hris_list_employee_time_off_policies_response.rb +72 -0
  144. data/lib/stack_one/models/operations/hris_list_employee_time_off_requests_request.rb +5 -2
  145. data/lib/stack_one/models/operations/hris_list_employee_time_off_requests_response.rb +38 -2
  146. data/lib/stack_one/models/operations/hris_list_employee_work_eligibility_response.rb +38 -2
  147. data/lib/stack_one/models/operations/hris_list_employees_response.rb +38 -2
  148. data/lib/stack_one/models/operations/hris_list_employments_response.rb +38 -2
  149. data/lib/stack_one/models/operations/hris_list_groups_response.rb +38 -2
  150. data/lib/stack_one/models/operations/hris_list_jobs_response.rb +38 -2
  151. data/lib/stack_one/models/operations/hris_list_locations_response.rb +38 -2
  152. data/lib/stack_one/models/operations/hris_list_team_groups_response.rb +38 -2
  153. data/lib/stack_one/models/operations/hris_list_time_entries_response.rb +38 -2
  154. data/lib/stack_one/models/operations/hris_list_time_off_policies_response.rb +38 -2
  155. data/lib/stack_one/models/operations/hris_list_time_off_requests_request.rb +5 -2
  156. data/lib/stack_one/models/operations/hris_list_time_off_requests_response.rb +38 -2
  157. data/lib/stack_one/models/operations/hris_list_time_off_types_response.rb +38 -2
  158. data/lib/stack_one/models/operations/hris_update_employee_employment_response.rb +38 -2
  159. data/lib/stack_one/models/operations/hris_update_employee_response.rb +40 -4
  160. data/lib/stack_one/models/operations/hris_update_employee_time_off_request_request.rb +33 -0
  161. data/lib/stack_one/models/operations/hris_update_employee_time_off_request_response.rb +72 -0
  162. data/lib/stack_one/models/operations/hris_update_employee_work_eligibility_request_response.rb +38 -2
  163. data/lib/stack_one/models/operations/hris_update_time_off_request_response.rb +38 -2
  164. data/lib/stack_one/models/operations/hris_upload_employee_document_response.rb +38 -2
  165. data/lib/stack_one/models/operations/iam_delete_user_request.rb +27 -0
  166. data/lib/stack_one/models/operations/iam_delete_user_response.rb +72 -0
  167. data/lib/stack_one/models/operations/iam_get_group_response.rb +38 -2
  168. data/lib/stack_one/models/operations/iam_get_policy_response.rb +38 -2
  169. data/lib/stack_one/models/operations/iam_get_role_response.rb +38 -2
  170. data/lib/stack_one/models/operations/iam_get_user_response.rb +38 -2
  171. data/lib/stack_one/models/operations/iam_list_groups_response.rb +38 -2
  172. data/lib/stack_one/models/operations/iam_list_policies_response.rb +38 -2
  173. data/lib/stack_one/models/operations/iam_list_roles_response.rb +38 -2
  174. data/lib/stack_one/models/operations/iam_list_users_response.rb +38 -2
  175. data/lib/stack_one/models/operations/iam_update_user_request.rb +30 -0
  176. data/lib/stack_one/models/operations/iam_update_user_response.rb +72 -0
  177. data/lib/stack_one/models/operations/include.rb +18 -0
  178. data/lib/stack_one/models/operations/lms_batch_upsert_content_response.rb +38 -2
  179. data/lib/stack_one/models/operations/lms_batch_upsert_course_response.rb +38 -2
  180. data/lib/stack_one/models/operations/lms_create_collection_response.rb +38 -2
  181. data/lib/stack_one/models/operations/lms_create_user_assignment_response.rb +38 -2
  182. data/lib/stack_one/models/operations/lms_create_user_completion_response.rb +38 -2
  183. data/lib/stack_one/models/operations/lms_delete_user_completion_response.rb +38 -2
  184. data/lib/stack_one/models/operations/lms_get_assignment_response.rb +38 -2
  185. data/lib/stack_one/models/operations/lms_get_category_response.rb +38 -2
  186. data/lib/stack_one/models/operations/lms_get_completion_response.rb +38 -2
  187. data/lib/stack_one/models/operations/lms_get_content_response.rb +38 -2
  188. data/lib/stack_one/models/operations/lms_get_course_response.rb +38 -2
  189. data/lib/stack_one/models/operations/lms_get_skill_response.rb +38 -2
  190. data/lib/stack_one/models/operations/lms_get_user_assignment_response.rb +38 -2
  191. data/lib/stack_one/models/operations/lms_get_user_completion_response.rb +38 -2
  192. data/lib/stack_one/models/operations/lms_get_user_response.rb +38 -2
  193. data/lib/stack_one/models/operations/lms_list_assignments_response.rb +38 -2
  194. data/lib/stack_one/models/operations/lms_list_categories_response.rb +38 -2
  195. data/lib/stack_one/models/operations/lms_list_completions_response.rb +38 -2
  196. data/lib/stack_one/models/operations/lms_list_content_response.rb +38 -2
  197. data/lib/stack_one/models/operations/lms_list_courses_queryparam_filter.rb +6 -3
  198. data/lib/stack_one/models/operations/lms_list_courses_request.rb +1 -1
  199. data/lib/stack_one/models/operations/lms_list_courses_response.rb +38 -2
  200. data/lib/stack_one/models/operations/lms_list_skills_response.rb +38 -2
  201. data/lib/stack_one/models/operations/lms_list_user_assignments_response.rb +38 -2
  202. data/lib/stack_one/models/operations/lms_list_user_completions_response.rb +38 -2
  203. data/lib/stack_one/models/operations/lms_list_users_queryparam_filter.rb +5 -2
  204. data/lib/stack_one/models/operations/lms_list_users_response.rb +38 -2
  205. data/lib/stack_one/models/operations/lms_update_collection_response.rb +38 -2
  206. data/lib/stack_one/models/operations/lms_upsert_content_response.rb +38 -2
  207. data/lib/stack_one/models/operations/lms_upsert_course_response.rb +38 -2
  208. data/lib/stack_one/models/operations/marketing_create_content_block_response.rb +38 -2
  209. data/lib/stack_one/models/operations/marketing_create_email_template_response.rb +38 -2
  210. data/lib/stack_one/models/operations/marketing_create_in_app_template_response.rb +38 -2
  211. data/lib/stack_one/models/operations/marketing_create_omni_channel_template_response.rb +38 -2
  212. data/lib/stack_one/models/operations/marketing_create_push_template_response.rb +38 -2
  213. data/lib/stack_one/models/operations/marketing_create_sms_template_response.rb +38 -2
  214. data/lib/stack_one/models/operations/marketing_get_campaign_response.rb +38 -2
  215. data/lib/stack_one/models/operations/marketing_get_content_block_response.rb +38 -2
  216. data/lib/stack_one/models/operations/marketing_get_email_template_response.rb +38 -2
  217. data/lib/stack_one/models/operations/marketing_get_in_app_template_response.rb +38 -2
  218. data/lib/stack_one/models/operations/marketing_get_omni_channel_template_response.rb +38 -2
  219. data/lib/stack_one/models/operations/marketing_get_push_template_response.rb +38 -2
  220. data/lib/stack_one/models/operations/marketing_get_sms_template_response.rb +38 -2
  221. data/lib/stack_one/models/operations/marketing_list_campaigns_response.rb +38 -2
  222. data/lib/stack_one/models/operations/marketing_list_content_blocks_response.rb +38 -2
  223. data/lib/stack_one/models/operations/marketing_list_email_templates_response.rb +38 -2
  224. data/lib/stack_one/models/operations/marketing_list_in_app_templates_response.rb +38 -2
  225. data/lib/stack_one/models/operations/marketing_list_omni_channel_templates_response.rb +38 -2
  226. data/lib/stack_one/models/operations/marketing_list_push_templates_response.rb +38 -2
  227. data/lib/stack_one/models/operations/marketing_list_sms_templates_response.rb +38 -2
  228. data/lib/stack_one/models/operations/marketing_update_content_block_response.rb +38 -2
  229. data/lib/stack_one/models/operations/marketing_update_email_template_response.rb +38 -2
  230. data/lib/stack_one/models/operations/marketing_update_in_app_template_response.rb +38 -2
  231. data/lib/stack_one/models/operations/marketing_update_omni_channel_template_response.rb +38 -2
  232. data/lib/stack_one/models/operations/marketing_update_push_template_response.rb +38 -2
  233. data/lib/stack_one/models/operations/marketing_update_sms_template_response.rb +38 -2
  234. data/lib/stack_one/models/operations/order_by.rb +21 -0
  235. data/lib/stack_one/models/operations/order_direction.rb +18 -0
  236. data/lib/stack_one/models/operations/queryparam_filter.rb +47 -5
  237. data/lib/stack_one/models/operations/queryparam_include.rb +17 -0
  238. data/lib/stack_one/models/operations/queryparam_order_by.rb +21 -0
  239. data/lib/stack_one/models/operations/queryparam_order_direction.rb +18 -0
  240. data/lib/stack_one/models/operations/stackone_authenticate_connect_session_response.rb +35 -2
  241. data/lib/stack_one/models/operations/stackone_create_connect_session_response.rb +35 -2
  242. data/lib/stack_one/models/operations/stackone_delete_account_response.rb +35 -2
  243. data/lib/stack_one/models/operations/stackone_get_account_meta_info_response.rb +35 -2
  244. data/lib/stack_one/models/operations/stackone_get_account_response.rb +35 -2
  245. data/lib/stack_one/models/operations/stackone_get_connector_meta_response.rb +35 -2
  246. data/lib/stack_one/models/operations/stackone_get_log_request.rb +27 -0
  247. data/lib/stack_one/models/operations/stackone_get_log_response.rb +69 -0
  248. data/lib/stack_one/models/operations/stackone_list_connectors_meta_response.rb +35 -2
  249. data/lib/stack_one/models/operations/stackone_list_linked_accounts_response.rb +35 -2
  250. data/lib/stack_one/models/operations/stackone_list_logs_request.rb +39 -0
  251. data/lib/stack_one/models/operations/stackone_list_logs_response.rb +69 -0
  252. data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_include.rb +18 -0
  253. data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_order_by.rb +21 -0
  254. data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_order_direction.rb +18 -0
  255. data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_request_logs_order_by.rb +21 -0
  256. data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_request_logs_order_direction.rb +18 -0
  257. data/lib/stack_one/models/operations/stackone_list_step_logs_request.rb +39 -0
  258. data/lib/stack_one/models/operations/stackone_list_step_logs_response.rb +69 -0
  259. data/lib/stack_one/models/operations/stackone_proxy_request_response.rb +38 -2
  260. data/lib/stack_one/models/operations/stackone_update_account_response.rb +35 -2
  261. data/lib/stack_one/models/operations.rb +30 -2
  262. data/lib/stack_one/models/shared/atscreatejobrequestdto.rb +5 -2
  263. data/lib/stack_one/models/shared/atsupdatejobrequestdto.rb +5 -2
  264. data/lib/stack_one/models/shared/badgatewayresponse.rb +30 -0
  265. data/lib/stack_one/models/shared/badrequestresponse.rb +36 -0
  266. data/lib/stack_one/models/shared/badrequestresponse_headers.rb +20 -0
  267. data/lib/stack_one/models/shared/conflictresponse.rb +30 -0
  268. data/lib/stack_one/models/shared/connectsession.rb +5 -2
  269. data/lib/stack_one/models/shared/connectsessiontokenauthlink.rb +5 -2
  270. data/lib/stack_one/models/shared/custommappingerror.rb +30 -0
  271. data/lib/stack_one/models/shared/data.rb +30 -0
  272. data/lib/stack_one/models/shared/forbiddenresponse.rb +30 -0
  273. data/lib/stack_one/models/shared/headers.rb +1 -1
  274. data/lib/stack_one/models/shared/hriscreatetimeoffrequestdto.rb +2 -0
  275. data/lib/stack_one/models/shared/hriscreatetimeoffrequestdto_type.rb +2 -0
  276. data/lib/stack_one/models/shared/hriscreatetimeoffrequestdto_value.rb +1 -0
  277. data/lib/stack_one/models/shared/iamupdateuserrequestdto.rb +45 -0
  278. data/lib/stack_one/models/shared/iamupdateuserrequestdto_status.rb +27 -0
  279. data/lib/stack_one/models/shared/iamupdateuserrequestdto_value.rb +20 -0
  280. data/lib/stack_one/models/shared/internalservererrorresponse.rb +30 -0
  281. data/lib/stack_one/models/shared/job.rb +5 -2
  282. data/lib/stack_one/models/shared/notfoundresponse.rb +30 -0
  283. data/lib/stack_one/models/shared/notimplementedresponse.rb +30 -0
  284. data/lib/stack_one/models/shared/policy.rb +4 -4
  285. data/lib/stack_one/models/shared/preconditionfailedresponse.rb +30 -0
  286. data/lib/stack_one/models/shared/providererror.rb +33 -0
  287. data/lib/stack_one/models/shared/providererrorapimodel.rb +3 -3
  288. data/lib/stack_one/models/shared/providererrorapimodel_headers.rb +20 -0
  289. data/lib/stack_one/models/shared/providererrorapimodel_raw.rb +20 -0
  290. data/lib/stack_one/models/shared/raw.rb +1 -1
  291. data/lib/stack_one/models/shared/rawresponse.rb +2 -2
  292. data/lib/stack_one/models/shared/request.rb +36 -0
  293. data/lib/stack_one/models/shared/requesttimedoutresponse.rb +30 -0
  294. data/lib/stack_one/models/shared/response.rb +36 -0
  295. data/lib/stack_one/models/shared/steplogsapimodel.rb +84 -0
  296. data/lib/stack_one/models/shared/steplogspaginated.rb +27 -0
  297. data/lib/stack_one/models/shared/timeoff.rb +7 -2
  298. data/lib/stack_one/models/shared/timeoff_duration_unit.rb +27 -0
  299. data/lib/stack_one/models/shared/timeoff_schemas_policy_type_value.rb +26 -0
  300. data/lib/stack_one/models/shared/timeoff_schemas_policy_value.rb +23 -0
  301. data/lib/stack_one/models/shared/timeoff_schemas_type.rb +27 -0
  302. data/lib/stack_one/models/shared/timeoff_type.rb +2 -0
  303. data/lib/stack_one/models/shared/timeoff_value.rb +1 -0
  304. data/lib/stack_one/models/shared/timeoffbalances.rb +2 -2
  305. data/lib/stack_one/models/shared/timeoffbalances_policy.rb +48 -0
  306. data/lib/stack_one/models/shared/toomanyrequestsresponse.rb +30 -0
  307. data/lib/stack_one/models/shared/unauthorizedresponse.rb +30 -0
  308. data/lib/stack_one/models/shared/unifiedlogresult.rb +24 -0
  309. data/lib/stack_one/models/shared/unifiedlogs.rb +96 -0
  310. data/lib/stack_one/models/shared/unifiedlogs_request.rb +36 -0
  311. data/lib/stack_one/models/shared/unifiedlogs_response.rb +36 -0
  312. data/lib/stack_one/models/shared/unifiedlogs_url.rb +33 -0
  313. data/lib/stack_one/models/shared/unifiedlogspaginated.rb +27 -0
  314. data/lib/stack_one/models/shared/unprocessableentityresponse.rb +30 -0
  315. data/lib/stack_one/models/shared/url.rb +33 -0
  316. data/lib/stack_one/models/shared.rb +41 -42
  317. data/lib/stack_one/proxy.rb +122 -14
  318. data/lib/stack_one/request_logs.rb +496 -0
  319. data/lib/stack_one/sdk_hooks/hooks.rb +101 -0
  320. data/lib/stack_one/sdk_hooks/types.rb +152 -0
  321. data/lib/stack_one/sdkconfiguration.rb +11 -4
  322. data/lib/stack_one/stackone.rb +24 -9
  323. data/lib/stack_one/utils/utils.rb +10 -0
  324. data/lib/stackone_client.rb +1 -0
  325. metadata +70 -40
  326. data/lib/stack_one/models/shared/updateemployeeapimodel.rb +0 -142
  327. data/lib/stack_one/models/shared/updateemployeeapimodel_avatar.rb +0 -27
  328. data/lib/stack_one/models/shared/updateemployeeapimodel_country.rb +0 -27
  329. data/lib/stack_one/models/shared/updateemployeeapimodel_employment.rb +0 -56
  330. data/lib/stack_one/models/shared/updateemployeeapimodel_employment_contract_type.rb +0 -27
  331. data/lib/stack_one/models/shared/updateemployeeapimodel_employment_status.rb +0 -27
  332. data/lib/stack_one/models/shared/updateemployeeapimodel_employment_type.rb +0 -27
  333. data/lib/stack_one/models/shared/updateemployeeapimodel_ethnicity.rb +0 -27
  334. data/lib/stack_one/models/shared/updateemployeeapimodel_gender.rb +0 -27
  335. data/lib/stack_one/models/shared/updateemployeeapimodel_home_location.rb +0 -51
  336. data/lib/stack_one/models/shared/updateemployeeapimodel_marital_status.rb +0 -27
  337. data/lib/stack_one/models/shared/updateemployeeapimodel_national_identity_number.rb +0 -32
  338. data/lib/stack_one/models/shared/updateemployeeapimodel_pay_frequency.rb +0 -27
  339. data/lib/stack_one/models/shared/updateemployeeapimodel_pay_period.rb +0 -27
  340. data/lib/stack_one/models/shared/updateemployeeapimodel_preferred_language.rb +0 -27
  341. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_country.rb +0 -27
  342. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_contract_type.rb +0 -27
  343. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_employment_contract_type_value.rb +0 -20
  344. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_employment_type_value.rb +0 -33
  345. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_pay_period_value.rb +0 -29
  346. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_type.rb +0 -27
  347. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_type_value.rb +0 -33
  348. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_value.rb +0 -31
  349. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_ethnicity_value.rb +0 -26
  350. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_gender_value.rb +0 -23
  351. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_home_location_value.rb +0 -265
  352. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_marital_status_value.rb +0 -26
  353. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_national_identity_number_type_value.rb +0 -159
  354. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_national_identity_number_value.rb +0 -265
  355. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_preferred_language_value.rb +0 -115
  356. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_state.rb +0 -27
  357. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_value.rb +0 -23
  358. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_work_location_country.rb +0 -27
  359. data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_work_location_value.rb +0 -265
  360. data/lib/stack_one/models/shared/updateemployeeapimodel_state.rb +0 -27
  361. data/lib/stack_one/models/shared/updateemployeeapimodel_type.rb +0 -27
  362. data/lib/stack_one/models/shared/updateemployeeapimodel_value.rb +0 -20
  363. data/lib/stack_one/models/shared/updateemployeeapimodel_work_location.rb +0 -51
data/lib/stack_one/crm.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(crm_create_contact_request_dto: ::StackOne::Shared::CrmCreateContactRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::CrmCreateContactResponse) }
25
- def create_contact(crm_create_contact_request_dto, x_account_id, retries = nil)
25
+ sig { params(crm_create_contact_request_dto: ::StackOne::Shared::CrmCreateContactRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmCreateContactResponse) }
26
+ def create_contact(crm_create_contact_request_dto, x_account_id, retries = nil, timeout_ms = nil)
26
27
  # create_contact - Creates a new Contact
27
28
  request = ::StackOne::Operations::CrmCreateContactRequest.new(
28
29
 
@@ -36,6 +37,14 @@ module StackOne
36
37
  req_content_type, data, form = Utils.serialize_request_body(request, :crm_create_contact_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
- r = connection.post(url) do |req|
59
- req.headers = headers
60
- security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
61
- Utils.configure_request_security(req, security) if !security.nil?
62
- if form
63
- req.body = Utils.encode_form(form)
64
- elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
65
- req.body = URI.encode_www_form(data)
72
+ hook_ctx = SDKHooks::HookContext.new(
73
+ base_url: base_url,
74
+ oauth2_scopes: nil,
75
+ operation_id: 'crm_create_contact',
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
- req.body = data
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::ContactResult)
79
130
  res.contact_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
- elsif [400, 403, 412, 429].include?(r.status)
84
- elsif [500, 501].include?(r.status)
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(request: T.nilable(::StackOne::Operations::CrmGetAccountRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::CrmGetAccountResponse) }
92
- def get_account(request, retries = nil)
199
+ sig { params(request: T.nilable(::StackOne::Operations::CrmGetAccountRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmGetAccountResponse) }
200
+ def get_account(request, retries = nil, timeout_ms = nil)
93
201
  # get_account - Get Account
94
202
  url, params = @sdk_configuration.get_server_details
95
203
  base_url = Utils.template_url(url, params)
@@ -117,14 +225,62 @@ module StackOne
117
225
  retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
118
226
  retry_options[:retry_statuses] = [429, 408]
119
227
 
228
+ security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
229
+
230
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
231
+ timeout ||= @sdk_configuration.timeout
232
+
120
233
  connection = @sdk_configuration.client.dup
121
234
  connection.request :retry, retry_options
122
235
 
123
- r = connection.get(url) do |req|
124
- req.headers = headers
125
- req.params = query_params
126
- security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
127
- Utils.configure_request_security(req, security) if !security.nil?
236
+ hook_ctx = SDKHooks::HookContext.new(
237
+ base_url: base_url,
238
+ oauth2_scopes: nil,
239
+ operation_id: 'crm_get_account',
240
+ security_source: @sdk_configuration.security_source
241
+ )
242
+
243
+ error = T.let(nil, T.nilable(StandardError))
244
+ r = T.let(nil, T.nilable(Faraday::Response))
245
+
246
+ begin
247
+ r = connection.get(url) do |req|
248
+ req.headers.merge!(headers)
249
+ req.options.timeout = timeout unless timeout.nil?
250
+ req.params = query_params
251
+ Utils.configure_request_security(req, security)
252
+
253
+ @sdk_configuration.hooks.before_request(
254
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
255
+ hook_ctx: hook_ctx
256
+ ),
257
+ request: req
258
+ )
259
+ end
260
+ rescue StandardError => e
261
+ error = e
262
+ ensure
263
+ if r.nil? || Utils.error_status?(r.status)
264
+ r = @sdk_configuration.hooks.after_error(
265
+ error: error,
266
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
267
+ hook_ctx: hook_ctx
268
+ ),
269
+ response: r
270
+ )
271
+ else
272
+ r = @sdk_configuration.hooks.after_success(
273
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
274
+ hook_ctx: hook_ctx
275
+ ),
276
+ response: r
277
+ )
278
+ end
279
+
280
+ if r.nil?
281
+ raise error if !error.nil?
282
+ raise 'no response'
283
+ end
128
284
  end
129
285
 
130
286
  content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
@@ -137,18 +293,75 @@ module StackOne
137
293
  out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::AccountResult)
138
294
  res.account_result = out
139
295
  end
296
+ elsif r.status == 400
297
+ if Utils.match_content_type(content_type, 'application/json')
298
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
299
+ res.bad_request_response = out
300
+ end
301
+ elsif r.status == 401
302
+ if Utils.match_content_type(content_type, 'application/json')
303
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
304
+ res.unauthorized_response = out
305
+ end
306
+ elsif r.status == 403
307
+ if Utils.match_content_type(content_type, 'application/json')
308
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
309
+ res.forbidden_response = out
310
+ end
311
+ elsif r.status == 404
312
+ if Utils.match_content_type(content_type, 'application/json')
313
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
314
+ res.not_found_response = out
315
+ end
140
316
  elsif r.status == 408
141
317
  res.headers = r.headers
142
- elsif [400, 403, 412, 429].include?(r.status)
143
- elsif [500, 501].include?(r.status)
318
+ if Utils.match_content_type(content_type, 'application/json')
319
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
320
+ res.request_timed_out_response = out
321
+ end
322
+ elsif r.status == 409
323
+ if Utils.match_content_type(content_type, 'application/json')
324
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
325
+ res.conflict_response = out
326
+ end
327
+ elsif r.status == 412
328
+ if Utils.match_content_type(content_type, 'application/json')
329
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
330
+ res.precondition_failed_response = out
331
+ end
332
+ elsif r.status == 422
333
+ if Utils.match_content_type(content_type, 'application/json')
334
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
335
+ res.unprocessable_entity_response = out
336
+ end
337
+ elsif r.status == 429
338
+ if Utils.match_content_type(content_type, 'application/json')
339
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
340
+ res.too_many_requests_response = out
341
+ end
342
+ elsif r.status == 500
343
+ if Utils.match_content_type(content_type, 'application/json')
344
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
345
+ res.internal_server_error_response = out
346
+ end
347
+ elsif r.status == 501
348
+ if Utils.match_content_type(content_type, 'application/json')
349
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
350
+ res.not_implemented_response = out
351
+ end
352
+ elsif r.status == 502
353
+ if Utils.match_content_type(content_type, 'application/json')
354
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
355
+ res.bad_gateway_response = out
356
+ end
144
357
  end
145
358
 
146
359
  res
147
360
  end
148
361
 
149
362
 
150
- sig { params(request: T.nilable(::StackOne::Operations::CrmGetContactRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::CrmGetContactResponse) }
151
- def get_contact(request, retries = nil)
363
+ sig { params(request: T.nilable(::StackOne::Operations::CrmGetContactRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmGetContactResponse) }
364
+ def get_contact(request, retries = nil, timeout_ms = nil)
152
365
  # get_contact - Get Contact
153
366
  url, params = @sdk_configuration.get_server_details
154
367
  base_url = Utils.template_url(url, params)
@@ -176,14 +389,62 @@ module StackOne
176
389
  retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
177
390
  retry_options[:retry_statuses] = [429, 408]
178
391
 
392
+ security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
393
+
394
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
395
+ timeout ||= @sdk_configuration.timeout
396
+
179
397
  connection = @sdk_configuration.client.dup
180
398
  connection.request :retry, retry_options
181
399
 
182
- r = connection.get(url) do |req|
183
- req.headers = headers
184
- req.params = query_params
185
- security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
186
- Utils.configure_request_security(req, security) if !security.nil?
400
+ hook_ctx = SDKHooks::HookContext.new(
401
+ base_url: base_url,
402
+ oauth2_scopes: nil,
403
+ operation_id: 'crm_get_contact',
404
+ security_source: @sdk_configuration.security_source
405
+ )
406
+
407
+ error = T.let(nil, T.nilable(StandardError))
408
+ r = T.let(nil, T.nilable(Faraday::Response))
409
+
410
+ begin
411
+ r = connection.get(url) do |req|
412
+ req.headers.merge!(headers)
413
+ req.options.timeout = timeout unless timeout.nil?
414
+ req.params = query_params
415
+ Utils.configure_request_security(req, security)
416
+
417
+ @sdk_configuration.hooks.before_request(
418
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
419
+ hook_ctx: hook_ctx
420
+ ),
421
+ request: req
422
+ )
423
+ end
424
+ rescue StandardError => e
425
+ error = e
426
+ ensure
427
+ if r.nil? || Utils.error_status?(r.status)
428
+ r = @sdk_configuration.hooks.after_error(
429
+ error: error,
430
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
431
+ hook_ctx: hook_ctx
432
+ ),
433
+ response: r
434
+ )
435
+ else
436
+ r = @sdk_configuration.hooks.after_success(
437
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
438
+ hook_ctx: hook_ctx
439
+ ),
440
+ response: r
441
+ )
442
+ end
443
+
444
+ if r.nil?
445
+ raise error if !error.nil?
446
+ raise 'no response'
447
+ end
187
448
  end
188
449
 
189
450
  content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
@@ -196,18 +457,75 @@ module StackOne
196
457
  out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ContactResult)
197
458
  res.contact_result = out
198
459
  end
460
+ elsif r.status == 400
461
+ if Utils.match_content_type(content_type, 'application/json')
462
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
463
+ res.bad_request_response = out
464
+ end
465
+ elsif r.status == 401
466
+ if Utils.match_content_type(content_type, 'application/json')
467
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
468
+ res.unauthorized_response = out
469
+ end
470
+ elsif r.status == 403
471
+ if Utils.match_content_type(content_type, 'application/json')
472
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
473
+ res.forbidden_response = out
474
+ end
475
+ elsif r.status == 404
476
+ if Utils.match_content_type(content_type, 'application/json')
477
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
478
+ res.not_found_response = out
479
+ end
199
480
  elsif r.status == 408
200
481
  res.headers = r.headers
201
- elsif [400, 403, 412, 429].include?(r.status)
202
- elsif [500, 501].include?(r.status)
482
+ if Utils.match_content_type(content_type, 'application/json')
483
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
484
+ res.request_timed_out_response = out
485
+ end
486
+ elsif r.status == 409
487
+ if Utils.match_content_type(content_type, 'application/json')
488
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
489
+ res.conflict_response = out
490
+ end
491
+ elsif r.status == 412
492
+ if Utils.match_content_type(content_type, 'application/json')
493
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
494
+ res.precondition_failed_response = out
495
+ end
496
+ elsif r.status == 422
497
+ if Utils.match_content_type(content_type, 'application/json')
498
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
499
+ res.unprocessable_entity_response = out
500
+ end
501
+ elsif r.status == 429
502
+ if Utils.match_content_type(content_type, 'application/json')
503
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
504
+ res.too_many_requests_response = out
505
+ end
506
+ elsif r.status == 500
507
+ if Utils.match_content_type(content_type, 'application/json')
508
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
509
+ res.internal_server_error_response = out
510
+ end
511
+ elsif r.status == 501
512
+ if Utils.match_content_type(content_type, 'application/json')
513
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
514
+ res.not_implemented_response = out
515
+ end
516
+ elsif r.status == 502
517
+ if Utils.match_content_type(content_type, 'application/json')
518
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
519
+ res.bad_gateway_response = out
520
+ end
203
521
  end
204
522
 
205
523
  res
206
524
  end
207
525
 
208
526
 
209
- sig { params(request: T.nilable(::StackOne::Operations::CrmGetContactCustomFieldDefinitionRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::CrmGetContactCustomFieldDefinitionResponse) }
210
- def get_contact_custom_field_definition(request, retries = nil)
527
+ sig { params(request: T.nilable(::StackOne::Operations::CrmGetContactCustomFieldDefinitionRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmGetContactCustomFieldDefinitionResponse) }
528
+ def get_contact_custom_field_definition(request, retries = nil, timeout_ms = nil)
211
529
  # get_contact_custom_field_definition - Get Contact Custom Field Definition
212
530
  url, params = @sdk_configuration.get_server_details
213
531
  base_url = Utils.template_url(url, params)
@@ -235,14 +553,62 @@ module StackOne
235
553
  retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
236
554
  retry_options[:retry_statuses] = [429, 408]
237
555
 
556
+ security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
557
+
558
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
559
+ timeout ||= @sdk_configuration.timeout
560
+
238
561
  connection = @sdk_configuration.client.dup
239
562
  connection.request :retry, retry_options
240
563
 
241
- r = connection.get(url) do |req|
242
- req.headers = headers
243
- req.params = query_params
244
- security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
245
- Utils.configure_request_security(req, security) if !security.nil?
564
+ hook_ctx = SDKHooks::HookContext.new(
565
+ base_url: base_url,
566
+ oauth2_scopes: nil,
567
+ operation_id: 'crm_get_contact_custom_field_definition',
568
+ security_source: @sdk_configuration.security_source
569
+ )
570
+
571
+ error = T.let(nil, T.nilable(StandardError))
572
+ r = T.let(nil, T.nilable(Faraday::Response))
573
+
574
+ begin
575
+ r = connection.get(url) do |req|
576
+ req.headers.merge!(headers)
577
+ req.options.timeout = timeout unless timeout.nil?
578
+ req.params = query_params
579
+ Utils.configure_request_security(req, security)
580
+
581
+ @sdk_configuration.hooks.before_request(
582
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
583
+ hook_ctx: hook_ctx
584
+ ),
585
+ request: req
586
+ )
587
+ end
588
+ rescue StandardError => e
589
+ error = e
590
+ ensure
591
+ if r.nil? || Utils.error_status?(r.status)
592
+ r = @sdk_configuration.hooks.after_error(
593
+ error: error,
594
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
595
+ hook_ctx: hook_ctx
596
+ ),
597
+ response: r
598
+ )
599
+ else
600
+ r = @sdk_configuration.hooks.after_success(
601
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
602
+ hook_ctx: hook_ctx
603
+ ),
604
+ response: r
605
+ )
606
+ end
607
+
608
+ if r.nil?
609
+ raise error if !error.nil?
610
+ raise 'no response'
611
+ end
246
612
  end
247
613
 
248
614
  content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
@@ -255,18 +621,75 @@ module StackOne
255
621
  out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CustomFieldDefinitionResultApiModel)
256
622
  res.custom_field_definition_result_api_model = out
257
623
  end
624
+ elsif r.status == 400
625
+ if Utils.match_content_type(content_type, 'application/json')
626
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
627
+ res.bad_request_response = out
628
+ end
629
+ elsif r.status == 401
630
+ if Utils.match_content_type(content_type, 'application/json')
631
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
632
+ res.unauthorized_response = out
633
+ end
634
+ elsif r.status == 403
635
+ if Utils.match_content_type(content_type, 'application/json')
636
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
637
+ res.forbidden_response = out
638
+ end
639
+ elsif r.status == 404
640
+ if Utils.match_content_type(content_type, 'application/json')
641
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
642
+ res.not_found_response = out
643
+ end
258
644
  elsif r.status == 408
259
645
  res.headers = r.headers
260
- elsif [400, 403, 412, 429].include?(r.status)
261
- elsif [500, 501].include?(r.status)
646
+ if Utils.match_content_type(content_type, 'application/json')
647
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
648
+ res.request_timed_out_response = out
649
+ end
650
+ elsif r.status == 409
651
+ if Utils.match_content_type(content_type, 'application/json')
652
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
653
+ res.conflict_response = out
654
+ end
655
+ elsif r.status == 412
656
+ if Utils.match_content_type(content_type, 'application/json')
657
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
658
+ res.precondition_failed_response = out
659
+ end
660
+ elsif r.status == 422
661
+ if Utils.match_content_type(content_type, 'application/json')
662
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
663
+ res.unprocessable_entity_response = out
664
+ end
665
+ elsif r.status == 429
666
+ if Utils.match_content_type(content_type, 'application/json')
667
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
668
+ res.too_many_requests_response = out
669
+ end
670
+ elsif r.status == 500
671
+ if Utils.match_content_type(content_type, 'application/json')
672
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
673
+ res.internal_server_error_response = out
674
+ end
675
+ elsif r.status == 501
676
+ if Utils.match_content_type(content_type, 'application/json')
677
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
678
+ res.not_implemented_response = out
679
+ end
680
+ elsif r.status == 502
681
+ if Utils.match_content_type(content_type, 'application/json')
682
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
683
+ res.bad_gateway_response = out
684
+ end
262
685
  end
263
686
 
264
687
  res
265
688
  end
266
689
 
267
690
 
268
- sig { params(request: T.nilable(::StackOne::Operations::CrmGetListRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::CrmGetListResponse) }
269
- def get_list(request, retries = nil)
691
+ sig { params(request: T.nilable(::StackOne::Operations::CrmGetListRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmGetListResponse) }
692
+ def get_list(request, retries = nil, timeout_ms = nil)
270
693
  # get_list - Get List
271
694
  url, params = @sdk_configuration.get_server_details
272
695
  base_url = Utils.template_url(url, params)
@@ -294,14 +717,62 @@ module StackOne
294
717
  retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
295
718
  retry_options[:retry_statuses] = [429, 408]
296
719
 
720
+ security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
721
+
722
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
723
+ timeout ||= @sdk_configuration.timeout
724
+
297
725
  connection = @sdk_configuration.client.dup
298
726
  connection.request :retry, retry_options
299
727
 
300
- r = connection.get(url) do |req|
301
- req.headers = headers
302
- req.params = query_params
303
- security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
304
- Utils.configure_request_security(req, security) if !security.nil?
728
+ hook_ctx = SDKHooks::HookContext.new(
729
+ base_url: base_url,
730
+ oauth2_scopes: nil,
731
+ operation_id: 'crm_get_list',
732
+ security_source: @sdk_configuration.security_source
733
+ )
734
+
735
+ error = T.let(nil, T.nilable(StandardError))
736
+ r = T.let(nil, T.nilable(Faraday::Response))
737
+
738
+ begin
739
+ r = connection.get(url) do |req|
740
+ req.headers.merge!(headers)
741
+ req.options.timeout = timeout unless timeout.nil?
742
+ req.params = query_params
743
+ Utils.configure_request_security(req, security)
744
+
745
+ @sdk_configuration.hooks.before_request(
746
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
747
+ hook_ctx: hook_ctx
748
+ ),
749
+ request: req
750
+ )
751
+ end
752
+ rescue StandardError => e
753
+ error = e
754
+ ensure
755
+ if r.nil? || Utils.error_status?(r.status)
756
+ r = @sdk_configuration.hooks.after_error(
757
+ error: error,
758
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
759
+ hook_ctx: hook_ctx
760
+ ),
761
+ response: r
762
+ )
763
+ else
764
+ r = @sdk_configuration.hooks.after_success(
765
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
766
+ hook_ctx: hook_ctx
767
+ ),
768
+ response: r
769
+ )
770
+ end
771
+
772
+ if r.nil?
773
+ raise error if !error.nil?
774
+ raise 'no response'
775
+ end
305
776
  end
306
777
 
307
778
  content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
@@ -314,18 +785,75 @@ module StackOne
314
785
  out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ListResult)
315
786
  res.list_result = out
316
787
  end
788
+ elsif r.status == 400
789
+ if Utils.match_content_type(content_type, 'application/json')
790
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
791
+ res.bad_request_response = out
792
+ end
793
+ elsif r.status == 401
794
+ if Utils.match_content_type(content_type, 'application/json')
795
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
796
+ res.unauthorized_response = out
797
+ end
798
+ elsif r.status == 403
799
+ if Utils.match_content_type(content_type, 'application/json')
800
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
801
+ res.forbidden_response = out
802
+ end
803
+ elsif r.status == 404
804
+ if Utils.match_content_type(content_type, 'application/json')
805
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
806
+ res.not_found_response = out
807
+ end
317
808
  elsif r.status == 408
318
809
  res.headers = r.headers
319
- elsif [400, 403, 412, 429].include?(r.status)
320
- elsif [500, 501].include?(r.status)
810
+ if Utils.match_content_type(content_type, 'application/json')
811
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
812
+ res.request_timed_out_response = out
813
+ end
814
+ elsif r.status == 409
815
+ if Utils.match_content_type(content_type, 'application/json')
816
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
817
+ res.conflict_response = out
818
+ end
819
+ elsif r.status == 412
820
+ if Utils.match_content_type(content_type, 'application/json')
821
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
822
+ res.precondition_failed_response = out
823
+ end
824
+ elsif r.status == 422
825
+ if Utils.match_content_type(content_type, 'application/json')
826
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
827
+ res.unprocessable_entity_response = out
828
+ end
829
+ elsif r.status == 429
830
+ if Utils.match_content_type(content_type, 'application/json')
831
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
832
+ res.too_many_requests_response = out
833
+ end
834
+ elsif r.status == 500
835
+ if Utils.match_content_type(content_type, 'application/json')
836
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
837
+ res.internal_server_error_response = out
838
+ end
839
+ elsif r.status == 501
840
+ if Utils.match_content_type(content_type, 'application/json')
841
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
842
+ res.not_implemented_response = out
843
+ end
844
+ elsif r.status == 502
845
+ if Utils.match_content_type(content_type, 'application/json')
846
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
847
+ res.bad_gateway_response = out
848
+ end
321
849
  end
322
850
 
323
851
  res
324
852
  end
325
853
 
326
854
 
327
- sig { params(request: T.nilable(::StackOne::Operations::CrmListAccountsRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::CrmListAccountsResponse) }
328
- def list_accounts(request, retries = nil)
855
+ sig { params(request: T.nilable(::StackOne::Operations::CrmListAccountsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmListAccountsResponse) }
856
+ def list_accounts(request, retries = nil, timeout_ms = nil)
329
857
  # list_accounts - List Accounts
330
858
  url, params = @sdk_configuration.get_server_details
331
859
  base_url = Utils.template_url(url, params)
@@ -348,14 +876,62 @@ module StackOne
348
876
  retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
349
877
  retry_options[:retry_statuses] = [429, 408]
350
878
 
879
+ security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
880
+
881
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
882
+ timeout ||= @sdk_configuration.timeout
883
+
351
884
  connection = @sdk_configuration.client.dup
352
885
  connection.request :retry, retry_options
353
886
 
354
- r = connection.get(url) do |req|
355
- req.headers = headers
356
- req.params = query_params
357
- security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
358
- Utils.configure_request_security(req, security) if !security.nil?
887
+ hook_ctx = SDKHooks::HookContext.new(
888
+ base_url: base_url,
889
+ oauth2_scopes: nil,
890
+ operation_id: 'crm_list_accounts',
891
+ security_source: @sdk_configuration.security_source
892
+ )
893
+
894
+ error = T.let(nil, T.nilable(StandardError))
895
+ r = T.let(nil, T.nilable(Faraday::Response))
896
+
897
+ begin
898
+ r = connection.get(url) do |req|
899
+ req.headers.merge!(headers)
900
+ req.options.timeout = timeout unless timeout.nil?
901
+ req.params = query_params
902
+ Utils.configure_request_security(req, security)
903
+
904
+ @sdk_configuration.hooks.before_request(
905
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
906
+ hook_ctx: hook_ctx
907
+ ),
908
+ request: req
909
+ )
910
+ end
911
+ rescue StandardError => e
912
+ error = e
913
+ ensure
914
+ if r.nil? || Utils.error_status?(r.status)
915
+ r = @sdk_configuration.hooks.after_error(
916
+ error: error,
917
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
918
+ hook_ctx: hook_ctx
919
+ ),
920
+ response: r
921
+ )
922
+ else
923
+ r = @sdk_configuration.hooks.after_success(
924
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
925
+ hook_ctx: hook_ctx
926
+ ),
927
+ response: r
928
+ )
929
+ end
930
+
931
+ if r.nil?
932
+ raise error if !error.nil?
933
+ raise 'no response'
934
+ end
359
935
  end
360
936
 
361
937
  content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
@@ -368,18 +944,75 @@ module StackOne
368
944
  out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::AccountsPaginated)
369
945
  res.accounts_paginated = out
370
946
  end
947
+ elsif r.status == 400
948
+ if Utils.match_content_type(content_type, 'application/json')
949
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
950
+ res.bad_request_response = out
951
+ end
952
+ elsif r.status == 401
953
+ if Utils.match_content_type(content_type, 'application/json')
954
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
955
+ res.unauthorized_response = out
956
+ end
957
+ elsif r.status == 403
958
+ if Utils.match_content_type(content_type, 'application/json')
959
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
960
+ res.forbidden_response = out
961
+ end
962
+ elsif r.status == 404
963
+ if Utils.match_content_type(content_type, 'application/json')
964
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
965
+ res.not_found_response = out
966
+ end
371
967
  elsif r.status == 408
372
968
  res.headers = r.headers
373
- elsif [400, 403, 412, 429].include?(r.status)
374
- elsif [500, 501].include?(r.status)
969
+ if Utils.match_content_type(content_type, 'application/json')
970
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
971
+ res.request_timed_out_response = out
972
+ end
973
+ elsif r.status == 409
974
+ if Utils.match_content_type(content_type, 'application/json')
975
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
976
+ res.conflict_response = out
977
+ end
978
+ elsif r.status == 412
979
+ if Utils.match_content_type(content_type, 'application/json')
980
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
981
+ res.precondition_failed_response = out
982
+ end
983
+ elsif r.status == 422
984
+ if Utils.match_content_type(content_type, 'application/json')
985
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
986
+ res.unprocessable_entity_response = out
987
+ end
988
+ elsif r.status == 429
989
+ if Utils.match_content_type(content_type, 'application/json')
990
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
991
+ res.too_many_requests_response = out
992
+ end
993
+ elsif r.status == 500
994
+ if Utils.match_content_type(content_type, 'application/json')
995
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
996
+ res.internal_server_error_response = out
997
+ end
998
+ elsif r.status == 501
999
+ if Utils.match_content_type(content_type, 'application/json')
1000
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
1001
+ res.not_implemented_response = out
1002
+ end
1003
+ elsif r.status == 502
1004
+ if Utils.match_content_type(content_type, 'application/json')
1005
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
1006
+ res.bad_gateway_response = out
1007
+ end
375
1008
  end
376
1009
 
377
1010
  res
378
1011
  end
379
1012
 
380
1013
 
381
- sig { params(request: T.nilable(::StackOne::Operations::CrmListContactCustomFieldDefinitionsRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::CrmListContactCustomFieldDefinitionsResponse) }
382
- def list_contact_custom_field_definitions(request, retries = nil)
1014
+ sig { params(request: T.nilable(::StackOne::Operations::CrmListContactCustomFieldDefinitionsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmListContactCustomFieldDefinitionsResponse) }
1015
+ def list_contact_custom_field_definitions(request, retries = nil, timeout_ms = nil)
383
1016
  # list_contact_custom_field_definitions - List Contact Custom Field Definitions
384
1017
  url, params = @sdk_configuration.get_server_details
385
1018
  base_url = Utils.template_url(url, params)
@@ -402,14 +1035,62 @@ module StackOne
402
1035
  retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
403
1036
  retry_options[:retry_statuses] = [429, 408]
404
1037
 
1038
+ security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
1039
+
1040
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1041
+ timeout ||= @sdk_configuration.timeout
1042
+
405
1043
  connection = @sdk_configuration.client.dup
406
1044
  connection.request :retry, retry_options
407
1045
 
408
- r = connection.get(url) do |req|
409
- req.headers = headers
410
- req.params = query_params
411
- security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
412
- Utils.configure_request_security(req, security) if !security.nil?
1046
+ hook_ctx = SDKHooks::HookContext.new(
1047
+ base_url: base_url,
1048
+ oauth2_scopes: nil,
1049
+ operation_id: 'crm_list_contact_custom_field_definitions',
1050
+ security_source: @sdk_configuration.security_source
1051
+ )
1052
+
1053
+ error = T.let(nil, T.nilable(StandardError))
1054
+ r = T.let(nil, T.nilable(Faraday::Response))
1055
+
1056
+ begin
1057
+ r = connection.get(url) do |req|
1058
+ req.headers.merge!(headers)
1059
+ req.options.timeout = timeout unless timeout.nil?
1060
+ req.params = query_params
1061
+ Utils.configure_request_security(req, security)
1062
+
1063
+ @sdk_configuration.hooks.before_request(
1064
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
1065
+ hook_ctx: hook_ctx
1066
+ ),
1067
+ request: req
1068
+ )
1069
+ end
1070
+ rescue StandardError => e
1071
+ error = e
1072
+ ensure
1073
+ if r.nil? || Utils.error_status?(r.status)
1074
+ r = @sdk_configuration.hooks.after_error(
1075
+ error: error,
1076
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
1077
+ hook_ctx: hook_ctx
1078
+ ),
1079
+ response: r
1080
+ )
1081
+ else
1082
+ r = @sdk_configuration.hooks.after_success(
1083
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
1084
+ hook_ctx: hook_ctx
1085
+ ),
1086
+ response: r
1087
+ )
1088
+ end
1089
+
1090
+ if r.nil?
1091
+ raise error if !error.nil?
1092
+ raise 'no response'
1093
+ end
413
1094
  end
414
1095
 
415
1096
  content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
@@ -422,18 +1103,75 @@ module StackOne
422
1103
  out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CustomFieldDefinitionsPaginated)
423
1104
  res.custom_field_definitions_paginated = out
424
1105
  end
1106
+ elsif r.status == 400
1107
+ if Utils.match_content_type(content_type, 'application/json')
1108
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
1109
+ res.bad_request_response = out
1110
+ end
1111
+ elsif r.status == 401
1112
+ if Utils.match_content_type(content_type, 'application/json')
1113
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
1114
+ res.unauthorized_response = out
1115
+ end
1116
+ elsif r.status == 403
1117
+ if Utils.match_content_type(content_type, 'application/json')
1118
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
1119
+ res.forbidden_response = out
1120
+ end
1121
+ elsif r.status == 404
1122
+ if Utils.match_content_type(content_type, 'application/json')
1123
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
1124
+ res.not_found_response = out
1125
+ end
425
1126
  elsif r.status == 408
426
1127
  res.headers = r.headers
427
- elsif [400, 403, 412, 429].include?(r.status)
428
- elsif [500, 501].include?(r.status)
1128
+ if Utils.match_content_type(content_type, 'application/json')
1129
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
1130
+ res.request_timed_out_response = out
1131
+ end
1132
+ elsif r.status == 409
1133
+ if Utils.match_content_type(content_type, 'application/json')
1134
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
1135
+ res.conflict_response = out
1136
+ end
1137
+ elsif r.status == 412
1138
+ if Utils.match_content_type(content_type, 'application/json')
1139
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
1140
+ res.precondition_failed_response = out
1141
+ end
1142
+ elsif r.status == 422
1143
+ if Utils.match_content_type(content_type, 'application/json')
1144
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
1145
+ res.unprocessable_entity_response = out
1146
+ end
1147
+ elsif r.status == 429
1148
+ if Utils.match_content_type(content_type, 'application/json')
1149
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
1150
+ res.too_many_requests_response = out
1151
+ end
1152
+ elsif r.status == 500
1153
+ if Utils.match_content_type(content_type, 'application/json')
1154
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
1155
+ res.internal_server_error_response = out
1156
+ end
1157
+ elsif r.status == 501
1158
+ if Utils.match_content_type(content_type, 'application/json')
1159
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
1160
+ res.not_implemented_response = out
1161
+ end
1162
+ elsif r.status == 502
1163
+ if Utils.match_content_type(content_type, 'application/json')
1164
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
1165
+ res.bad_gateway_response = out
1166
+ end
429
1167
  end
430
1168
 
431
1169
  res
432
1170
  end
433
1171
 
434
1172
 
435
- sig { params(request: T.nilable(::StackOne::Operations::CrmListContactsRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::CrmListContactsResponse) }
436
- def list_contacts(request, retries = nil)
1173
+ sig { params(request: T.nilable(::StackOne::Operations::CrmListContactsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmListContactsResponse) }
1174
+ def list_contacts(request, retries = nil, timeout_ms = nil)
437
1175
  # list_contacts - List Contacts
438
1176
  url, params = @sdk_configuration.get_server_details
439
1177
  base_url = Utils.template_url(url, params)
@@ -456,14 +1194,62 @@ module StackOne
456
1194
  retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
457
1195
  retry_options[:retry_statuses] = [429, 408]
458
1196
 
1197
+ security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
1198
+
1199
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1200
+ timeout ||= @sdk_configuration.timeout
1201
+
459
1202
  connection = @sdk_configuration.client.dup
460
1203
  connection.request :retry, retry_options
461
1204
 
462
- r = connection.get(url) do |req|
463
- req.headers = headers
464
- req.params = query_params
465
- security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
466
- Utils.configure_request_security(req, security) if !security.nil?
1205
+ hook_ctx = SDKHooks::HookContext.new(
1206
+ base_url: base_url,
1207
+ oauth2_scopes: nil,
1208
+ operation_id: 'crm_list_contacts',
1209
+ security_source: @sdk_configuration.security_source
1210
+ )
1211
+
1212
+ error = T.let(nil, T.nilable(StandardError))
1213
+ r = T.let(nil, T.nilable(Faraday::Response))
1214
+
1215
+ begin
1216
+ r = connection.get(url) do |req|
1217
+ req.headers.merge!(headers)
1218
+ req.options.timeout = timeout unless timeout.nil?
1219
+ req.params = query_params
1220
+ Utils.configure_request_security(req, security)
1221
+
1222
+ @sdk_configuration.hooks.before_request(
1223
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
1224
+ hook_ctx: hook_ctx
1225
+ ),
1226
+ request: req
1227
+ )
1228
+ end
1229
+ rescue StandardError => e
1230
+ error = e
1231
+ ensure
1232
+ if r.nil? || Utils.error_status?(r.status)
1233
+ r = @sdk_configuration.hooks.after_error(
1234
+ error: error,
1235
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
1236
+ hook_ctx: hook_ctx
1237
+ ),
1238
+ response: r
1239
+ )
1240
+ else
1241
+ r = @sdk_configuration.hooks.after_success(
1242
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
1243
+ hook_ctx: hook_ctx
1244
+ ),
1245
+ response: r
1246
+ )
1247
+ end
1248
+
1249
+ if r.nil?
1250
+ raise error if !error.nil?
1251
+ raise 'no response'
1252
+ end
467
1253
  end
468
1254
 
469
1255
  content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
@@ -476,18 +1262,75 @@ module StackOne
476
1262
  out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ContactsPaginated)
477
1263
  res.contacts_paginated = out
478
1264
  end
1265
+ elsif r.status == 400
1266
+ if Utils.match_content_type(content_type, 'application/json')
1267
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
1268
+ res.bad_request_response = out
1269
+ end
1270
+ elsif r.status == 401
1271
+ if Utils.match_content_type(content_type, 'application/json')
1272
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
1273
+ res.unauthorized_response = out
1274
+ end
1275
+ elsif r.status == 403
1276
+ if Utils.match_content_type(content_type, 'application/json')
1277
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
1278
+ res.forbidden_response = out
1279
+ end
1280
+ elsif r.status == 404
1281
+ if Utils.match_content_type(content_type, 'application/json')
1282
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
1283
+ res.not_found_response = out
1284
+ end
479
1285
  elsif r.status == 408
480
1286
  res.headers = r.headers
481
- elsif [400, 403, 412, 429].include?(r.status)
482
- elsif [500, 501].include?(r.status)
1287
+ if Utils.match_content_type(content_type, 'application/json')
1288
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
1289
+ res.request_timed_out_response = out
1290
+ end
1291
+ elsif r.status == 409
1292
+ if Utils.match_content_type(content_type, 'application/json')
1293
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
1294
+ res.conflict_response = out
1295
+ end
1296
+ elsif r.status == 412
1297
+ if Utils.match_content_type(content_type, 'application/json')
1298
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
1299
+ res.precondition_failed_response = out
1300
+ end
1301
+ elsif r.status == 422
1302
+ if Utils.match_content_type(content_type, 'application/json')
1303
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
1304
+ res.unprocessable_entity_response = out
1305
+ end
1306
+ elsif r.status == 429
1307
+ if Utils.match_content_type(content_type, 'application/json')
1308
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
1309
+ res.too_many_requests_response = out
1310
+ end
1311
+ elsif r.status == 500
1312
+ if Utils.match_content_type(content_type, 'application/json')
1313
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
1314
+ res.internal_server_error_response = out
1315
+ end
1316
+ elsif r.status == 501
1317
+ if Utils.match_content_type(content_type, 'application/json')
1318
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
1319
+ res.not_implemented_response = out
1320
+ end
1321
+ elsif r.status == 502
1322
+ if Utils.match_content_type(content_type, 'application/json')
1323
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
1324
+ res.bad_gateway_response = out
1325
+ end
483
1326
  end
484
1327
 
485
1328
  res
486
1329
  end
487
1330
 
488
1331
 
489
- sig { params(request: T.nilable(::StackOne::Operations::CrmListListsRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::CrmListListsResponse) }
490
- def list_lists(request, retries = nil)
1332
+ sig { params(request: T.nilable(::StackOne::Operations::CrmListListsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmListListsResponse) }
1333
+ def list_lists(request, retries = nil, timeout_ms = nil)
491
1334
  # list_lists - Get all Lists
492
1335
  url, params = @sdk_configuration.get_server_details
493
1336
  base_url = Utils.template_url(url, params)
@@ -510,14 +1353,62 @@ module StackOne
510
1353
  retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
511
1354
  retry_options[:retry_statuses] = [429, 408]
512
1355
 
1356
+ security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
1357
+
1358
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1359
+ timeout ||= @sdk_configuration.timeout
1360
+
513
1361
  connection = @sdk_configuration.client.dup
514
1362
  connection.request :retry, retry_options
515
1363
 
516
- r = connection.get(url) do |req|
517
- req.headers = headers
518
- req.params = query_params
519
- security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
520
- Utils.configure_request_security(req, security) if !security.nil?
1364
+ hook_ctx = SDKHooks::HookContext.new(
1365
+ base_url: base_url,
1366
+ oauth2_scopes: nil,
1367
+ operation_id: 'crm_list_lists',
1368
+ security_source: @sdk_configuration.security_source
1369
+ )
1370
+
1371
+ error = T.let(nil, T.nilable(StandardError))
1372
+ r = T.let(nil, T.nilable(Faraday::Response))
1373
+
1374
+ begin
1375
+ r = connection.get(url) do |req|
1376
+ req.headers.merge!(headers)
1377
+ req.options.timeout = timeout unless timeout.nil?
1378
+ req.params = query_params
1379
+ Utils.configure_request_security(req, security)
1380
+
1381
+ @sdk_configuration.hooks.before_request(
1382
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
1383
+ hook_ctx: hook_ctx
1384
+ ),
1385
+ request: req
1386
+ )
1387
+ end
1388
+ rescue StandardError => e
1389
+ error = e
1390
+ ensure
1391
+ if r.nil? || Utils.error_status?(r.status)
1392
+ r = @sdk_configuration.hooks.after_error(
1393
+ error: error,
1394
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
1395
+ hook_ctx: hook_ctx
1396
+ ),
1397
+ response: r
1398
+ )
1399
+ else
1400
+ r = @sdk_configuration.hooks.after_success(
1401
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
1402
+ hook_ctx: hook_ctx
1403
+ ),
1404
+ response: r
1405
+ )
1406
+ end
1407
+
1408
+ if r.nil?
1409
+ raise error if !error.nil?
1410
+ raise 'no response'
1411
+ end
521
1412
  end
522
1413
 
523
1414
  content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
@@ -530,18 +1421,75 @@ module StackOne
530
1421
  out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ListsPaginated)
531
1422
  res.lists_paginated = out
532
1423
  end
1424
+ elsif r.status == 400
1425
+ if Utils.match_content_type(content_type, 'application/json')
1426
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
1427
+ res.bad_request_response = out
1428
+ end
1429
+ elsif r.status == 401
1430
+ if Utils.match_content_type(content_type, 'application/json')
1431
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
1432
+ res.unauthorized_response = out
1433
+ end
1434
+ elsif r.status == 403
1435
+ if Utils.match_content_type(content_type, 'application/json')
1436
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
1437
+ res.forbidden_response = out
1438
+ end
1439
+ elsif r.status == 404
1440
+ if Utils.match_content_type(content_type, 'application/json')
1441
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
1442
+ res.not_found_response = out
1443
+ end
533
1444
  elsif r.status == 408
534
1445
  res.headers = r.headers
535
- elsif [400, 403, 412, 429].include?(r.status)
536
- elsif [500, 501].include?(r.status)
1446
+ if Utils.match_content_type(content_type, 'application/json')
1447
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
1448
+ res.request_timed_out_response = out
1449
+ end
1450
+ elsif r.status == 409
1451
+ if Utils.match_content_type(content_type, 'application/json')
1452
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
1453
+ res.conflict_response = out
1454
+ end
1455
+ elsif r.status == 412
1456
+ if Utils.match_content_type(content_type, 'application/json')
1457
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
1458
+ res.precondition_failed_response = out
1459
+ end
1460
+ elsif r.status == 422
1461
+ if Utils.match_content_type(content_type, 'application/json')
1462
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
1463
+ res.unprocessable_entity_response = out
1464
+ end
1465
+ elsif r.status == 429
1466
+ if Utils.match_content_type(content_type, 'application/json')
1467
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
1468
+ res.too_many_requests_response = out
1469
+ end
1470
+ elsif r.status == 500
1471
+ if Utils.match_content_type(content_type, 'application/json')
1472
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
1473
+ res.internal_server_error_response = out
1474
+ end
1475
+ elsif r.status == 501
1476
+ if Utils.match_content_type(content_type, 'application/json')
1477
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
1478
+ res.not_implemented_response = out
1479
+ end
1480
+ elsif r.status == 502
1481
+ if Utils.match_content_type(content_type, 'application/json')
1482
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
1483
+ res.bad_gateway_response = out
1484
+ end
537
1485
  end
538
1486
 
539
1487
  res
540
1488
  end
541
1489
 
542
1490
 
543
- sig { params(crm_create_contact_request_dto: ::StackOne::Shared::CrmCreateContactRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::CrmUpdateContactResponse) }
544
- def update_contact(crm_create_contact_request_dto, id, x_account_id, retries = nil)
1491
+ sig { params(crm_create_contact_request_dto: ::StackOne::Shared::CrmCreateContactRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::CrmUpdateContactResponse) }
1492
+ def update_contact(crm_create_contact_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
545
1493
  # update_contact - Update Contact (early access)
546
1494
  request = ::StackOne::Operations::CrmUpdateContactRequest.new(
547
1495
 
@@ -561,6 +1509,14 @@ module StackOne
561
1509
  req_content_type, data, form = Utils.serialize_request_body(request, :crm_create_contact_request_dto, :json)
562
1510
  headers['content-type'] = req_content_type
563
1511
  raise StandardError, 'request body is required' if data.nil? && form.nil?
1512
+
1513
+ if form
1514
+ body = Utils.encode_form(form)
1515
+ elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
1516
+ body = URI.encode_www_form(data)
1517
+ else
1518
+ body = data
1519
+ end
564
1520
  headers['Accept'] = 'application/json'
565
1521
  headers['user-agent'] = @sdk_configuration.user_agent
566
1522
  retries ||= @sdk_configuration.retry_config
@@ -577,19 +1533,61 @@ module StackOne
577
1533
  retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
578
1534
  retry_options[:retry_statuses] = [429, 408]
579
1535
 
1536
+ security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
1537
+
1538
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1539
+ timeout ||= @sdk_configuration.timeout
1540
+
580
1541
  connection = @sdk_configuration.client.dup
581
1542
  connection.request :retry, retry_options
582
1543
 
583
- r = connection.patch(url) do |req|
584
- req.headers = headers
585
- security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
586
- Utils.configure_request_security(req, security) if !security.nil?
587
- if form
588
- req.body = Utils.encode_form(form)
589
- elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
590
- req.body = URI.encode_www_form(data)
1544
+ hook_ctx = SDKHooks::HookContext.new(
1545
+ base_url: base_url,
1546
+ oauth2_scopes: nil,
1547
+ operation_id: 'crm_update_contact',
1548
+ security_source: @sdk_configuration.security_source
1549
+ )
1550
+
1551
+ error = T.let(nil, T.nilable(StandardError))
1552
+ r = T.let(nil, T.nilable(Faraday::Response))
1553
+
1554
+ begin
1555
+ r = connection.patch(url) do |req|
1556
+ req.body = body
1557
+ req.headers.merge!(headers)
1558
+ req.options.timeout = timeout unless timeout.nil?
1559
+ Utils.configure_request_security(req, security)
1560
+
1561
+ @sdk_configuration.hooks.before_request(
1562
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
1563
+ hook_ctx: hook_ctx
1564
+ ),
1565
+ request: req
1566
+ )
1567
+ end
1568
+ rescue StandardError => e
1569
+ error = e
1570
+ ensure
1571
+ if r.nil? || Utils.error_status?(r.status)
1572
+ r = @sdk_configuration.hooks.after_error(
1573
+ error: error,
1574
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
1575
+ hook_ctx: hook_ctx
1576
+ ),
1577
+ response: r
1578
+ )
591
1579
  else
592
- req.body = data
1580
+ r = @sdk_configuration.hooks.after_success(
1581
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
1582
+ hook_ctx: hook_ctx
1583
+ ),
1584
+ response: r
1585
+ )
1586
+ end
1587
+
1588
+ if r.nil?
1589
+ raise error if !error.nil?
1590
+ raise 'no response'
593
1591
  end
594
1592
  end
595
1593
 
@@ -603,10 +1601,67 @@ module StackOne
603
1601
  out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ContactResult)
604
1602
  res.contact_result = out
605
1603
  end
1604
+ elsif r.status == 400
1605
+ if Utils.match_content_type(content_type, 'application/json')
1606
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
1607
+ res.bad_request_response = out
1608
+ end
1609
+ elsif r.status == 401
1610
+ if Utils.match_content_type(content_type, 'application/json')
1611
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
1612
+ res.unauthorized_response = out
1613
+ end
1614
+ elsif r.status == 403
1615
+ if Utils.match_content_type(content_type, 'application/json')
1616
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
1617
+ res.forbidden_response = out
1618
+ end
1619
+ elsif r.status == 404
1620
+ if Utils.match_content_type(content_type, 'application/json')
1621
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
1622
+ res.not_found_response = out
1623
+ end
606
1624
  elsif r.status == 408
607
1625
  res.headers = r.headers
608
- elsif [400, 403, 412, 429].include?(r.status)
609
- elsif [500, 501].include?(r.status)
1626
+ if Utils.match_content_type(content_type, 'application/json')
1627
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
1628
+ res.request_timed_out_response = out
1629
+ end
1630
+ elsif r.status == 409
1631
+ if Utils.match_content_type(content_type, 'application/json')
1632
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
1633
+ res.conflict_response = out
1634
+ end
1635
+ elsif r.status == 412
1636
+ if Utils.match_content_type(content_type, 'application/json')
1637
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
1638
+ res.precondition_failed_response = out
1639
+ end
1640
+ elsif r.status == 422
1641
+ if Utils.match_content_type(content_type, 'application/json')
1642
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
1643
+ res.unprocessable_entity_response = out
1644
+ end
1645
+ elsif r.status == 429
1646
+ if Utils.match_content_type(content_type, 'application/json')
1647
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
1648
+ res.too_many_requests_response = out
1649
+ end
1650
+ elsif r.status == 500
1651
+ if Utils.match_content_type(content_type, 'application/json')
1652
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
1653
+ res.internal_server_error_response = out
1654
+ end
1655
+ elsif r.status == 501
1656
+ if Utils.match_content_type(content_type, 'application/json')
1657
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
1658
+ res.not_implemented_response = out
1659
+ end
1660
+ elsif r.status == 502
1661
+ if Utils.match_content_type(content_type, 'application/json')
1662
+ out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
1663
+ res.bad_gateway_response = out
1664
+ end
610
1665
  end
611
1666
 
612
1667
  res