api-sdk-rb 1.11.66 → 1.11.111

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 (317) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +192 -9
  3. data/docs/AdapterConnection.md +7 -1
  4. data/docs/BrandColor.md +22 -0
  5. data/docs/BrandFont.md +24 -0
  6. data/docs/BrandKitApi.md +593 -0
  7. data/docs/BrandKitAssetView.md +42 -0
  8. data/docs/BrandKitFigmaSource.md +26 -0
  9. data/docs/BrandKitTokens.md +24 -0
  10. data/docs/BrandKitTokensFonts.md +24 -0
  11. data/docs/BrandKitView.md +36 -0
  12. data/docs/BrandKitViewOwner.md +20 -0
  13. data/docs/BrandKitViewResponse.md +22 -0
  14. data/docs/BrandSpacing.md +32 -0
  15. data/docs/Composition.md +5 -1
  16. data/docs/CompositionLastEditedBy.md +20 -0
  17. data/docs/CompositionsApi.md +217 -135
  18. data/docs/ConfirmAdapterConnectionRequest.md +18 -0
  19. data/docs/CreateWidget201ResponseData.md +2 -4
  20. data/docs/CreateWorkspaceWorkflowFromPreset201Response.md +22 -0
  21. data/docs/CreateWorkspaceWorkflowFromPresetRequest.md +20 -0
  22. data/docs/CreateWorkspaceWorkflowRequest.md +22 -0
  23. data/docs/DeleteWorkspaceWorkflow200Response.md +22 -0
  24. data/docs/GetPublicCompositionEmbed200Response.md +7 -1
  25. data/docs/GetPublicCompositionEmbed200ResponseAdapters.md +20 -0
  26. data/docs/GetPublicCompositionEmbed200ResponseAdaptersCaptcha.md +18 -0
  27. data/docs/GetPublicCompositionEmbed200ResponseEntries.md +20 -0
  28. data/docs/GetPublicCompositionEmbed200ResponseMedia.md +18 -0
  29. data/docs/GetPublicWorkflow200Response.md +22 -0
  30. data/docs/GetWorkspaceWorkflowStats200Response.md +22 -0
  31. data/docs/GetWorkspaceWorkflowVersion200Response.md +22 -0
  32. data/docs/ListPartnerWorkflowPresets200Response.md +22 -0
  33. data/docs/ListWorkspaceWorkflowCompositionOptions200Response.md +22 -0
  34. data/docs/ListWorkspaceWorkflowPresets200Response.md +22 -0
  35. data/docs/ListWorkspaceWorkflowVersions200Response.md +22 -0
  36. data/docs/ListWorkspaceWorkflows200Response.md +22 -0
  37. data/docs/ManagedUsersApi.md +1 -1
  38. data/docs/NewComposition.md +1 -1
  39. data/docs/NewEditorSession.md +1 -1
  40. data/docs/OfferWorkflowPresetRequest.md +24 -0
  41. data/docs/OfferedWorkflowPreset.md +40 -0
  42. data/docs/OfferedWorkflowPresetList.md +18 -0
  43. data/docs/OfferedWorkflowPresetWidget.md +22 -0
  44. data/docs/PartnerApi.md +3360 -538
  45. data/docs/PartnerCustomization.md +2 -2
  46. data/docs/PartnerNotification.md +1 -1
  47. data/docs/PartnersApi.md +294 -2
  48. data/docs/PatchBrandKitAssetRequest.md +24 -0
  49. data/docs/PatchBrandKitRequest.md +28 -0
  50. data/docs/PatchBrandKitRequestFonts.md +24 -0
  51. data/docs/PatchBrandKitRequestSpacing.md +32 -0
  52. data/docs/PostBrandKitIconRequest.md +20 -0
  53. data/docs/PublicEmbedApi.md +270 -4
  54. data/docs/PublicWorkflow.md +36 -0
  55. data/docs/PublicWorkflowEventsAccepted.md +22 -0
  56. data/docs/PublicWorkflowEventsRequest.md +24 -0
  57. data/docs/PublicWorkflowEventsRequestEventsInner.md +22 -0
  58. data/docs/PublicWorkflowEventsRequestHeightsInner.md +20 -0
  59. data/docs/PublicWorkflowTranslation.md +20 -0
  60. data/docs/PublishWorkspaceWorkflow200Response.md +22 -0
  61. data/docs/PublishWorkspaceWorkflowRequest.md +18 -0
  62. data/docs/PutBrandKitRequest.md +22 -0
  63. data/docs/RemovePartnerWorkflowPreset200Response.md +22 -0
  64. data/docs/ReportPublicWorkflowEvents200Response.md +22 -0
  65. data/docs/SaveWorkspaceWorkflow200Response.md +22 -0
  66. data/docs/SaveWorkspaceWorkflowRequest.md +24 -0
  67. data/docs/SetAdapterConnectionRequest.md +1 -1
  68. data/docs/SetPartnerWorkflowPreset200Response.md +22 -0
  69. data/docs/UpdateComposition.md +1 -1
  70. data/docs/UsersApi.md +77 -1
  71. data/docs/Widget.md +2 -4
  72. data/docs/Workflow.md +50 -0
  73. data/docs/WorkflowCompositionAction.md +24 -0
  74. data/docs/WorkflowCompositionField.md +24 -0
  75. data/docs/WorkflowCompositionOption.md +30 -0
  76. data/docs/WorkflowCompositionOptionActions.md +22 -0
  77. data/docs/WorkflowCompositionOptionInputs.md +24 -0
  78. data/docs/WorkflowCompositionOptions.md +24 -0
  79. data/docs/WorkflowConditionCase.md +24 -0
  80. data/docs/WorkflowConditionTest.md +22 -0
  81. data/docs/WorkflowCounter.md +20 -0
  82. data/docs/WorkflowDetail.md +60 -0
  83. data/docs/WorkflowDetailAllOfLastEditedBy.md +20 -0
  84. data/docs/WorkflowEdge.md +24 -0
  85. data/docs/WorkflowFieldReference.md +22 -0
  86. data/docs/WorkflowGraph.md +22 -0
  87. data/docs/WorkflowIssue.md +28 -0
  88. data/docs/WorkflowList.md +24 -0
  89. data/docs/WorkflowNode.md +30 -0
  90. data/docs/WorkflowNodePosition.md +20 -0
  91. data/docs/WorkflowPresetChoice.md +26 -0
  92. data/docs/WorkflowPresetChoices.md +18 -0
  93. data/docs/WorkflowPresetRemoval.md +18 -0
  94. data/docs/WorkflowPresetWidget.md +20 -0
  95. data/docs/WorkflowPublishResult.md +22 -0
  96. data/docs/WorkflowRemoved.md +18 -0
  97. data/docs/WorkflowSchedule.md +24 -0
  98. data/docs/WorkflowStats.md +32 -0
  99. data/docs/WorkflowStatus.md +15 -0
  100. data/docs/WorkflowTrigger.md +28 -0
  101. data/docs/WorkflowTriggerValuesInner.md +20 -0
  102. data/docs/WorkflowVersion.md +28 -0
  103. data/docs/WorkflowVersionDetail.md +32 -0
  104. data/docs/WorkflowVersionList.md +18 -0
  105. data/docs/WorkflowVersionPublishedBy.md +20 -0
  106. data/docs/WorkflowsApi.md +1743 -0
  107. data/docs/WorkspacesApi.md +1527 -0
  108. data/lib/api-sdk-rb/api/brand_kit_api.rb +581 -0
  109. data/lib/api-sdk-rb/api/compositions_api.rb +237 -138
  110. data/lib/api-sdk-rb/api/managed_users_api.rb +2 -2
  111. data/lib/api-sdk-rb/api/partner_api.rb +3907 -809
  112. data/lib/api-sdk-rb/api/partners_api.rb +320 -4
  113. data/lib/api-sdk-rb/api/public_embed_api.rb +283 -6
  114. data/lib/api-sdk-rb/api/users_api.rb +96 -2
  115. data/lib/api-sdk-rb/api/workflows_api.rb +1997 -0
  116. data/lib/api-sdk-rb/api/workspaces_api.rb +1775 -0
  117. data/lib/api-sdk-rb/configuration.rb +50 -2
  118. data/lib/api-sdk-rb/models/adapter_connection.rb +48 -5
  119. data/lib/api-sdk-rb/models/brand_color.rb +329 -0
  120. data/lib/api-sdk-rb/models/brand_font.rb +357 -0
  121. data/lib/api-sdk-rb/models/brand_kit_asset_view.rb +409 -0
  122. data/lib/api-sdk-rb/models/brand_kit_figma_source.rb +277 -0
  123. data/lib/api-sdk-rb/models/brand_kit_tokens.rb +304 -0
  124. data/lib/api-sdk-rb/models/brand_kit_tokens_fonts.rb +241 -0
  125. data/lib/api-sdk-rb/models/brand_kit_view.rb +344 -0
  126. data/lib/api-sdk-rb/models/brand_kit_view_owner.rb +267 -0
  127. data/lib/api-sdk-rb/models/brand_kit_view_response.rb +247 -0
  128. data/lib/api-sdk-rb/models/brand_spacing.rb +557 -0
  129. data/lib/api-sdk-rb/models/composition.rb +26 -5
  130. data/lib/api-sdk-rb/models/composition_last_edited_by.rb +242 -0
  131. data/lib/api-sdk-rb/models/confirm_adapter_connection_request.rb +241 -0
  132. data/lib/api-sdk-rb/models/create_widget201_response_data.rb +9 -20
  133. data/lib/api-sdk-rb/models/create_workspace_workflow_from_preset201_response.rb +246 -0
  134. data/lib/api-sdk-rb/models/create_workspace_workflow_from_preset_request.rb +278 -0
  135. data/lib/api-sdk-rb/models/create_workspace_workflow_request.rb +271 -0
  136. data/lib/api-sdk-rb/models/delete_workspace_workflow200_response.rb +246 -0
  137. data/lib/api-sdk-rb/models/get_public_composition_embed200_response.rb +29 -2
  138. data/lib/api-sdk-rb/models/get_public_composition_embed200_response_adapters.rb +225 -0
  139. data/lib/api-sdk-rb/models/get_public_composition_embed200_response_adapters_captcha.rb +216 -0
  140. data/lib/api-sdk-rb/models/get_public_composition_embed200_response_entries.rb +224 -0
  141. data/lib/api-sdk-rb/models/get_public_composition_embed200_response_media.rb +216 -0
  142. data/lib/api-sdk-rb/models/get_public_workflow200_response.rb +246 -0
  143. data/lib/api-sdk-rb/models/get_workspace_workflow_stats200_response.rb +246 -0
  144. data/lib/api-sdk-rb/models/get_workspace_workflow_version200_response.rb +246 -0
  145. data/lib/api-sdk-rb/models/list_partner_workflow_presets200_response.rb +246 -0
  146. data/lib/api-sdk-rb/models/list_workspace_workflow_composition_options200_response.rb +246 -0
  147. data/lib/api-sdk-rb/models/list_workspace_workflow_presets200_response.rb +246 -0
  148. data/lib/api-sdk-rb/models/list_workspace_workflow_versions200_response.rb +246 -0
  149. data/lib/api-sdk-rb/models/list_workspace_workflows200_response.rb +246 -0
  150. data/lib/api-sdk-rb/models/new_composition.rb +1 -1
  151. data/lib/api-sdk-rb/models/new_editor_session.rb +1 -1
  152. data/lib/api-sdk-rb/models/offer_workflow_preset_request.rb +322 -0
  153. data/lib/api-sdk-rb/models/offered_workflow_preset.rb +423 -0
  154. data/lib/api-sdk-rb/models/offered_workflow_preset_list.rb +223 -0
  155. data/lib/api-sdk-rb/models/offered_workflow_preset_widget.rb +251 -0
  156. data/lib/api-sdk-rb/models/partner_notification.rb +1 -1
  157. data/lib/api-sdk-rb/models/partner_notification_event_type.rb +5 -1
  158. data/lib/api-sdk-rb/models/patch_brand_kit_asset_request.rb +289 -0
  159. data/lib/api-sdk-rb/models/patch_brand_kit_request.rb +332 -0
  160. data/lib/api-sdk-rb/models/patch_brand_kit_request_fonts.rb +242 -0
  161. data/lib/api-sdk-rb/models/patch_brand_kit_request_spacing.rb +502 -0
  162. data/lib/api-sdk-rb/models/post_brand_kit_icon_request.rb +237 -0
  163. data/lib/api-sdk-rb/models/public_workflow.rb +351 -0
  164. data/lib/api-sdk-rb/models/public_workflow_events_accepted.rb +242 -0
  165. data/lib/api-sdk-rb/models/public_workflow_events_request.rb +301 -0
  166. data/lib/api-sdk-rb/models/public_workflow_events_request_events_inner.rb +332 -0
  167. data/lib/api-sdk-rb/models/public_workflow_events_request_heights_inner.rb +267 -0
  168. data/lib/api-sdk-rb/models/public_workflow_translation.rb +242 -0
  169. data/lib/api-sdk-rb/models/publish_workspace_workflow200_response.rb +246 -0
  170. data/lib/api-sdk-rb/models/publish_workspace_workflow_request.rb +240 -0
  171. data/lib/api-sdk-rb/models/put_brand_kit_request.rb +239 -0
  172. data/lib/api-sdk-rb/models/remove_partner_workflow_preset200_response.rb +246 -0
  173. data/lib/api-sdk-rb/models/report_public_workflow_events200_response.rb +246 -0
  174. data/lib/api-sdk-rb/models/save_workspace_workflow200_response.rb +246 -0
  175. data/lib/api-sdk-rb/models/save_workspace_workflow_request.rb +296 -0
  176. data/lib/api-sdk-rb/models/set_adapter_connection_request.rb +1 -1
  177. data/lib/api-sdk-rb/models/set_partner_workflow_preset200_response.rb +246 -0
  178. data/lib/api-sdk-rb/models/update_composition.rb +1 -1
  179. data/lib/api-sdk-rb/models/widget.rb +9 -20
  180. data/lib/api-sdk-rb/models/workflow.rb +509 -0
  181. data/lib/api-sdk-rb/models/workflow_composition_action.rb +266 -0
  182. data/lib/api-sdk-rb/models/workflow_composition_field.rb +303 -0
  183. data/lib/api-sdk-rb/models/workflow_composition_option.rb +316 -0
  184. data/lib/api-sdk-rb/models/workflow_composition_option_actions.rb +284 -0
  185. data/lib/api-sdk-rb/models/workflow_composition_option_inputs.rb +304 -0
  186. data/lib/api-sdk-rb/models/workflow_composition_options.rb +271 -0
  187. data/lib/api-sdk-rb/models/workflow_condition_case.rb +322 -0
  188. data/lib/api-sdk-rb/models/workflow_condition_test.rb +284 -0
  189. data/lib/api-sdk-rb/models/workflow_counter.rb +238 -0
  190. data/lib/api-sdk-rb/models/workflow_detail.rb +580 -0
  191. data/lib/api-sdk-rb/models/workflow_detail_all_of_last_edited_by.rb +242 -0
  192. data/lib/api-sdk-rb/models/workflow_edge.rb +292 -0
  193. data/lib/api-sdk-rb/models/workflow_field_reference.rb +300 -0
  194. data/lib/api-sdk-rb/models/workflow_graph.rb +330 -0
  195. data/lib/api-sdk-rb/models/workflow_issue.rb +309 -0
  196. data/lib/api-sdk-rb/models/workflow_list.rb +271 -0
  197. data/lib/api-sdk-rb/models/workflow_node.rb +343 -0
  198. data/lib/api-sdk-rb/models/workflow_node_position.rb +238 -0
  199. data/lib/api-sdk-rb/models/workflow_preset_choice.rb +288 -0
  200. data/lib/api-sdk-rb/models/workflow_preset_choices.rb +224 -0
  201. data/lib/api-sdk-rb/models/workflow_preset_removal.rb +222 -0
  202. data/lib/api-sdk-rb/models/workflow_preset_widget.rb +234 -0
  203. data/lib/api-sdk-rb/models/workflow_publish_result.rb +256 -0
  204. data/lib/api-sdk-rb/models/workflow_removed.rb +221 -0
  205. data/lib/api-sdk-rb/models/workflow_schedule.rb +298 -0
  206. data/lib/api-sdk-rb/models/workflow_stats.rb +335 -0
  207. data/lib/api-sdk-rb/models/workflow_status.rb +42 -0
  208. data/lib/api-sdk-rb/models/workflow_trigger.rb +303 -0
  209. data/lib/api-sdk-rb/models/workflow_trigger_values_inner.rb +271 -0
  210. data/lib/api-sdk-rb/models/workflow_version.rb +316 -0
  211. data/lib/api-sdk-rb/models/workflow_version_detail.rb +354 -0
  212. data/lib/api-sdk-rb/models/workflow_version_list.rb +224 -0
  213. data/lib/api-sdk-rb/models/workflow_version_published_by.rb +225 -0
  214. data/lib/api-sdk-rb/version.rb +1 -1
  215. data/lib/api-sdk-rb.rb +88 -0
  216. data/spec/api/brand_kit_api_spec.rb +136 -0
  217. data/spec/api/compositions_api_spec.rb +86 -69
  218. data/spec/api/managed_users_api_spec.rb +1 -1
  219. data/spec/api/partner_api_spec.rb +624 -82
  220. data/spec/api/partners_api_spec.rb +56 -2
  221. data/spec/api/public_embed_api_spec.rb +54 -3
  222. data/spec/api/users_api_spec.rb +16 -1
  223. data/spec/api/workflows_api_spec.rb +378 -0
  224. data/spec/api/workspaces_api_spec.rb +339 -0
  225. data/spec/models/adapter_connection_spec.rb +18 -0
  226. data/spec/models/brand_color_spec.rb +52 -0
  227. data/spec/models/brand_font_spec.rb +62 -0
  228. data/spec/models/brand_kit_asset_view_spec.rb +120 -0
  229. data/spec/models/brand_kit_figma_source_spec.rb +60 -0
  230. data/spec/models/brand_kit_tokens_fonts_spec.rb +54 -0
  231. data/spec/models/brand_kit_tokens_spec.rb +54 -0
  232. data/spec/models/brand_kit_view_owner_spec.rb +46 -0
  233. data/spec/models/brand_kit_view_response_spec.rb +48 -0
  234. data/spec/models/brand_kit_view_spec.rb +90 -0
  235. data/spec/models/brand_spacing_spec.rb +78 -0
  236. data/spec/models/composition_last_edited_by_spec.rb +42 -0
  237. data/spec/models/composition_spec.rb +12 -0
  238. data/spec/models/confirm_adapter_connection_request_spec.rb +36 -0
  239. data/spec/models/create_widget201_response_data_spec.rb +1 -7
  240. data/spec/models/create_workspace_workflow_from_preset201_response_spec.rb +48 -0
  241. data/spec/models/create_workspace_workflow_from_preset_request_spec.rb +42 -0
  242. data/spec/models/create_workspace_workflow_request_spec.rb +48 -0
  243. data/spec/models/delete_workspace_workflow200_response_spec.rb +48 -0
  244. data/spec/models/editor_session_spec.rb +1 -1
  245. data/spec/models/get_public_composition_embed200_response_adapters_captcha_spec.rb +36 -0
  246. data/spec/models/get_public_composition_embed200_response_adapters_spec.rb +42 -0
  247. data/spec/models/get_public_composition_embed200_response_entries_spec.rb +42 -0
  248. data/spec/models/get_public_composition_embed200_response_media_spec.rb +36 -0
  249. data/spec/models/get_public_composition_embed200_response_spec.rb +18 -0
  250. data/spec/models/get_public_workflow200_response_spec.rb +48 -0
  251. data/spec/models/get_workspace_workflow_stats200_response_spec.rb +48 -0
  252. data/spec/models/get_workspace_workflow_version200_response_spec.rb +48 -0
  253. data/spec/models/list_partner_workflow_presets200_response_spec.rb +48 -0
  254. data/spec/models/list_workspace_workflow_composition_options200_response_spec.rb +48 -0
  255. data/spec/models/list_workspace_workflow_presets200_response_spec.rb +48 -0
  256. data/spec/models/list_workspace_workflow_versions200_response_spec.rb +48 -0
  257. data/spec/models/list_workspace_workflows200_response_spec.rb +48 -0
  258. data/spec/models/new_editor_session_spec.rb +1 -1
  259. data/spec/models/offer_workflow_preset_request_spec.rb +54 -0
  260. data/spec/models/offered_workflow_preset_list_spec.rb +36 -0
  261. data/spec/models/offered_workflow_preset_spec.rb +106 -0
  262. data/spec/models/offered_workflow_preset_widget_spec.rb +48 -0
  263. data/spec/models/patch_brand_kit_asset_request_spec.rb +62 -0
  264. data/spec/models/patch_brand_kit_request_fonts_spec.rb +54 -0
  265. data/spec/models/patch_brand_kit_request_spacing_spec.rb +78 -0
  266. data/spec/models/patch_brand_kit_request_spec.rb +66 -0
  267. data/spec/models/post_brand_kit_icon_request_spec.rb +42 -0
  268. data/spec/models/public_workflow_events_accepted_spec.rb +48 -0
  269. data/spec/models/public_workflow_events_request_events_inner_spec.rb +52 -0
  270. data/spec/models/public_workflow_events_request_heights_inner_spec.rb +42 -0
  271. data/spec/models/public_workflow_events_request_spec.rb +54 -0
  272. data/spec/models/public_workflow_spec.rb +94 -0
  273. data/spec/models/public_workflow_translation_spec.rb +42 -0
  274. data/spec/models/publish_workspace_workflow200_response_spec.rb +48 -0
  275. data/spec/models/publish_workspace_workflow_request_spec.rb +36 -0
  276. data/spec/models/put_brand_kit_request_spec.rb +48 -0
  277. data/spec/models/remove_partner_workflow_preset200_response_spec.rb +48 -0
  278. data/spec/models/report_public_workflow_events200_response_spec.rb +48 -0
  279. data/spec/models/save_workspace_workflow200_response_spec.rb +48 -0
  280. data/spec/models/save_workspace_workflow_request_spec.rb +54 -0
  281. data/spec/models/set_partner_workflow_preset200_response_spec.rb +48 -0
  282. data/spec/models/widget_spec.rb +1 -7
  283. data/spec/models/workflow_composition_action_spec.rb +54 -0
  284. data/spec/models/workflow_composition_field_spec.rb +58 -0
  285. data/spec/models/workflow_composition_option_actions_spec.rb +52 -0
  286. data/spec/models/workflow_composition_option_inputs_spec.rb +58 -0
  287. data/spec/models/workflow_composition_option_spec.rb +72 -0
  288. data/spec/models/workflow_composition_options_spec.rb +54 -0
  289. data/spec/models/workflow_condition_case_spec.rb +58 -0
  290. data/spec/models/workflow_condition_test_spec.rb +52 -0
  291. data/spec/models/workflow_counter_spec.rb +42 -0
  292. data/spec/models/workflow_detail_all_of_last_edited_by_spec.rb +42 -0
  293. data/spec/models/workflow_detail_spec.rb +162 -0
  294. data/spec/models/workflow_edge_spec.rb +54 -0
  295. data/spec/models/workflow_field_reference_spec.rb +56 -0
  296. data/spec/models/workflow_graph_spec.rb +52 -0
  297. data/spec/models/workflow_issue_spec.rb +70 -0
  298. data/spec/models/workflow_list_spec.rb +54 -0
  299. data/spec/models/workflow_node_position_spec.rb +42 -0
  300. data/spec/models/workflow_node_spec.rb +76 -0
  301. data/spec/models/workflow_preset_choice_spec.rb +60 -0
  302. data/spec/models/workflow_preset_choices_spec.rb +36 -0
  303. data/spec/models/workflow_preset_removal_spec.rb +36 -0
  304. data/spec/models/workflow_preset_widget_spec.rb +42 -0
  305. data/spec/models/workflow_publish_result_spec.rb +48 -0
  306. data/spec/models/workflow_removed_spec.rb +36 -0
  307. data/spec/models/workflow_schedule_spec.rb +62 -0
  308. data/spec/models/workflow_spec.rb +132 -0
  309. data/spec/models/workflow_stats_spec.rb +78 -0
  310. data/spec/models/workflow_status_spec.rb +30 -0
  311. data/spec/models/workflow_trigger_spec.rb +70 -0
  312. data/spec/models/workflow_trigger_values_inner_spec.rb +46 -0
  313. data/spec/models/workflow_version_detail_spec.rb +78 -0
  314. data/spec/models/workflow_version_list_spec.rb +36 -0
  315. data/spec/models/workflow_version_published_by_spec.rb +42 -0
  316. data/spec/models/workflow_version_spec.rb +66 -0
  317. metadata +364 -12
@@ -0,0 +1,1997 @@
1
+ =begin
2
+ #Widgetic API Gateway
3
+
4
+ #API documentation for the Widgetic API Gateway
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module ApiSdkRb
16
+ class WorkflowsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Archive a Workflow
23
+ # Takes a workflow out of the default list and stops it serving: its embeds show only their first composition, as when paused. It is kept, with its versions and counts, until it is deleted. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can archive.
24
+ # @param workspace_id [String] The workspace: 'personal' for your own workspace, or the UUID of an organization. A call made for one of your managed users (`X-Managed-User-Id`) always uses 'personal': a managed user has no other workspace, and a call that names an organization is refused with 403.
25
+ # @param workflow_id [String] The workflow's id
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (`POST /managed-users`). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer's work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user's compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers `404` (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers `404` with `MANAGED_USER_NOT_FOUND`. An empty, repeated or malformed header is `400` with `MANAGED_USER_SCOPE_INVALID`; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with `403` and `MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE`: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer's browser holds, use an editor session. An `Idempotency-Key` is kept apart for each managed user.
28
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its `externalId`), when you do not keep Widgetic's. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer's work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user's compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers `404` (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers `404` with `MANAGED_USER_NOT_FOUND`. An empty, repeated or malformed header is `400` with `MANAGED_USER_SCOPE_INVALID`; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with `403` and `MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE`: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer's browser holds, use an editor session. An `Idempotency-Key` is kept apart for each managed user.
29
+ # @return [SaveWorkspaceWorkflow200Response]
30
+ def archive_workspace_workflow_0(workspace_id, workflow_id, opts = {})
31
+ data, _status_code, _headers = archive_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts)
32
+ data
33
+ end
34
+
35
+ # Archive a Workflow
36
+ # Takes a workflow out of the default list and stops it serving: its embeds show only their first composition, as when paused. It is kept, with its versions and counts, until it is deleted. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can archive.
37
+ # @param workspace_id [String] The workspace: 'personal' for your own workspace, or the UUID of an organization. A call made for one of your managed users (`X-Managed-User-Id`) always uses 'personal': a managed user has no other workspace, and a call that names an organization is refused with 403.
38
+ # @param workflow_id [String] The workflow's id
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (`POST /managed-users`). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer's work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user's compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers `404` (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers `404` with `MANAGED_USER_NOT_FOUND`. An empty, repeated or malformed header is `400` with `MANAGED_USER_SCOPE_INVALID`; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with `403` and `MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE`: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer's browser holds, use an editor session. An `Idempotency-Key` is kept apart for each managed user.
41
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its `externalId`), when you do not keep Widgetic's. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer's work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user's compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers `404` (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers `404` with `MANAGED_USER_NOT_FOUND`. An empty, repeated or malformed header is `400` with `MANAGED_USER_SCOPE_INVALID`; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with `403` and `MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE`: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer's browser holds, use an editor session. An `Idempotency-Key` is kept apart for each managed user.
42
+ # @return [Array<(SaveWorkspaceWorkflow200Response, Integer, Hash)>] SaveWorkspaceWorkflow200Response data, response status code and response headers
43
+ def archive_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.archive_workspace_workflow_0 ...'
46
+ end
47
+ # verify the required parameter 'workspace_id' is set
48
+ if @api_client.config.client_side_validation && workspace_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.archive_workspace_workflow_0"
50
+ end
51
+ # verify the required parameter 'workflow_id' is set
52
+ if @api_client.config.client_side_validation && workflow_id.nil?
53
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.archive_workspace_workflow_0"
54
+ end
55
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
56
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.archive_workspace_workflow_0, the character length must be smaller than or equal to 255.'
57
+ end
58
+
59
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
60
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.archive_workspace_workflow_0, the character length must be great than or equal to 1.'
61
+ end
62
+
63
+ # resource path
64
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}/archive'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
65
+
66
+ # query parameters
67
+ query_params = opts[:query_params] || {}
68
+
69
+ # header parameters
70
+ header_params = opts[:header_params] || {}
71
+ # HTTP header 'Accept' (if needed)
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
73
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
74
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
75
+
76
+ # form parameters
77
+ form_params = opts[:form_params] || {}
78
+
79
+ # http body (model)
80
+ post_body = opts[:debug_body]
81
+
82
+ # return_type
83
+ return_type = opts[:debug_return_type] || 'SaveWorkspaceWorkflow200Response'
84
+
85
+ # auth_names
86
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
87
+
88
+ new_options = opts.merge(
89
+ :operation => :"WorkflowsApi.archive_workspace_workflow_0",
90
+ :header_params => header_params,
91
+ :query_params => query_params,
92
+ :form_params => form_params,
93
+ :body => post_body,
94
+ :auth_names => auth_names,
95
+ :return_type => return_type
96
+ )
97
+
98
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
99
+ if @api_client.config.debugging
100
+ @api_client.config.logger.debug "API called: WorkflowsApi#archive_workspace_workflow_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
101
+ end
102
+ return data, status_code, headers
103
+ end
104
+
105
+ # Create a Workflow
106
+ # Makes a draft workflow. Give it a composition and the workflow is born with one block, which starts it; without one it starts empty. A workspace holds up to 500 workflows. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can create one.
107
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
108
+ # @param idempotency_key [String] Required: a call without it is refused with &#x60;400&#x60;. A key of your own that names this one request; a UUID is ideal. It is 8 to 50 characters of letters, digits, &#x60;-&#x60; and &#x60;_&#x60;. Send the same key again when you retry (after a timeout, a dropped connection or a &#x60;5xx&#x60;) and the call is carried out once: the retry gets the first answer back, marked &#x60;X-Idempotency-Cached: true&#x60;. The same key with a different body is refused with &#x60;422&#x60;, and a retry that arrives while the first call is still running with &#x60;409&#x60; (see &#x60;Retry-After&#x60;).
109
+ # @param create_workspace_workflow_request [CreateWorkspaceWorkflowRequest]
110
+ # @param [Hash] opts the optional parameters
111
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
112
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
113
+ # @return [CreateWorkspaceWorkflowFromPreset201Response]
114
+ def create_workspace_workflow_0(workspace_id, idempotency_key, create_workspace_workflow_request, opts = {})
115
+ data, _status_code, _headers = create_workspace_workflow_0_with_http_info(workspace_id, idempotency_key, create_workspace_workflow_request, opts)
116
+ data
117
+ end
118
+
119
+ # Create a Workflow
120
+ # Makes a draft workflow. Give it a composition and the workflow is born with one block, which starts it; without one it starts empty. A workspace holds up to 500 workflows. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can create one.
121
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
122
+ # @param idempotency_key [String] Required: a call without it is refused with &#x60;400&#x60;. A key of your own that names this one request; a UUID is ideal. It is 8 to 50 characters of letters, digits, &#x60;-&#x60; and &#x60;_&#x60;. Send the same key again when you retry (after a timeout, a dropped connection or a &#x60;5xx&#x60;) and the call is carried out once: the retry gets the first answer back, marked &#x60;X-Idempotency-Cached: true&#x60;. The same key with a different body is refused with &#x60;422&#x60;, and a retry that arrives while the first call is still running with &#x60;409&#x60; (see &#x60;Retry-After&#x60;).
123
+ # @param create_workspace_workflow_request [CreateWorkspaceWorkflowRequest]
124
+ # @param [Hash] opts the optional parameters
125
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
126
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
127
+ # @return [Array<(CreateWorkspaceWorkflowFromPreset201Response, Integer, Hash)>] CreateWorkspaceWorkflowFromPreset201Response data, response status code and response headers
128
+ def create_workspace_workflow_0_with_http_info(workspace_id, idempotency_key, create_workspace_workflow_request, opts = {})
129
+ if @api_client.config.debugging
130
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.create_workspace_workflow_0 ...'
131
+ end
132
+ # verify the required parameter 'workspace_id' is set
133
+ if @api_client.config.client_side_validation && workspace_id.nil?
134
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.create_workspace_workflow_0"
135
+ end
136
+ # verify the required parameter 'idempotency_key' is set
137
+ if @api_client.config.client_side_validation && idempotency_key.nil?
138
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling WorkflowsApi.create_workspace_workflow_0"
139
+ end
140
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length > 50
141
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling WorkflowsApi.create_workspace_workflow_0, the character length must be smaller than or equal to 50.'
142
+ end
143
+
144
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length < 8
145
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling WorkflowsApi.create_workspace_workflow_0, the character length must be great than or equal to 8.'
146
+ end
147
+
148
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]{8,50}$/)
149
+ if @api_client.config.client_side_validation && idempotency_key !~ pattern
150
+ fail ArgumentError, "invalid value for 'idempotency_key' when calling WorkflowsApi.create_workspace_workflow_0, must conform to the pattern #{pattern}."
151
+ end
152
+
153
+ # verify the required parameter 'create_workspace_workflow_request' is set
154
+ if @api_client.config.client_side_validation && create_workspace_workflow_request.nil?
155
+ fail ArgumentError, "Missing the required parameter 'create_workspace_workflow_request' when calling WorkflowsApi.create_workspace_workflow_0"
156
+ end
157
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
158
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.create_workspace_workflow_0, the character length must be smaller than or equal to 255.'
159
+ end
160
+
161
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
162
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.create_workspace_workflow_0, the character length must be great than or equal to 1.'
163
+ end
164
+
165
+ # resource path
166
+ local_var_path = '/workspaces/{workspaceId}/workflows'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))
167
+
168
+ # query parameters
169
+ query_params = opts[:query_params] || {}
170
+
171
+ # header parameters
172
+ header_params = opts[:header_params] || {}
173
+ # HTTP header 'Accept' (if needed)
174
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
175
+ # HTTP header 'Content-Type'
176
+ content_type = @api_client.select_header_content_type(['application/json'])
177
+ if !content_type.nil?
178
+ header_params['Content-Type'] = content_type
179
+ end
180
+ header_params[:'Idempotency-Key'] = idempotency_key
181
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
182
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
183
+
184
+ # form parameters
185
+ form_params = opts[:form_params] || {}
186
+
187
+ # http body (model)
188
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_workspace_workflow_request)
189
+
190
+ # return_type
191
+ return_type = opts[:debug_return_type] || 'CreateWorkspaceWorkflowFromPreset201Response'
192
+
193
+ # auth_names
194
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
195
+
196
+ new_options = opts.merge(
197
+ :operation => :"WorkflowsApi.create_workspace_workflow_0",
198
+ :header_params => header_params,
199
+ :query_params => query_params,
200
+ :form_params => form_params,
201
+ :body => post_body,
202
+ :auth_names => auth_names,
203
+ :return_type => return_type
204
+ )
205
+
206
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
207
+ if @api_client.config.debugging
208
+ @api_client.config.logger.debug "API called: WorkflowsApi#create_workspace_workflow_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
209
+ end
210
+ return data, status_code, headers
211
+ end
212
+
213
+ # Start a Workflow from a starting point
214
+ # Makes your own copy of a starting point (`listWorkspaceWorkflowPresets`): a copy of every widget it chains (an ordinary private widget that serves the starting point's published code), a composition of your own on each copy (a draft, with the content, design, embed settings and tables of the original), and a draft workflow wired like the starting point's live version. The workflow is named as you ask, or after the starting point. Nothing you do to the copy reaches the starting point, and nothing its offerer changes afterwards reaches your copy. The workflow stays a draft: publish it when it is ready. A start takes a few seconds, because each widget is copied. Send an `Idempotency-Key` so that asking again after a timeout makes one copy. When a start fails (503 with `details.reason` `preset_copy_failed`) the compositions it made are removed again, so asking again is safe; the widget copies it made stay in the workspace as ordinary widgets. The workspace's limit of workflows is checked before anything is copied. A starting point that is not offered to you, or that can no longer be started, is 404. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can start one.
215
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
216
+ # @param idempotency_key [String] Required: a call without it is refused with &#x60;400&#x60;. A key of your own that names this one request; a UUID is ideal. It is 8 to 50 characters of letters, digits, &#x60;-&#x60; and &#x60;_&#x60;. Send the same key again when you retry (after a timeout, a dropped connection or a &#x60;5xx&#x60;) and the call is carried out once: the retry gets the first answer back, marked &#x60;X-Idempotency-Cached: true&#x60;. The same key with a different body is refused with &#x60;422&#x60;, and a retry that arrives while the first call is still running with &#x60;409&#x60; (see &#x60;Retry-After&#x60;).
217
+ # @param create_workspace_workflow_from_preset_request [CreateWorkspaceWorkflowFromPresetRequest]
218
+ # @param [Hash] opts the optional parameters
219
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
220
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
221
+ # @return [CreateWorkspaceWorkflowFromPreset201Response]
222
+ def create_workspace_workflow_from_preset_0(workspace_id, idempotency_key, create_workspace_workflow_from_preset_request, opts = {})
223
+ data, _status_code, _headers = create_workspace_workflow_from_preset_0_with_http_info(workspace_id, idempotency_key, create_workspace_workflow_from_preset_request, opts)
224
+ data
225
+ end
226
+
227
+ # Start a Workflow from a starting point
228
+ # Makes your own copy of a starting point (&#x60;listWorkspaceWorkflowPresets&#x60;): a copy of every widget it chains (an ordinary private widget that serves the starting point&#39;s published code), a composition of your own on each copy (a draft, with the content, design, embed settings and tables of the original), and a draft workflow wired like the starting point&#39;s live version. The workflow is named as you ask, or after the starting point. Nothing you do to the copy reaches the starting point, and nothing its offerer changes afterwards reaches your copy. The workflow stays a draft: publish it when it is ready. A start takes a few seconds, because each widget is copied. Send an &#x60;Idempotency-Key&#x60; so that asking again after a timeout makes one copy. When a start fails (503 with &#x60;details.reason&#x60; &#x60;preset_copy_failed&#x60;) the compositions it made are removed again, so asking again is safe; the widget copies it made stay in the workspace as ordinary widgets. The workspace&#39;s limit of workflows is checked before anything is copied. A starting point that is not offered to you, or that can no longer be started, is 404. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can start one.
229
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
230
+ # @param idempotency_key [String] Required: a call without it is refused with &#x60;400&#x60;. A key of your own that names this one request; a UUID is ideal. It is 8 to 50 characters of letters, digits, &#x60;-&#x60; and &#x60;_&#x60;. Send the same key again when you retry (after a timeout, a dropped connection or a &#x60;5xx&#x60;) and the call is carried out once: the retry gets the first answer back, marked &#x60;X-Idempotency-Cached: true&#x60;. The same key with a different body is refused with &#x60;422&#x60;, and a retry that arrives while the first call is still running with &#x60;409&#x60; (see &#x60;Retry-After&#x60;).
231
+ # @param create_workspace_workflow_from_preset_request [CreateWorkspaceWorkflowFromPresetRequest]
232
+ # @param [Hash] opts the optional parameters
233
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
234
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
235
+ # @return [Array<(CreateWorkspaceWorkflowFromPreset201Response, Integer, Hash)>] CreateWorkspaceWorkflowFromPreset201Response data, response status code and response headers
236
+ def create_workspace_workflow_from_preset_0_with_http_info(workspace_id, idempotency_key, create_workspace_workflow_from_preset_request, opts = {})
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.create_workspace_workflow_from_preset_0 ...'
239
+ end
240
+ # verify the required parameter 'workspace_id' is set
241
+ if @api_client.config.client_side_validation && workspace_id.nil?
242
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.create_workspace_workflow_from_preset_0"
243
+ end
244
+ # verify the required parameter 'idempotency_key' is set
245
+ if @api_client.config.client_side_validation && idempotency_key.nil?
246
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling WorkflowsApi.create_workspace_workflow_from_preset_0"
247
+ end
248
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length > 50
249
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling WorkflowsApi.create_workspace_workflow_from_preset_0, the character length must be smaller than or equal to 50.'
250
+ end
251
+
252
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length < 8
253
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling WorkflowsApi.create_workspace_workflow_from_preset_0, the character length must be great than or equal to 8.'
254
+ end
255
+
256
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]{8,50}$/)
257
+ if @api_client.config.client_side_validation && idempotency_key !~ pattern
258
+ fail ArgumentError, "invalid value for 'idempotency_key' when calling WorkflowsApi.create_workspace_workflow_from_preset_0, must conform to the pattern #{pattern}."
259
+ end
260
+
261
+ # verify the required parameter 'create_workspace_workflow_from_preset_request' is set
262
+ if @api_client.config.client_side_validation && create_workspace_workflow_from_preset_request.nil?
263
+ fail ArgumentError, "Missing the required parameter 'create_workspace_workflow_from_preset_request' when calling WorkflowsApi.create_workspace_workflow_from_preset_0"
264
+ end
265
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
266
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.create_workspace_workflow_from_preset_0, the character length must be smaller than or equal to 255.'
267
+ end
268
+
269
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
270
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.create_workspace_workflow_from_preset_0, the character length must be great than or equal to 1.'
271
+ end
272
+
273
+ # resource path
274
+ local_var_path = '/workspaces/{workspaceId}/workflows/from-preset'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))
275
+
276
+ # query parameters
277
+ query_params = opts[:query_params] || {}
278
+
279
+ # header parameters
280
+ header_params = opts[:header_params] || {}
281
+ # HTTP header 'Accept' (if needed)
282
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
283
+ # HTTP header 'Content-Type'
284
+ content_type = @api_client.select_header_content_type(['application/json'])
285
+ if !content_type.nil?
286
+ header_params['Content-Type'] = content_type
287
+ end
288
+ header_params[:'Idempotency-Key'] = idempotency_key
289
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
290
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
291
+
292
+ # form parameters
293
+ form_params = opts[:form_params] || {}
294
+
295
+ # http body (model)
296
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_workspace_workflow_from_preset_request)
297
+
298
+ # return_type
299
+ return_type = opts[:debug_return_type] || 'CreateWorkspaceWorkflowFromPreset201Response'
300
+
301
+ # auth_names
302
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
303
+
304
+ new_options = opts.merge(
305
+ :operation => :"WorkflowsApi.create_workspace_workflow_from_preset_0",
306
+ :header_params => header_params,
307
+ :query_params => query_params,
308
+ :form_params => form_params,
309
+ :body => post_body,
310
+ :auth_names => auth_names,
311
+ :return_type => return_type
312
+ )
313
+
314
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
315
+ if @api_client.config.debugging
316
+ @api_client.config.logger.debug "API called: WorkflowsApi#create_workspace_workflow_from_preset_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
317
+ end
318
+ return data, status_code, headers
319
+ end
320
+
321
+ # Delete a Workflow
322
+ # Deletes a workflow, in whatever state it is in (draft, live, paused or archived), with all its versions and counts. It cannot be undone: archive the workflow instead to keep it. The compositions it chained are not touched, and a page whose embed still names the workflow shows the embed's first composition, as for a paused one. Asking for a workflow that is already gone is \"not found\". For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can delete.
323
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
324
+ # @param workflow_id [String] The workflow&#39;s id
325
+ # @param [Hash] opts the optional parameters
326
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
327
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
328
+ # @return [DeleteWorkspaceWorkflow200Response]
329
+ def delete_workspace_workflow_0(workspace_id, workflow_id, opts = {})
330
+ data, _status_code, _headers = delete_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts)
331
+ data
332
+ end
333
+
334
+ # Delete a Workflow
335
+ # Deletes a workflow, in whatever state it is in (draft, live, paused or archived), with all its versions and counts. It cannot be undone: archive the workflow instead to keep it. The compositions it chained are not touched, and a page whose embed still names the workflow shows the embed&#39;s first composition, as for a paused one. Asking for a workflow that is already gone is \&quot;not found\&quot;. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can delete.
336
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
337
+ # @param workflow_id [String] The workflow&#39;s id
338
+ # @param [Hash] opts the optional parameters
339
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
340
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
341
+ # @return [Array<(DeleteWorkspaceWorkflow200Response, Integer, Hash)>] DeleteWorkspaceWorkflow200Response data, response status code and response headers
342
+ def delete_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts = {})
343
+ if @api_client.config.debugging
344
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.delete_workspace_workflow_0 ...'
345
+ end
346
+ # verify the required parameter 'workspace_id' is set
347
+ if @api_client.config.client_side_validation && workspace_id.nil?
348
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.delete_workspace_workflow_0"
349
+ end
350
+ # verify the required parameter 'workflow_id' is set
351
+ if @api_client.config.client_side_validation && workflow_id.nil?
352
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.delete_workspace_workflow_0"
353
+ end
354
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
355
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.delete_workspace_workflow_0, the character length must be smaller than or equal to 255.'
356
+ end
357
+
358
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
359
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.delete_workspace_workflow_0, the character length must be great than or equal to 1.'
360
+ end
361
+
362
+ # resource path
363
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
364
+
365
+ # query parameters
366
+ query_params = opts[:query_params] || {}
367
+
368
+ # header parameters
369
+ header_params = opts[:header_params] || {}
370
+ # HTTP header 'Accept' (if needed)
371
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
372
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
373
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
374
+
375
+ # form parameters
376
+ form_params = opts[:form_params] || {}
377
+
378
+ # http body (model)
379
+ post_body = opts[:debug_body]
380
+
381
+ # return_type
382
+ return_type = opts[:debug_return_type] || 'DeleteWorkspaceWorkflow200Response'
383
+
384
+ # auth_names
385
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
386
+
387
+ new_options = opts.merge(
388
+ :operation => :"WorkflowsApi.delete_workspace_workflow_0",
389
+ :header_params => header_params,
390
+ :query_params => query_params,
391
+ :form_params => form_params,
392
+ :body => post_body,
393
+ :auth_names => auth_names,
394
+ :return_type => return_type
395
+ )
396
+
397
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
398
+ if @api_client.config.debugging
399
+ @api_client.config.logger.debug "API called: WorkflowsApi#delete_workspace_workflow_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
400
+ end
401
+ return data, status_code, headers
402
+ end
403
+
404
+ # Discard the Unpublished Changes of a Workflow
405
+ # Puts the draft back to the live version (its graph and its time zone). Only for a workflow that has been published; one that never was has no live version to go back to. Names the `revision` the editor read. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can discard.
406
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
407
+ # @param workflow_id [String] The workflow&#39;s id
408
+ # @param publish_workspace_workflow_request [PublishWorkspaceWorkflowRequest]
409
+ # @param [Hash] opts the optional parameters
410
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
411
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
412
+ # @return [CreateWorkspaceWorkflowFromPreset201Response]
413
+ def discard_workspace_workflow_changes_0(workspace_id, workflow_id, publish_workspace_workflow_request, opts = {})
414
+ data, _status_code, _headers = discard_workspace_workflow_changes_0_with_http_info(workspace_id, workflow_id, publish_workspace_workflow_request, opts)
415
+ data
416
+ end
417
+
418
+ # Discard the Unpublished Changes of a Workflow
419
+ # Puts the draft back to the live version (its graph and its time zone). Only for a workflow that has been published; one that never was has no live version to go back to. Names the &#x60;revision&#x60; the editor read. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can discard.
420
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
421
+ # @param workflow_id [String] The workflow&#39;s id
422
+ # @param publish_workspace_workflow_request [PublishWorkspaceWorkflowRequest]
423
+ # @param [Hash] opts the optional parameters
424
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
425
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
426
+ # @return [Array<(CreateWorkspaceWorkflowFromPreset201Response, Integer, Hash)>] CreateWorkspaceWorkflowFromPreset201Response data, response status code and response headers
427
+ def discard_workspace_workflow_changes_0_with_http_info(workspace_id, workflow_id, publish_workspace_workflow_request, opts = {})
428
+ if @api_client.config.debugging
429
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.discard_workspace_workflow_changes_0 ...'
430
+ end
431
+ # verify the required parameter 'workspace_id' is set
432
+ if @api_client.config.client_side_validation && workspace_id.nil?
433
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.discard_workspace_workflow_changes_0"
434
+ end
435
+ # verify the required parameter 'workflow_id' is set
436
+ if @api_client.config.client_side_validation && workflow_id.nil?
437
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.discard_workspace_workflow_changes_0"
438
+ end
439
+ # verify the required parameter 'publish_workspace_workflow_request' is set
440
+ if @api_client.config.client_side_validation && publish_workspace_workflow_request.nil?
441
+ fail ArgumentError, "Missing the required parameter 'publish_workspace_workflow_request' when calling WorkflowsApi.discard_workspace_workflow_changes_0"
442
+ end
443
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
444
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.discard_workspace_workflow_changes_0, the character length must be smaller than or equal to 255.'
445
+ end
446
+
447
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
448
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.discard_workspace_workflow_changes_0, the character length must be great than or equal to 1.'
449
+ end
450
+
451
+ # resource path
452
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}/discard'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
453
+
454
+ # query parameters
455
+ query_params = opts[:query_params] || {}
456
+
457
+ # header parameters
458
+ header_params = opts[:header_params] || {}
459
+ # HTTP header 'Accept' (if needed)
460
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
461
+ # HTTP header 'Content-Type'
462
+ content_type = @api_client.select_header_content_type(['application/json'])
463
+ if !content_type.nil?
464
+ header_params['Content-Type'] = content_type
465
+ end
466
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
467
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
468
+
469
+ # form parameters
470
+ form_params = opts[:form_params] || {}
471
+
472
+ # http body (model)
473
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(publish_workspace_workflow_request)
474
+
475
+ # return_type
476
+ return_type = opts[:debug_return_type] || 'CreateWorkspaceWorkflowFromPreset201Response'
477
+
478
+ # auth_names
479
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
480
+
481
+ new_options = opts.merge(
482
+ :operation => :"WorkflowsApi.discard_workspace_workflow_changes_0",
483
+ :header_params => header_params,
484
+ :query_params => query_params,
485
+ :form_params => form_params,
486
+ :body => post_body,
487
+ :auth_names => auth_names,
488
+ :return_type => return_type
489
+ )
490
+
491
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
492
+ if @api_client.config.debugging
493
+ @api_client.config.logger.debug "API called: WorkflowsApi#discard_workspace_workflow_changes_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
494
+ end
495
+ return data, status_code, headers
496
+ end
497
+
498
+ # Duplicate a Workflow
499
+ # Makes a draft copy of a workflow (its draft graph, not its versions or counts), named \"<name> (copy)\". For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can duplicate.
500
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
501
+ # @param workflow_id [String] The workflow&#39;s id
502
+ # @param idempotency_key [String] Required: a call without it is refused with &#x60;400&#x60;. A key of your own that names this one request; a UUID is ideal. It is 8 to 50 characters of letters, digits, &#x60;-&#x60; and &#x60;_&#x60;. Send the same key again when you retry (after a timeout, a dropped connection or a &#x60;5xx&#x60;) and the call is carried out once: the retry gets the first answer back, marked &#x60;X-Idempotency-Cached: true&#x60;. The same key with a different body is refused with &#x60;422&#x60;, and a retry that arrives while the first call is still running with &#x60;409&#x60; (see &#x60;Retry-After&#x60;).
503
+ # @param [Hash] opts the optional parameters
504
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
505
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
506
+ # @return [CreateWorkspaceWorkflowFromPreset201Response]
507
+ def duplicate_workspace_workflow_0(workspace_id, workflow_id, idempotency_key, opts = {})
508
+ data, _status_code, _headers = duplicate_workspace_workflow_0_with_http_info(workspace_id, workflow_id, idempotency_key, opts)
509
+ data
510
+ end
511
+
512
+ # Duplicate a Workflow
513
+ # Makes a draft copy of a workflow (its draft graph, not its versions or counts), named \&quot;&lt;name&gt; (copy)\&quot;. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can duplicate.
514
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
515
+ # @param workflow_id [String] The workflow&#39;s id
516
+ # @param idempotency_key [String] Required: a call without it is refused with &#x60;400&#x60;. A key of your own that names this one request; a UUID is ideal. It is 8 to 50 characters of letters, digits, &#x60;-&#x60; and &#x60;_&#x60;. Send the same key again when you retry (after a timeout, a dropped connection or a &#x60;5xx&#x60;) and the call is carried out once: the retry gets the first answer back, marked &#x60;X-Idempotency-Cached: true&#x60;. The same key with a different body is refused with &#x60;422&#x60;, and a retry that arrives while the first call is still running with &#x60;409&#x60; (see &#x60;Retry-After&#x60;).
517
+ # @param [Hash] opts the optional parameters
518
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
519
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
520
+ # @return [Array<(CreateWorkspaceWorkflowFromPreset201Response, Integer, Hash)>] CreateWorkspaceWorkflowFromPreset201Response data, response status code and response headers
521
+ def duplicate_workspace_workflow_0_with_http_info(workspace_id, workflow_id, idempotency_key, opts = {})
522
+ if @api_client.config.debugging
523
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.duplicate_workspace_workflow_0 ...'
524
+ end
525
+ # verify the required parameter 'workspace_id' is set
526
+ if @api_client.config.client_side_validation && workspace_id.nil?
527
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.duplicate_workspace_workflow_0"
528
+ end
529
+ # verify the required parameter 'workflow_id' is set
530
+ if @api_client.config.client_side_validation && workflow_id.nil?
531
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.duplicate_workspace_workflow_0"
532
+ end
533
+ # verify the required parameter 'idempotency_key' is set
534
+ if @api_client.config.client_side_validation && idempotency_key.nil?
535
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling WorkflowsApi.duplicate_workspace_workflow_0"
536
+ end
537
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length > 50
538
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling WorkflowsApi.duplicate_workspace_workflow_0, the character length must be smaller than or equal to 50.'
539
+ end
540
+
541
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length < 8
542
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling WorkflowsApi.duplicate_workspace_workflow_0, the character length must be great than or equal to 8.'
543
+ end
544
+
545
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]{8,50}$/)
546
+ if @api_client.config.client_side_validation && idempotency_key !~ pattern
547
+ fail ArgumentError, "invalid value for 'idempotency_key' when calling WorkflowsApi.duplicate_workspace_workflow_0, must conform to the pattern #{pattern}."
548
+ end
549
+
550
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
551
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.duplicate_workspace_workflow_0, the character length must be smaller than or equal to 255.'
552
+ end
553
+
554
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
555
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.duplicate_workspace_workflow_0, the character length must be great than or equal to 1.'
556
+ end
557
+
558
+ # resource path
559
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}/duplicate'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
560
+
561
+ # query parameters
562
+ query_params = opts[:query_params] || {}
563
+
564
+ # header parameters
565
+ header_params = opts[:header_params] || {}
566
+ # HTTP header 'Accept' (if needed)
567
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
568
+ header_params[:'Idempotency-Key'] = idempotency_key
569
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
570
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
571
+
572
+ # form parameters
573
+ form_params = opts[:form_params] || {}
574
+
575
+ # http body (model)
576
+ post_body = opts[:debug_body]
577
+
578
+ # return_type
579
+ return_type = opts[:debug_return_type] || 'CreateWorkspaceWorkflowFromPreset201Response'
580
+
581
+ # auth_names
582
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
583
+
584
+ new_options = opts.merge(
585
+ :operation => :"WorkflowsApi.duplicate_workspace_workflow_0",
586
+ :header_params => header_params,
587
+ :query_params => query_params,
588
+ :form_params => form_params,
589
+ :body => post_body,
590
+ :auth_names => auth_names,
591
+ :return_type => return_type
592
+ )
593
+
594
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
595
+ if @api_client.config.debugging
596
+ @api_client.config.logger.debug "API called: WorkflowsApi#duplicate_workspace_workflow_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
597
+ end
598
+ return data, status_code, headers
599
+ end
600
+
601
+ # Get a Workflow
602
+ # Reads a workflow with its draft graph and the version that is live. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read it.
603
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
604
+ # @param workflow_id [String] The workflow&#39;s id
605
+ # @param [Hash] opts the optional parameters
606
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
607
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
608
+ # @return [CreateWorkspaceWorkflowFromPreset201Response]
609
+ def get_workspace_workflow_0(workspace_id, workflow_id, opts = {})
610
+ data, _status_code, _headers = get_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts)
611
+ data
612
+ end
613
+
614
+ # Get a Workflow
615
+ # Reads a workflow with its draft graph and the version that is live. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read it.
616
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
617
+ # @param workflow_id [String] The workflow&#39;s id
618
+ # @param [Hash] opts the optional parameters
619
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
620
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
621
+ # @return [Array<(CreateWorkspaceWorkflowFromPreset201Response, Integer, Hash)>] CreateWorkspaceWorkflowFromPreset201Response data, response status code and response headers
622
+ def get_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts = {})
623
+ if @api_client.config.debugging
624
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.get_workspace_workflow_0 ...'
625
+ end
626
+ # verify the required parameter 'workspace_id' is set
627
+ if @api_client.config.client_side_validation && workspace_id.nil?
628
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.get_workspace_workflow_0"
629
+ end
630
+ # verify the required parameter 'workflow_id' is set
631
+ if @api_client.config.client_side_validation && workflow_id.nil?
632
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.get_workspace_workflow_0"
633
+ end
634
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
635
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.get_workspace_workflow_0, the character length must be smaller than or equal to 255.'
636
+ end
637
+
638
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
639
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.get_workspace_workflow_0, the character length must be great than or equal to 1.'
640
+ end
641
+
642
+ # resource path
643
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
644
+
645
+ # query parameters
646
+ query_params = opts[:query_params] || {}
647
+
648
+ # header parameters
649
+ header_params = opts[:header_params] || {}
650
+ # HTTP header 'Accept' (if needed)
651
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
652
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
653
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
654
+
655
+ # form parameters
656
+ form_params = opts[:form_params] || {}
657
+
658
+ # http body (model)
659
+ post_body = opts[:debug_body]
660
+
661
+ # return_type
662
+ return_type = opts[:debug_return_type] || 'CreateWorkspaceWorkflowFromPreset201Response'
663
+
664
+ # auth_names
665
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
666
+
667
+ new_options = opts.merge(
668
+ :operation => :"WorkflowsApi.get_workspace_workflow_0",
669
+ :header_params => header_params,
670
+ :query_params => query_params,
671
+ :form_params => form_params,
672
+ :body => post_body,
673
+ :auth_names => auth_names,
674
+ :return_type => return_type
675
+ )
676
+
677
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
678
+ if @api_client.config.debugging
679
+ @api_client.config.logger.debug "API called: WorkflowsApi#get_workspace_workflow_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
680
+ end
681
+ return data, status_code, headers
682
+ end
683
+
684
+ # Get what Visitors Did in a Workflow
685
+ # Counts per block and per connection over a range of UTC days (the last 30 days when not given, up to 366), for one version or for all of them. Only counts: how many visitors reached a block, took a connection, or could not be moved on. No visitor and no value a visitor typed is ever stored. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
686
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
687
+ # @param workflow_id [String] The workflow&#39;s id
688
+ # @param [Hash] opts the optional parameters
689
+ # @option opts [String] :version_id Count one version only
690
+ # @option opts [String] :from First UTC day (YYYY-MM-DD)
691
+ # @option opts [String] :to Last UTC day (YYYY-MM-DD)
692
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
693
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
694
+ # @return [GetWorkspaceWorkflowStats200Response]
695
+ def get_workspace_workflow_stats_0(workspace_id, workflow_id, opts = {})
696
+ data, _status_code, _headers = get_workspace_workflow_stats_0_with_http_info(workspace_id, workflow_id, opts)
697
+ data
698
+ end
699
+
700
+ # Get what Visitors Did in a Workflow
701
+ # Counts per block and per connection over a range of UTC days (the last 30 days when not given, up to 366), for one version or for all of them. Only counts: how many visitors reached a block, took a connection, or could not be moved on. No visitor and no value a visitor typed is ever stored. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
702
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
703
+ # @param workflow_id [String] The workflow&#39;s id
704
+ # @param [Hash] opts the optional parameters
705
+ # @option opts [String] :version_id Count one version only
706
+ # @option opts [String] :from First UTC day (YYYY-MM-DD)
707
+ # @option opts [String] :to Last UTC day (YYYY-MM-DD)
708
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
709
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
710
+ # @return [Array<(GetWorkspaceWorkflowStats200Response, Integer, Hash)>] GetWorkspaceWorkflowStats200Response data, response status code and response headers
711
+ def get_workspace_workflow_stats_0_with_http_info(workspace_id, workflow_id, opts = {})
712
+ if @api_client.config.debugging
713
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.get_workspace_workflow_stats_0 ...'
714
+ end
715
+ # verify the required parameter 'workspace_id' is set
716
+ if @api_client.config.client_side_validation && workspace_id.nil?
717
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.get_workspace_workflow_stats_0"
718
+ end
719
+ # verify the required parameter 'workflow_id' is set
720
+ if @api_client.config.client_side_validation && workflow_id.nil?
721
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.get_workspace_workflow_stats_0"
722
+ end
723
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
724
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.get_workspace_workflow_stats_0, the character length must be smaller than or equal to 255.'
725
+ end
726
+
727
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
728
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.get_workspace_workflow_stats_0, the character length must be great than or equal to 1.'
729
+ end
730
+
731
+ # resource path
732
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}/stats'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
733
+
734
+ # query parameters
735
+ query_params = opts[:query_params] || {}
736
+ query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil?
737
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
738
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
739
+
740
+ # header parameters
741
+ header_params = opts[:header_params] || {}
742
+ # HTTP header 'Accept' (if needed)
743
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
744
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
745
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
746
+
747
+ # form parameters
748
+ form_params = opts[:form_params] || {}
749
+
750
+ # http body (model)
751
+ post_body = opts[:debug_body]
752
+
753
+ # return_type
754
+ return_type = opts[:debug_return_type] || 'GetWorkspaceWorkflowStats200Response'
755
+
756
+ # auth_names
757
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
758
+
759
+ new_options = opts.merge(
760
+ :operation => :"WorkflowsApi.get_workspace_workflow_stats_0",
761
+ :header_params => header_params,
762
+ :query_params => query_params,
763
+ :form_params => form_params,
764
+ :body => post_body,
765
+ :auth_names => auth_names,
766
+ :return_type => return_type
767
+ )
768
+
769
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
770
+ if @api_client.config.debugging
771
+ @api_client.config.logger.debug "API called: WorkflowsApi#get_workspace_workflow_stats_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
772
+ end
773
+ return data, status_code, headers
774
+ end
775
+
776
+ # Get a Published Version of a Workflow
777
+ # One published version with its graph, for the read-only preview and for the Runs view. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
778
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
779
+ # @param workflow_id [String] The workflow&#39;s id
780
+ # @param version_id [String] The id of a published version of the workflow
781
+ # @param [Hash] opts the optional parameters
782
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
783
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
784
+ # @return [GetWorkspaceWorkflowVersion200Response]
785
+ def get_workspace_workflow_version_0(workspace_id, workflow_id, version_id, opts = {})
786
+ data, _status_code, _headers = get_workspace_workflow_version_0_with_http_info(workspace_id, workflow_id, version_id, opts)
787
+ data
788
+ end
789
+
790
+ # Get a Published Version of a Workflow
791
+ # One published version with its graph, for the read-only preview and for the Runs view. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
792
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
793
+ # @param workflow_id [String] The workflow&#39;s id
794
+ # @param version_id [String] The id of a published version of the workflow
795
+ # @param [Hash] opts the optional parameters
796
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
797
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
798
+ # @return [Array<(GetWorkspaceWorkflowVersion200Response, Integer, Hash)>] GetWorkspaceWorkflowVersion200Response data, response status code and response headers
799
+ def get_workspace_workflow_version_0_with_http_info(workspace_id, workflow_id, version_id, opts = {})
800
+ if @api_client.config.debugging
801
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.get_workspace_workflow_version_0 ...'
802
+ end
803
+ # verify the required parameter 'workspace_id' is set
804
+ if @api_client.config.client_side_validation && workspace_id.nil?
805
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.get_workspace_workflow_version_0"
806
+ end
807
+ # verify the required parameter 'workflow_id' is set
808
+ if @api_client.config.client_side_validation && workflow_id.nil?
809
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.get_workspace_workflow_version_0"
810
+ end
811
+ # verify the required parameter 'version_id' is set
812
+ if @api_client.config.client_side_validation && version_id.nil?
813
+ fail ArgumentError, "Missing the required parameter 'version_id' when calling WorkflowsApi.get_workspace_workflow_version_0"
814
+ end
815
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
816
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.get_workspace_workflow_version_0, the character length must be smaller than or equal to 255.'
817
+ end
818
+
819
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
820
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.get_workspace_workflow_version_0, the character length must be great than or equal to 1.'
821
+ end
822
+
823
+ # resource path
824
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}/versions/{versionId}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s)).sub('{' + 'versionId' + '}', CGI.escape(version_id.to_s))
825
+
826
+ # query parameters
827
+ query_params = opts[:query_params] || {}
828
+
829
+ # header parameters
830
+ header_params = opts[:header_params] || {}
831
+ # HTTP header 'Accept' (if needed)
832
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
833
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
834
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
835
+
836
+ # form parameters
837
+ form_params = opts[:form_params] || {}
838
+
839
+ # http body (model)
840
+ post_body = opts[:debug_body]
841
+
842
+ # return_type
843
+ return_type = opts[:debug_return_type] || 'GetWorkspaceWorkflowVersion200Response'
844
+
845
+ # auth_names
846
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
847
+
848
+ new_options = opts.merge(
849
+ :operation => :"WorkflowsApi.get_workspace_workflow_version_0",
850
+ :header_params => header_params,
851
+ :query_params => query_params,
852
+ :form_params => form_params,
853
+ :body => post_body,
854
+ :auth_names => auth_names,
855
+ :return_type => return_type
856
+ )
857
+
858
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
859
+ if @api_client.config.debugging
860
+ @api_client.config.logger.debug "API called: WorkflowsApi#get_workspace_workflow_version_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
861
+ end
862
+ return data, status_code, headers
863
+ end
864
+
865
+ # List the workflows a partner offers as places to start
866
+ # The partner's starting points, ordered by `position` and then by `key`: the published workflows it offers its managed users when they make a new workflow. Each says whether people can start from it now and, when they cannot, why. The list is the same for every managed user, and a managed user is shown only what is available. A starting point is one of the partner account's own published workflows, built from compositions the account made for itself (not for a customer or a team) and from widgets the partner already offers as presets (`setPartnerPreset`), and it uses at most 10 widgets. A partner offers up to 50. The caller must be the person who administers the partner (an API key of that account works), or a Widgetic administrator.
867
+ # @param partner_id [String] The partner whose starting points to list
868
+ # @param [Hash] opts the optional parameters
869
+ # @return [ListPartnerWorkflowPresets200Response]
870
+ def list_partner_workflow_presets_1(partner_id, opts = {})
871
+ data, _status_code, _headers = list_partner_workflow_presets_1_with_http_info(partner_id, opts)
872
+ data
873
+ end
874
+
875
+ # List the workflows a partner offers as places to start
876
+ # The partner&#39;s starting points, ordered by &#x60;position&#x60; and then by &#x60;key&#x60;: the published workflows it offers its managed users when they make a new workflow. Each says whether people can start from it now and, when they cannot, why. The list is the same for every managed user, and a managed user is shown only what is available. A starting point is one of the partner account&#39;s own published workflows, built from compositions the account made for itself (not for a customer or a team) and from widgets the partner already offers as presets (&#x60;setPartnerPreset&#x60;), and it uses at most 10 widgets. A partner offers up to 50. The caller must be the person who administers the partner (an API key of that account works), or a Widgetic administrator.
877
+ # @param partner_id [String] The partner whose starting points to list
878
+ # @param [Hash] opts the optional parameters
879
+ # @return [Array<(ListPartnerWorkflowPresets200Response, Integer, Hash)>] ListPartnerWorkflowPresets200Response data, response status code and response headers
880
+ def list_partner_workflow_presets_1_with_http_info(partner_id, opts = {})
881
+ if @api_client.config.debugging
882
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.list_partner_workflow_presets_1 ...'
883
+ end
884
+ # verify the required parameter 'partner_id' is set
885
+ if @api_client.config.client_side_validation && partner_id.nil?
886
+ fail ArgumentError, "Missing the required parameter 'partner_id' when calling WorkflowsApi.list_partner_workflow_presets_1"
887
+ end
888
+ # resource path
889
+ local_var_path = '/partners/{partnerId}/workflow-presets'.sub('{' + 'partnerId' + '}', CGI.escape(partner_id.to_s))
890
+
891
+ # query parameters
892
+ query_params = opts[:query_params] || {}
893
+
894
+ # header parameters
895
+ header_params = opts[:header_params] || {}
896
+ # HTTP header 'Accept' (if needed)
897
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
898
+
899
+ # form parameters
900
+ form_params = opts[:form_params] || {}
901
+
902
+ # http body (model)
903
+ post_body = opts[:debug_body]
904
+
905
+ # return_type
906
+ return_type = opts[:debug_return_type] || 'ListPartnerWorkflowPresets200Response'
907
+
908
+ # auth_names
909
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
910
+
911
+ new_options = opts.merge(
912
+ :operation => :"WorkflowsApi.list_partner_workflow_presets_1",
913
+ :header_params => header_params,
914
+ :query_params => query_params,
915
+ :form_params => form_params,
916
+ :body => post_body,
917
+ :auth_names => auth_names,
918
+ :return_type => return_type
919
+ )
920
+
921
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
922
+ if @api_client.config.debugging
923
+ @api_client.config.logger.debug "API called: WorkflowsApi#list_partner_workflow_presets_1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
924
+ end
925
+ return data, status_code, headers
926
+ end
927
+
928
+ # List the compositions a workflow can show, and what each can do
929
+ # The workspace's compositions as the workflow editor offers them, newest first. For each one: whether it can be shown (its widget has a published version), the websites it may be embedded on, and which triggers it supports. - **Input added** (`inputs`) is enabled only for a composition that declares at least one table a visitor's entries can be written to. Its `tables` are all of them; its `fields` are the columns a rule may read (not `id` and `created_at`, not a column that is not text, a number or yes/no, and not one whose name says it holds a person's private details, such as an email or a phone number). - **Action in the widget** (`actions`) is enabled only when the published widget version declares at least one goal. Its `items` are the goals a trigger can wait for. When one of them is not enabled, `reason` says why (`widget_keeps_no_data`, `widget_reports_no_actions` or `widget_not_published`), so the editor can show the trigger disabled with an explanation. Publishing checks every reference again against what the composition can do at that moment. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read it.
930
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
931
+ # @param [Hash] opts the optional parameters
932
+ # @option opts [String] :search Text the composition&#39;s name must contain
933
+ # @option opts [String] :ids Only these compositions (comma-separated ids, at most 50), those of them you may see. Ask for the compositions a workflow shows with this, so each is found whatever page it would be on. An id you may not see is left out, as one that does not exist is.
934
+ # @option opts [Integer] :limit Page size (1-100, 50 when not given)
935
+ # @option opts [Integer] :offset How many to skip (0 when not given)
936
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
937
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
938
+ # @return [ListWorkspaceWorkflowCompositionOptions200Response]
939
+ def list_workspace_workflow_composition_options_0(workspace_id, opts = {})
940
+ data, _status_code, _headers = list_workspace_workflow_composition_options_0_with_http_info(workspace_id, opts)
941
+ data
942
+ end
943
+
944
+ # List the compositions a workflow can show, and what each can do
945
+ # The workspace&#39;s compositions as the workflow editor offers them, newest first. For each one: whether it can be shown (its widget has a published version), the websites it may be embedded on, and which triggers it supports. - **Input added** (&#x60;inputs&#x60;) is enabled only for a composition that declares at least one table a visitor&#39;s entries can be written to. Its &#x60;tables&#x60; are all of them; its &#x60;fields&#x60; are the columns a rule may read (not &#x60;id&#x60; and &#x60;created_at&#x60;, not a column that is not text, a number or yes/no, and not one whose name says it holds a person&#39;s private details, such as an email or a phone number). - **Action in the widget** (&#x60;actions&#x60;) is enabled only when the published widget version declares at least one goal. Its &#x60;items&#x60; are the goals a trigger can wait for. When one of them is not enabled, &#x60;reason&#x60; says why (&#x60;widget_keeps_no_data&#x60;, &#x60;widget_reports_no_actions&#x60; or &#x60;widget_not_published&#x60;), so the editor can show the trigger disabled with an explanation. Publishing checks every reference again against what the composition can do at that moment. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read it.
946
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
947
+ # @param [Hash] opts the optional parameters
948
+ # @option opts [String] :search Text the composition&#39;s name must contain
949
+ # @option opts [String] :ids Only these compositions (comma-separated ids, at most 50), those of them you may see. Ask for the compositions a workflow shows with this, so each is found whatever page it would be on. An id you may not see is left out, as one that does not exist is.
950
+ # @option opts [Integer] :limit Page size (1-100, 50 when not given)
951
+ # @option opts [Integer] :offset How many to skip (0 when not given)
952
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
953
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
954
+ # @return [Array<(ListWorkspaceWorkflowCompositionOptions200Response, Integer, Hash)>] ListWorkspaceWorkflowCompositionOptions200Response data, response status code and response headers
955
+ def list_workspace_workflow_composition_options_0_with_http_info(workspace_id, opts = {})
956
+ if @api_client.config.debugging
957
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.list_workspace_workflow_composition_options_0 ...'
958
+ end
959
+ # verify the required parameter 'workspace_id' is set
960
+ if @api_client.config.client_side_validation && workspace_id.nil?
961
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.list_workspace_workflow_composition_options_0"
962
+ end
963
+ if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length > 120
964
+ fail ArgumentError, 'invalid value for "opts[:"search"]" when calling WorkflowsApi.list_workspace_workflow_composition_options_0, the character length must be smaller than or equal to 120.'
965
+ end
966
+
967
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
968
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.list_workspace_workflow_composition_options_0, the character length must be smaller than or equal to 255.'
969
+ end
970
+
971
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
972
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.list_workspace_workflow_composition_options_0, the character length must be great than or equal to 1.'
973
+ end
974
+
975
+ # resource path
976
+ local_var_path = '/workspaces/{workspaceId}/workflows/composition-options'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))
977
+
978
+ # query parameters
979
+ query_params = opts[:query_params] || {}
980
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
981
+ query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].nil?
982
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
983
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
984
+
985
+ # header parameters
986
+ header_params = opts[:header_params] || {}
987
+ # HTTP header 'Accept' (if needed)
988
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
989
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
990
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
991
+
992
+ # form parameters
993
+ form_params = opts[:form_params] || {}
994
+
995
+ # http body (model)
996
+ post_body = opts[:debug_body]
997
+
998
+ # return_type
999
+ return_type = opts[:debug_return_type] || 'ListWorkspaceWorkflowCompositionOptions200Response'
1000
+
1001
+ # auth_names
1002
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1003
+
1004
+ new_options = opts.merge(
1005
+ :operation => :"WorkflowsApi.list_workspace_workflow_composition_options_0",
1006
+ :header_params => header_params,
1007
+ :query_params => query_params,
1008
+ :form_params => form_params,
1009
+ :body => post_body,
1010
+ :auth_names => auth_names,
1011
+ :return_type => return_type
1012
+ )
1013
+
1014
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1015
+ if @api_client.config.debugging
1016
+ @api_client.config.logger.debug "API called: WorkflowsApi#list_workspace_workflow_composition_options_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1017
+ end
1018
+ return data, status_code, headers
1019
+ end
1020
+
1021
+ # List the starting points for a new Workflow
1022
+ # The workflows you can start from in this workspace: published workflows that Widgetic offers or, for one of a partner's managed users, that the partner offers (a managed user is never shown Widgetic's, and a person is never shown a partner's). Only what can be started now is listed, in the order the offerer set (smallest `position` first, then by `key`). Each shows what you would get, and none shows who made it or any id of its own. Start from one with `createWorkspaceWorkflowFromPreset`. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read the list.
1023
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1024
+ # @param [Hash] opts the optional parameters
1025
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1026
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1027
+ # @return [ListWorkspaceWorkflowPresets200Response]
1028
+ def list_workspace_workflow_presets_0(workspace_id, opts = {})
1029
+ data, _status_code, _headers = list_workspace_workflow_presets_0_with_http_info(workspace_id, opts)
1030
+ data
1031
+ end
1032
+
1033
+ # List the starting points for a new Workflow
1034
+ # The workflows you can start from in this workspace: published workflows that Widgetic offers or, for one of a partner&#39;s managed users, that the partner offers (a managed user is never shown Widgetic&#39;s, and a person is never shown a partner&#39;s). Only what can be started now is listed, in the order the offerer set (smallest &#x60;position&#x60; first, then by &#x60;key&#x60;). Each shows what you would get, and none shows who made it or any id of its own. Start from one with &#x60;createWorkspaceWorkflowFromPreset&#x60;. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read the list.
1035
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1036
+ # @param [Hash] opts the optional parameters
1037
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1038
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1039
+ # @return [Array<(ListWorkspaceWorkflowPresets200Response, Integer, Hash)>] ListWorkspaceWorkflowPresets200Response data, response status code and response headers
1040
+ def list_workspace_workflow_presets_0_with_http_info(workspace_id, opts = {})
1041
+ if @api_client.config.debugging
1042
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.list_workspace_workflow_presets_0 ...'
1043
+ end
1044
+ # verify the required parameter 'workspace_id' is set
1045
+ if @api_client.config.client_side_validation && workspace_id.nil?
1046
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.list_workspace_workflow_presets_0"
1047
+ end
1048
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
1049
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.list_workspace_workflow_presets_0, the character length must be smaller than or equal to 255.'
1050
+ end
1051
+
1052
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
1053
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.list_workspace_workflow_presets_0, the character length must be great than or equal to 1.'
1054
+ end
1055
+
1056
+ # resource path
1057
+ local_var_path = '/workspaces/{workspaceId}/workflows/presets'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))
1058
+
1059
+ # query parameters
1060
+ query_params = opts[:query_params] || {}
1061
+
1062
+ # header parameters
1063
+ header_params = opts[:header_params] || {}
1064
+ # HTTP header 'Accept' (if needed)
1065
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1066
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
1067
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
1068
+
1069
+ # form parameters
1070
+ form_params = opts[:form_params] || {}
1071
+
1072
+ # http body (model)
1073
+ post_body = opts[:debug_body]
1074
+
1075
+ # return_type
1076
+ return_type = opts[:debug_return_type] || 'ListWorkspaceWorkflowPresets200Response'
1077
+
1078
+ # auth_names
1079
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1080
+
1081
+ new_options = opts.merge(
1082
+ :operation => :"WorkflowsApi.list_workspace_workflow_presets_0",
1083
+ :header_params => header_params,
1084
+ :query_params => query_params,
1085
+ :form_params => form_params,
1086
+ :body => post_body,
1087
+ :auth_names => auth_names,
1088
+ :return_type => return_type
1089
+ )
1090
+
1091
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1092
+ if @api_client.config.debugging
1093
+ @api_client.config.logger.debug "API called: WorkflowsApi#list_workspace_workflow_presets_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1094
+ end
1095
+ return data, status_code, headers
1096
+ end
1097
+
1098
+ # List the Published Versions of a Workflow
1099
+ # Every version the workflow has had, newest first, with who published it and when. The one visitors get is marked `isLive`. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
1100
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1101
+ # @param workflow_id [String] The workflow&#39;s id
1102
+ # @param [Hash] opts the optional parameters
1103
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1104
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1105
+ # @return [ListWorkspaceWorkflowVersions200Response]
1106
+ def list_workspace_workflow_versions_0(workspace_id, workflow_id, opts = {})
1107
+ data, _status_code, _headers = list_workspace_workflow_versions_0_with_http_info(workspace_id, workflow_id, opts)
1108
+ data
1109
+ end
1110
+
1111
+ # List the Published Versions of a Workflow
1112
+ # Every version the workflow has had, newest first, with who published it and when. The one visitors get is marked &#x60;isLive&#x60;. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
1113
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1114
+ # @param workflow_id [String] The workflow&#39;s id
1115
+ # @param [Hash] opts the optional parameters
1116
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1117
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1118
+ # @return [Array<(ListWorkspaceWorkflowVersions200Response, Integer, Hash)>] ListWorkspaceWorkflowVersions200Response data, response status code and response headers
1119
+ def list_workspace_workflow_versions_0_with_http_info(workspace_id, workflow_id, opts = {})
1120
+ if @api_client.config.debugging
1121
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.list_workspace_workflow_versions_0 ...'
1122
+ end
1123
+ # verify the required parameter 'workspace_id' is set
1124
+ if @api_client.config.client_side_validation && workspace_id.nil?
1125
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.list_workspace_workflow_versions_0"
1126
+ end
1127
+ # verify the required parameter 'workflow_id' is set
1128
+ if @api_client.config.client_side_validation && workflow_id.nil?
1129
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.list_workspace_workflow_versions_0"
1130
+ end
1131
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
1132
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.list_workspace_workflow_versions_0, the character length must be smaller than or equal to 255.'
1133
+ end
1134
+
1135
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
1136
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.list_workspace_workflow_versions_0, the character length must be great than or equal to 1.'
1137
+ end
1138
+
1139
+ # resource path
1140
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}/versions'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
1141
+
1142
+ # query parameters
1143
+ query_params = opts[:query_params] || {}
1144
+
1145
+ # header parameters
1146
+ header_params = opts[:header_params] || {}
1147
+ # HTTP header 'Accept' (if needed)
1148
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1149
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
1150
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
1151
+
1152
+ # form parameters
1153
+ form_params = opts[:form_params] || {}
1154
+
1155
+ # http body (model)
1156
+ post_body = opts[:debug_body]
1157
+
1158
+ # return_type
1159
+ return_type = opts[:debug_return_type] || 'ListWorkspaceWorkflowVersions200Response'
1160
+
1161
+ # auth_names
1162
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1163
+
1164
+ new_options = opts.merge(
1165
+ :operation => :"WorkflowsApi.list_workspace_workflow_versions_0",
1166
+ :header_params => header_params,
1167
+ :query_params => query_params,
1168
+ :form_params => form_params,
1169
+ :body => post_body,
1170
+ :auth_names => auth_names,
1171
+ :return_type => return_type
1172
+ )
1173
+
1174
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1175
+ if @api_client.config.debugging
1176
+ @api_client.config.logger.debug "API called: WorkflowsApi#list_workspace_workflow_versions_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1177
+ end
1178
+ return data, status_code, headers
1179
+ end
1180
+
1181
+ # List the Workflows of a Workspace
1182
+ # Lists the workspace's workflows, newest first unless `sort` says otherwise. Archived workflows are left out unless `status` asks for them (`archived`, or `all`). For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read the list.
1183
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1184
+ # @param [Hash] opts the optional parameters
1185
+ # @option opts [String] :search Text the workflow&#39;s name must contain
1186
+ # @option opts [String] :status One state to list (&#x60;draft&#x60;, &#x60;live&#x60;, &#x60;paused&#x60;, &#x60;archived&#x60;), or &#x60;all&#x60; for every state. Without it, the ones in use (draft, live and paused).
1187
+ # @option opts [String] :sort &#x60;&lt;field&gt;:&lt;asc|desc&gt;&#x60; where field is createdAt, lastPublishedAt, runsCount or name (or just asc / desc for createdAt). Newest first when not given.
1188
+ # @option opts [Integer] :limit Page size (1-100, 50 when not given)
1189
+ # @option opts [Integer] :offset How many to skip (0 when not given)
1190
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1191
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1192
+ # @return [ListWorkspaceWorkflows200Response]
1193
+ def list_workspace_workflows_0(workspace_id, opts = {})
1194
+ data, _status_code, _headers = list_workspace_workflows_0_with_http_info(workspace_id, opts)
1195
+ data
1196
+ end
1197
+
1198
+ # List the Workflows of a Workspace
1199
+ # Lists the workspace&#39;s workflows, newest first unless &#x60;sort&#x60; says otherwise. Archived workflows are left out unless &#x60;status&#x60; asks for them (&#x60;archived&#x60;, or &#x60;all&#x60;). For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read the list.
1200
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1201
+ # @param [Hash] opts the optional parameters
1202
+ # @option opts [String] :search Text the workflow&#39;s name must contain
1203
+ # @option opts [String] :status One state to list (&#x60;draft&#x60;, &#x60;live&#x60;, &#x60;paused&#x60;, &#x60;archived&#x60;), or &#x60;all&#x60; for every state. Without it, the ones in use (draft, live and paused).
1204
+ # @option opts [String] :sort &#x60;&lt;field&gt;:&lt;asc|desc&gt;&#x60; where field is createdAt, lastPublishedAt, runsCount or name (or just asc / desc for createdAt). Newest first when not given.
1205
+ # @option opts [Integer] :limit Page size (1-100, 50 when not given)
1206
+ # @option opts [Integer] :offset How many to skip (0 when not given)
1207
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1208
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1209
+ # @return [Array<(ListWorkspaceWorkflows200Response, Integer, Hash)>] ListWorkspaceWorkflows200Response data, response status code and response headers
1210
+ def list_workspace_workflows_0_with_http_info(workspace_id, opts = {})
1211
+ if @api_client.config.debugging
1212
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.list_workspace_workflows_0 ...'
1213
+ end
1214
+ # verify the required parameter 'workspace_id' is set
1215
+ if @api_client.config.client_side_validation && workspace_id.nil?
1216
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.list_workspace_workflows_0"
1217
+ end
1218
+ if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length > 120
1219
+ fail ArgumentError, 'invalid value for "opts[:"search"]" when calling WorkflowsApi.list_workspace_workflows_0, the character length must be smaller than or equal to 120.'
1220
+ end
1221
+
1222
+ allowable_values = ["draft", "live", "paused", "archived", "all"]
1223
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
1224
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
1225
+ end
1226
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
1227
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.list_workspace_workflows_0, the character length must be smaller than or equal to 255.'
1228
+ end
1229
+
1230
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
1231
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.list_workspace_workflows_0, the character length must be great than or equal to 1.'
1232
+ end
1233
+
1234
+ # resource path
1235
+ local_var_path = '/workspaces/{workspaceId}/workflows'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))
1236
+
1237
+ # query parameters
1238
+ query_params = opts[:query_params] || {}
1239
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
1240
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
1241
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
1242
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1243
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1244
+
1245
+ # header parameters
1246
+ header_params = opts[:header_params] || {}
1247
+ # HTTP header 'Accept' (if needed)
1248
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1249
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
1250
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
1251
+
1252
+ # form parameters
1253
+ form_params = opts[:form_params] || {}
1254
+
1255
+ # http body (model)
1256
+ post_body = opts[:debug_body]
1257
+
1258
+ # return_type
1259
+ return_type = opts[:debug_return_type] || 'ListWorkspaceWorkflows200Response'
1260
+
1261
+ # auth_names
1262
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1263
+
1264
+ new_options = opts.merge(
1265
+ :operation => :"WorkflowsApi.list_workspace_workflows_0",
1266
+ :header_params => header_params,
1267
+ :query_params => query_params,
1268
+ :form_params => form_params,
1269
+ :body => post_body,
1270
+ :auth_names => auth_names,
1271
+ :return_type => return_type
1272
+ )
1273
+
1274
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1275
+ if @api_client.config.debugging
1276
+ @api_client.config.logger.debug "API called: WorkflowsApi#list_workspace_workflows_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1277
+ end
1278
+ return data, status_code, headers
1279
+ end
1280
+
1281
+ # Pause a Workflow
1282
+ # While a workflow is paused, its embeds show only their first composition (the `composition-id` of the embed) and no visitor moves on. The live version is kept, and visitors partway through carry on from where they were when it is resumed. Only a live workflow can be paused. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can pause.
1283
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1284
+ # @param workflow_id [String] The workflow&#39;s id
1285
+ # @param [Hash] opts the optional parameters
1286
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1287
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1288
+ # @return [SaveWorkspaceWorkflow200Response]
1289
+ def pause_workspace_workflow_0(workspace_id, workflow_id, opts = {})
1290
+ data, _status_code, _headers = pause_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts)
1291
+ data
1292
+ end
1293
+
1294
+ # Pause a Workflow
1295
+ # While a workflow is paused, its embeds show only their first composition (the &#x60;composition-id&#x60; of the embed) and no visitor moves on. The live version is kept, and visitors partway through carry on from where they were when it is resumed. Only a live workflow can be paused. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can pause.
1296
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1297
+ # @param workflow_id [String] The workflow&#39;s id
1298
+ # @param [Hash] opts the optional parameters
1299
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1300
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1301
+ # @return [Array<(SaveWorkspaceWorkflow200Response, Integer, Hash)>] SaveWorkspaceWorkflow200Response data, response status code and response headers
1302
+ def pause_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts = {})
1303
+ if @api_client.config.debugging
1304
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.pause_workspace_workflow_0 ...'
1305
+ end
1306
+ # verify the required parameter 'workspace_id' is set
1307
+ if @api_client.config.client_side_validation && workspace_id.nil?
1308
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.pause_workspace_workflow_0"
1309
+ end
1310
+ # verify the required parameter 'workflow_id' is set
1311
+ if @api_client.config.client_side_validation && workflow_id.nil?
1312
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.pause_workspace_workflow_0"
1313
+ end
1314
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
1315
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.pause_workspace_workflow_0, the character length must be smaller than or equal to 255.'
1316
+ end
1317
+
1318
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
1319
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.pause_workspace_workflow_0, the character length must be great than or equal to 1.'
1320
+ end
1321
+
1322
+ # resource path
1323
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}/pause'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
1324
+
1325
+ # query parameters
1326
+ query_params = opts[:query_params] || {}
1327
+
1328
+ # header parameters
1329
+ header_params = opts[:header_params] || {}
1330
+ # HTTP header 'Accept' (if needed)
1331
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1332
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
1333
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
1334
+
1335
+ # form parameters
1336
+ form_params = opts[:form_params] || {}
1337
+
1338
+ # http body (model)
1339
+ post_body = opts[:debug_body]
1340
+
1341
+ # return_type
1342
+ return_type = opts[:debug_return_type] || 'SaveWorkspaceWorkflow200Response'
1343
+
1344
+ # auth_names
1345
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1346
+
1347
+ new_options = opts.merge(
1348
+ :operation => :"WorkflowsApi.pause_workspace_workflow_0",
1349
+ :header_params => header_params,
1350
+ :query_params => query_params,
1351
+ :form_params => form_params,
1352
+ :body => post_body,
1353
+ :auth_names => auth_names,
1354
+ :return_type => return_type
1355
+ )
1356
+
1357
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1358
+ if @api_client.config.debugging
1359
+ @api_client.config.logger.debug "API called: WorkflowsApi#pause_workspace_workflow_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1360
+ end
1361
+ return data, status_code, headers
1362
+ end
1363
+
1364
+ # Publish the Draft of a Workflow
1365
+ # Checks the draft and, when nothing stops it, makes it the next version and the one new visitors get. Versions never change once published. A visitor already partway through keeps the version they started on (for up to 30 days). The check reads what each composition can do right now (a table the visitor adds to, a goal the widget reports, the websites it may be embedded on), so a workflow never goes live pointing at something that has gone. It is refused with 422 (`BUSINESS_OPERATION_INVALID`) when the draft has errors; the `issues` in the error's `details` name the blocks to fix: an unconnected trigger, a condition without rules, a composition that is not published, a field or action that is gone, a composition whose allowed websites exclude the site the workflow starts on. Nothing is published when the draft has no changes since the live version. The `revision` is the one the editor read, and a publish of a draft that has moved on is refused with 409. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can publish.
1366
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1367
+ # @param workflow_id [String] The workflow&#39;s id
1368
+ # @param idempotency_key [String] Required: a call without it is refused with &#x60;400&#x60;. A key of your own that names this one request; a UUID is ideal. It is 8 to 50 characters of letters, digits, &#x60;-&#x60; and &#x60;_&#x60;. Send the same key again when you retry (after a timeout, a dropped connection or a &#x60;5xx&#x60;) and the call is carried out once: the retry gets the first answer back, marked &#x60;X-Idempotency-Cached: true&#x60;. The same key with a different body is refused with &#x60;422&#x60;, and a retry that arrives while the first call is still running with &#x60;409&#x60; (see &#x60;Retry-After&#x60;).
1369
+ # @param publish_workspace_workflow_request [PublishWorkspaceWorkflowRequest]
1370
+ # @param [Hash] opts the optional parameters
1371
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1372
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1373
+ # @return [PublishWorkspaceWorkflow200Response]
1374
+ def publish_workspace_workflow_0(workspace_id, workflow_id, idempotency_key, publish_workspace_workflow_request, opts = {})
1375
+ data, _status_code, _headers = publish_workspace_workflow_0_with_http_info(workspace_id, workflow_id, idempotency_key, publish_workspace_workflow_request, opts)
1376
+ data
1377
+ end
1378
+
1379
+ # Publish the Draft of a Workflow
1380
+ # Checks the draft and, when nothing stops it, makes it the next version and the one new visitors get. Versions never change once published. A visitor already partway through keeps the version they started on (for up to 30 days). The check reads what each composition can do right now (a table the visitor adds to, a goal the widget reports, the websites it may be embedded on), so a workflow never goes live pointing at something that has gone. It is refused with 422 (&#x60;BUSINESS_OPERATION_INVALID&#x60;) when the draft has errors; the &#x60;issues&#x60; in the error&#39;s &#x60;details&#x60; name the blocks to fix: an unconnected trigger, a condition without rules, a composition that is not published, a field or action that is gone, a composition whose allowed websites exclude the site the workflow starts on. Nothing is published when the draft has no changes since the live version. The &#x60;revision&#x60; is the one the editor read, and a publish of a draft that has moved on is refused with 409. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can publish.
1381
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1382
+ # @param workflow_id [String] The workflow&#39;s id
1383
+ # @param idempotency_key [String] Required: a call without it is refused with &#x60;400&#x60;. A key of your own that names this one request; a UUID is ideal. It is 8 to 50 characters of letters, digits, &#x60;-&#x60; and &#x60;_&#x60;. Send the same key again when you retry (after a timeout, a dropped connection or a &#x60;5xx&#x60;) and the call is carried out once: the retry gets the first answer back, marked &#x60;X-Idempotency-Cached: true&#x60;. The same key with a different body is refused with &#x60;422&#x60;, and a retry that arrives while the first call is still running with &#x60;409&#x60; (see &#x60;Retry-After&#x60;).
1384
+ # @param publish_workspace_workflow_request [PublishWorkspaceWorkflowRequest]
1385
+ # @param [Hash] opts the optional parameters
1386
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1387
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1388
+ # @return [Array<(PublishWorkspaceWorkflow200Response, Integer, Hash)>] PublishWorkspaceWorkflow200Response data, response status code and response headers
1389
+ def publish_workspace_workflow_0_with_http_info(workspace_id, workflow_id, idempotency_key, publish_workspace_workflow_request, opts = {})
1390
+ if @api_client.config.debugging
1391
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.publish_workspace_workflow_0 ...'
1392
+ end
1393
+ # verify the required parameter 'workspace_id' is set
1394
+ if @api_client.config.client_side_validation && workspace_id.nil?
1395
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.publish_workspace_workflow_0"
1396
+ end
1397
+ # verify the required parameter 'workflow_id' is set
1398
+ if @api_client.config.client_side_validation && workflow_id.nil?
1399
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.publish_workspace_workflow_0"
1400
+ end
1401
+ # verify the required parameter 'idempotency_key' is set
1402
+ if @api_client.config.client_side_validation && idempotency_key.nil?
1403
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling WorkflowsApi.publish_workspace_workflow_0"
1404
+ end
1405
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length > 50
1406
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling WorkflowsApi.publish_workspace_workflow_0, the character length must be smaller than or equal to 50.'
1407
+ end
1408
+
1409
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length < 8
1410
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling WorkflowsApi.publish_workspace_workflow_0, the character length must be great than or equal to 8.'
1411
+ end
1412
+
1413
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]{8,50}$/)
1414
+ if @api_client.config.client_side_validation && idempotency_key !~ pattern
1415
+ fail ArgumentError, "invalid value for 'idempotency_key' when calling WorkflowsApi.publish_workspace_workflow_0, must conform to the pattern #{pattern}."
1416
+ end
1417
+
1418
+ # verify the required parameter 'publish_workspace_workflow_request' is set
1419
+ if @api_client.config.client_side_validation && publish_workspace_workflow_request.nil?
1420
+ fail ArgumentError, "Missing the required parameter 'publish_workspace_workflow_request' when calling WorkflowsApi.publish_workspace_workflow_0"
1421
+ end
1422
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
1423
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.publish_workspace_workflow_0, the character length must be smaller than or equal to 255.'
1424
+ end
1425
+
1426
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
1427
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.publish_workspace_workflow_0, the character length must be great than or equal to 1.'
1428
+ end
1429
+
1430
+ # resource path
1431
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}/publish'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
1432
+
1433
+ # query parameters
1434
+ query_params = opts[:query_params] || {}
1435
+
1436
+ # header parameters
1437
+ header_params = opts[:header_params] || {}
1438
+ # HTTP header 'Accept' (if needed)
1439
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1440
+ # HTTP header 'Content-Type'
1441
+ content_type = @api_client.select_header_content_type(['application/json'])
1442
+ if !content_type.nil?
1443
+ header_params['Content-Type'] = content_type
1444
+ end
1445
+ header_params[:'Idempotency-Key'] = idempotency_key
1446
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
1447
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
1448
+
1449
+ # form parameters
1450
+ form_params = opts[:form_params] || {}
1451
+
1452
+ # http body (model)
1453
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(publish_workspace_workflow_request)
1454
+
1455
+ # return_type
1456
+ return_type = opts[:debug_return_type] || 'PublishWorkspaceWorkflow200Response'
1457
+
1458
+ # auth_names
1459
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1460
+
1461
+ new_options = opts.merge(
1462
+ :operation => :"WorkflowsApi.publish_workspace_workflow_0",
1463
+ :header_params => header_params,
1464
+ :query_params => query_params,
1465
+ :form_params => form_params,
1466
+ :body => post_body,
1467
+ :auth_names => auth_names,
1468
+ :return_type => return_type
1469
+ )
1470
+
1471
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1472
+ if @api_client.config.debugging
1473
+ @api_client.config.logger.debug "API called: WorkflowsApi#publish_workspace_workflow_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1474
+ end
1475
+ return data, status_code, headers
1476
+ end
1477
+
1478
+ # Stop offering a workflow as a place to start
1479
+ # Removes the starting point under `key`. The workflow itself is not touched, and neither are the workflows people already started from it. Removing a starting point the partner does not offer is not an error: the answer is `removed: false`.
1480
+ # @param partner_id [String] The partner whose starting point to remove
1481
+ # @param key [String] The key of the starting point to remove
1482
+ # @param [Hash] opts the optional parameters
1483
+ # @return [RemovePartnerWorkflowPreset200Response]
1484
+ def remove_partner_workflow_preset_1(partner_id, key, opts = {})
1485
+ data, _status_code, _headers = remove_partner_workflow_preset_1_with_http_info(partner_id, key, opts)
1486
+ data
1487
+ end
1488
+
1489
+ # Stop offering a workflow as a place to start
1490
+ # Removes the starting point under &#x60;key&#x60;. The workflow itself is not touched, and neither are the workflows people already started from it. Removing a starting point the partner does not offer is not an error: the answer is &#x60;removed: false&#x60;.
1491
+ # @param partner_id [String] The partner whose starting point to remove
1492
+ # @param key [String] The key of the starting point to remove
1493
+ # @param [Hash] opts the optional parameters
1494
+ # @return [Array<(RemovePartnerWorkflowPreset200Response, Integer, Hash)>] RemovePartnerWorkflowPreset200Response data, response status code and response headers
1495
+ def remove_partner_workflow_preset_1_with_http_info(partner_id, key, opts = {})
1496
+ if @api_client.config.debugging
1497
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.remove_partner_workflow_preset_1 ...'
1498
+ end
1499
+ # verify the required parameter 'partner_id' is set
1500
+ if @api_client.config.client_side_validation && partner_id.nil?
1501
+ fail ArgumentError, "Missing the required parameter 'partner_id' when calling WorkflowsApi.remove_partner_workflow_preset_1"
1502
+ end
1503
+ # verify the required parameter 'key' is set
1504
+ if @api_client.config.client_side_validation && key.nil?
1505
+ fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.remove_partner_workflow_preset_1"
1506
+ end
1507
+ pattern = Regexp.new(/^[a-z0-9][a-z0-9_-]{0,63}$/)
1508
+ if @api_client.config.client_side_validation && key !~ pattern
1509
+ fail ArgumentError, "invalid value for 'key' when calling WorkflowsApi.remove_partner_workflow_preset_1, must conform to the pattern #{pattern}."
1510
+ end
1511
+
1512
+ # resource path
1513
+ local_var_path = '/partners/{partnerId}/workflow-presets/{key}'.sub('{' + 'partnerId' + '}', CGI.escape(partner_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))
1514
+
1515
+ # query parameters
1516
+ query_params = opts[:query_params] || {}
1517
+
1518
+ # header parameters
1519
+ header_params = opts[:header_params] || {}
1520
+ # HTTP header 'Accept' (if needed)
1521
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1522
+
1523
+ # form parameters
1524
+ form_params = opts[:form_params] || {}
1525
+
1526
+ # http body (model)
1527
+ post_body = opts[:debug_body]
1528
+
1529
+ # return_type
1530
+ return_type = opts[:debug_return_type] || 'RemovePartnerWorkflowPreset200Response'
1531
+
1532
+ # auth_names
1533
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1534
+
1535
+ new_options = opts.merge(
1536
+ :operation => :"WorkflowsApi.remove_partner_workflow_preset_1",
1537
+ :header_params => header_params,
1538
+ :query_params => query_params,
1539
+ :form_params => form_params,
1540
+ :body => post_body,
1541
+ :auth_names => auth_names,
1542
+ :return_type => return_type
1543
+ )
1544
+
1545
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
1546
+ if @api_client.config.debugging
1547
+ @api_client.config.logger.debug "API called: WorkflowsApi#remove_partner_workflow_preset_1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1548
+ end
1549
+ return data, status_code, headers
1550
+ end
1551
+
1552
+ # Restore a Version of a Workflow into the Draft
1553
+ # Copies a published version into the draft, so it can be changed and published again. Nothing is published and nothing visitors see changes: the version stays in the history as it was. Names the `revision` the editor read. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can restore.
1554
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1555
+ # @param workflow_id [String] The workflow&#39;s id
1556
+ # @param version_id [String] The id of a published version of the workflow
1557
+ # @param publish_workspace_workflow_request [PublishWorkspaceWorkflowRequest]
1558
+ # @param [Hash] opts the optional parameters
1559
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1560
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1561
+ # @return [CreateWorkspaceWorkflowFromPreset201Response]
1562
+ def restore_workspace_workflow_version_0(workspace_id, workflow_id, version_id, publish_workspace_workflow_request, opts = {})
1563
+ data, _status_code, _headers = restore_workspace_workflow_version_0_with_http_info(workspace_id, workflow_id, version_id, publish_workspace_workflow_request, opts)
1564
+ data
1565
+ end
1566
+
1567
+ # Restore a Version of a Workflow into the Draft
1568
+ # Copies a published version into the draft, so it can be changed and published again. Nothing is published and nothing visitors see changes: the version stays in the history as it was. Names the &#x60;revision&#x60; the editor read. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can restore.
1569
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1570
+ # @param workflow_id [String] The workflow&#39;s id
1571
+ # @param version_id [String] The id of a published version of the workflow
1572
+ # @param publish_workspace_workflow_request [PublishWorkspaceWorkflowRequest]
1573
+ # @param [Hash] opts the optional parameters
1574
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1575
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1576
+ # @return [Array<(CreateWorkspaceWorkflowFromPreset201Response, Integer, Hash)>] CreateWorkspaceWorkflowFromPreset201Response data, response status code and response headers
1577
+ def restore_workspace_workflow_version_0_with_http_info(workspace_id, workflow_id, version_id, publish_workspace_workflow_request, opts = {})
1578
+ if @api_client.config.debugging
1579
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.restore_workspace_workflow_version_0 ...'
1580
+ end
1581
+ # verify the required parameter 'workspace_id' is set
1582
+ if @api_client.config.client_side_validation && workspace_id.nil?
1583
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.restore_workspace_workflow_version_0"
1584
+ end
1585
+ # verify the required parameter 'workflow_id' is set
1586
+ if @api_client.config.client_side_validation && workflow_id.nil?
1587
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.restore_workspace_workflow_version_0"
1588
+ end
1589
+ # verify the required parameter 'version_id' is set
1590
+ if @api_client.config.client_side_validation && version_id.nil?
1591
+ fail ArgumentError, "Missing the required parameter 'version_id' when calling WorkflowsApi.restore_workspace_workflow_version_0"
1592
+ end
1593
+ # verify the required parameter 'publish_workspace_workflow_request' is set
1594
+ if @api_client.config.client_side_validation && publish_workspace_workflow_request.nil?
1595
+ fail ArgumentError, "Missing the required parameter 'publish_workspace_workflow_request' when calling WorkflowsApi.restore_workspace_workflow_version_0"
1596
+ end
1597
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
1598
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.restore_workspace_workflow_version_0, the character length must be smaller than or equal to 255.'
1599
+ end
1600
+
1601
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
1602
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.restore_workspace_workflow_version_0, the character length must be great than or equal to 1.'
1603
+ end
1604
+
1605
+ # resource path
1606
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}/versions/{versionId}/restore'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s)).sub('{' + 'versionId' + '}', CGI.escape(version_id.to_s))
1607
+
1608
+ # query parameters
1609
+ query_params = opts[:query_params] || {}
1610
+
1611
+ # header parameters
1612
+ header_params = opts[:header_params] || {}
1613
+ # HTTP header 'Accept' (if needed)
1614
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1615
+ # HTTP header 'Content-Type'
1616
+ content_type = @api_client.select_header_content_type(['application/json'])
1617
+ if !content_type.nil?
1618
+ header_params['Content-Type'] = content_type
1619
+ end
1620
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
1621
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
1622
+
1623
+ # form parameters
1624
+ form_params = opts[:form_params] || {}
1625
+
1626
+ # http body (model)
1627
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(publish_workspace_workflow_request)
1628
+
1629
+ # return_type
1630
+ return_type = opts[:debug_return_type] || 'CreateWorkspaceWorkflowFromPreset201Response'
1631
+
1632
+ # auth_names
1633
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1634
+
1635
+ new_options = opts.merge(
1636
+ :operation => :"WorkflowsApi.restore_workspace_workflow_version_0",
1637
+ :header_params => header_params,
1638
+ :query_params => query_params,
1639
+ :form_params => form_params,
1640
+ :body => post_body,
1641
+ :auth_names => auth_names,
1642
+ :return_type => return_type
1643
+ )
1644
+
1645
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1646
+ if @api_client.config.debugging
1647
+ @api_client.config.logger.debug "API called: WorkflowsApi#restore_workspace_workflow_version_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1648
+ end
1649
+ return data, status_code, headers
1650
+ end
1651
+
1652
+ # Resume a Paused Workflow
1653
+ # Makes a paused workflow live again, on the version that was live when it was paused. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can resume.
1654
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1655
+ # @param workflow_id [String] The workflow&#39;s id
1656
+ # @param [Hash] opts the optional parameters
1657
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1658
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1659
+ # @return [SaveWorkspaceWorkflow200Response]
1660
+ def resume_workspace_workflow_0(workspace_id, workflow_id, opts = {})
1661
+ data, _status_code, _headers = resume_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts)
1662
+ data
1663
+ end
1664
+
1665
+ # Resume a Paused Workflow
1666
+ # Makes a paused workflow live again, on the version that was live when it was paused. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can resume.
1667
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1668
+ # @param workflow_id [String] The workflow&#39;s id
1669
+ # @param [Hash] opts the optional parameters
1670
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1671
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1672
+ # @return [Array<(SaveWorkspaceWorkflow200Response, Integer, Hash)>] SaveWorkspaceWorkflow200Response data, response status code and response headers
1673
+ def resume_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts = {})
1674
+ if @api_client.config.debugging
1675
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.resume_workspace_workflow_0 ...'
1676
+ end
1677
+ # verify the required parameter 'workspace_id' is set
1678
+ if @api_client.config.client_side_validation && workspace_id.nil?
1679
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.resume_workspace_workflow_0"
1680
+ end
1681
+ # verify the required parameter 'workflow_id' is set
1682
+ if @api_client.config.client_side_validation && workflow_id.nil?
1683
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.resume_workspace_workflow_0"
1684
+ end
1685
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
1686
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.resume_workspace_workflow_0, the character length must be smaller than or equal to 255.'
1687
+ end
1688
+
1689
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
1690
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.resume_workspace_workflow_0, the character length must be great than or equal to 1.'
1691
+ end
1692
+
1693
+ # resource path
1694
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}/resume'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
1695
+
1696
+ # query parameters
1697
+ query_params = opts[:query_params] || {}
1698
+
1699
+ # header parameters
1700
+ header_params = opts[:header_params] || {}
1701
+ # HTTP header 'Accept' (if needed)
1702
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1703
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
1704
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
1705
+
1706
+ # form parameters
1707
+ form_params = opts[:form_params] || {}
1708
+
1709
+ # http body (model)
1710
+ post_body = opts[:debug_body]
1711
+
1712
+ # return_type
1713
+ return_type = opts[:debug_return_type] || 'SaveWorkspaceWorkflow200Response'
1714
+
1715
+ # auth_names
1716
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1717
+
1718
+ new_options = opts.merge(
1719
+ :operation => :"WorkflowsApi.resume_workspace_workflow_0",
1720
+ :header_params => header_params,
1721
+ :query_params => query_params,
1722
+ :form_params => form_params,
1723
+ :body => post_body,
1724
+ :auth_names => auth_names,
1725
+ :return_type => return_type
1726
+ )
1727
+
1728
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1729
+ if @api_client.config.debugging
1730
+ @api_client.config.logger.debug "API called: WorkflowsApi#resume_workspace_workflow_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1731
+ end
1732
+ return data, status_code, headers
1733
+ end
1734
+
1735
+ # Save the Draft of a Workflow
1736
+ # Saves the name, the time zone and/or the graph of the draft. Send at least one. The save names the `revision` the editor started from and is refused with 409 (`BUSINESS_STATE_CONFLICT`) when the draft has moved on, so two people editing do not overwrite each other without knowing; read the workflow again and apply the change to it. A save is never refused for what is wrong with the graph (a block with no connection yet is normal in a draft): only the shape is judged here, and what stops a workflow going live is told when it is published. A graph larger than 200,000 bytes, or with more than 100 blocks or 300 connections, is refused. An archived workflow cannot be saved. Saving a live workflow changes the draft only: visitors keep getting the published version until the changes are published. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can save.
1737
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1738
+ # @param workflow_id [String] The workflow&#39;s id
1739
+ # @param save_workspace_workflow_request [SaveWorkspaceWorkflowRequest]
1740
+ # @param [Hash] opts the optional parameters
1741
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1742
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1743
+ # @return [SaveWorkspaceWorkflow200Response]
1744
+ def save_workspace_workflow_0(workspace_id, workflow_id, save_workspace_workflow_request, opts = {})
1745
+ data, _status_code, _headers = save_workspace_workflow_0_with_http_info(workspace_id, workflow_id, save_workspace_workflow_request, opts)
1746
+ data
1747
+ end
1748
+
1749
+ # Save the Draft of a Workflow
1750
+ # Saves the name, the time zone and/or the graph of the draft. Send at least one. The save names the &#x60;revision&#x60; the editor started from and is refused with 409 (&#x60;BUSINESS_STATE_CONFLICT&#x60;) when the draft has moved on, so two people editing do not overwrite each other without knowing; read the workflow again and apply the change to it. A save is never refused for what is wrong with the graph (a block with no connection yet is normal in a draft): only the shape is judged here, and what stops a workflow going live is told when it is published. A graph larger than 200,000 bytes, or with more than 100 blocks or 300 connections, is refused. An archived workflow cannot be saved. Saving a live workflow changes the draft only: visitors keep getting the published version until the changes are published. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can save.
1751
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1752
+ # @param workflow_id [String] The workflow&#39;s id
1753
+ # @param save_workspace_workflow_request [SaveWorkspaceWorkflowRequest]
1754
+ # @param [Hash] opts the optional parameters
1755
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1756
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1757
+ # @return [Array<(SaveWorkspaceWorkflow200Response, Integer, Hash)>] SaveWorkspaceWorkflow200Response data, response status code and response headers
1758
+ def save_workspace_workflow_0_with_http_info(workspace_id, workflow_id, save_workspace_workflow_request, opts = {})
1759
+ if @api_client.config.debugging
1760
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.save_workspace_workflow_0 ...'
1761
+ end
1762
+ # verify the required parameter 'workspace_id' is set
1763
+ if @api_client.config.client_side_validation && workspace_id.nil?
1764
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.save_workspace_workflow_0"
1765
+ end
1766
+ # verify the required parameter 'workflow_id' is set
1767
+ if @api_client.config.client_side_validation && workflow_id.nil?
1768
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.save_workspace_workflow_0"
1769
+ end
1770
+ # verify the required parameter 'save_workspace_workflow_request' is set
1771
+ if @api_client.config.client_side_validation && save_workspace_workflow_request.nil?
1772
+ fail ArgumentError, "Missing the required parameter 'save_workspace_workflow_request' when calling WorkflowsApi.save_workspace_workflow_0"
1773
+ end
1774
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
1775
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.save_workspace_workflow_0, the character length must be smaller than or equal to 255.'
1776
+ end
1777
+
1778
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
1779
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.save_workspace_workflow_0, the character length must be great than or equal to 1.'
1780
+ end
1781
+
1782
+ # resource path
1783
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
1784
+
1785
+ # query parameters
1786
+ query_params = opts[:query_params] || {}
1787
+
1788
+ # header parameters
1789
+ header_params = opts[:header_params] || {}
1790
+ # HTTP header 'Accept' (if needed)
1791
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1792
+ # HTTP header 'Content-Type'
1793
+ content_type = @api_client.select_header_content_type(['application/json'])
1794
+ if !content_type.nil?
1795
+ header_params['Content-Type'] = content_type
1796
+ end
1797
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
1798
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
1799
+
1800
+ # form parameters
1801
+ form_params = opts[:form_params] || {}
1802
+
1803
+ # http body (model)
1804
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(save_workspace_workflow_request)
1805
+
1806
+ # return_type
1807
+ return_type = opts[:debug_return_type] || 'SaveWorkspaceWorkflow200Response'
1808
+
1809
+ # auth_names
1810
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1811
+
1812
+ new_options = opts.merge(
1813
+ :operation => :"WorkflowsApi.save_workspace_workflow_0",
1814
+ :header_params => header_params,
1815
+ :query_params => query_params,
1816
+ :form_params => form_params,
1817
+ :body => post_body,
1818
+ :auth_names => auth_names,
1819
+ :return_type => return_type
1820
+ )
1821
+
1822
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1823
+ if @api_client.config.debugging
1824
+ @api_client.config.logger.debug "API called: WorkflowsApi#save_workspace_workflow_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1825
+ end
1826
+ return data, status_code, headers
1827
+ end
1828
+
1829
+ # Offer a workflow as a place to start, or replace what a key offers
1830
+ # Offers one of the partner account's own published workflows to its managed users under `key`. If the partner already offers something under that key it is replaced, so sending the same request twice is safe. Saving replaces the whole starting point: a `title`, `description` or `position` you leave out goes back to its default. Keys are 1 to 64 characters: lowercase letters, digits, hyphens and underscores, the first a letter or a digit. A workflow is offered once. What people get is the workflow's live version as it is when they start, so publishing the workflow changes what new starts get; workflows people already started are never touched. The offer is refused, and `error.details.reason` says why, when the workflow: - is not the partner account's own (a workflow of a team or of a customer, or of somebody else), or does not exist: 404, the same for both; - is archived (409 `workflow_archived`), or was never published (409 `workflow_not_published`); - shows no composition (422 `workflow_empty`), or a block shows a composition made for a customer or a team (422 `composition_not_own`); - chains more than 10 widgets (422 `too_many_widgets`), or a widget that the partner does not offer as a preset (422 `widget_not_preset`; `error.details.widgets` lists them, each with its `id` and `name`, so they can be offered first with `setPartnerPreset`); - is already offered under another key (409 `workflow_already_offered`; `error.details.key` says which), or the partner already offers 50 (409 `too_many_presets`). The caller must be the person who administers the partner (an API key of that account works), or a Widgetic administrator, who offers the partner's workflow on its behalf.
1831
+ # @param partner_id [String] The partner whose starting point to set
1832
+ # @param key [String] The name your code and the picker use for the starting point
1833
+ # @param offer_workflow_preset_request [OfferWorkflowPresetRequest]
1834
+ # @param [Hash] opts the optional parameters
1835
+ # @return [SetPartnerWorkflowPreset200Response]
1836
+ def set_partner_workflow_preset_1(partner_id, key, offer_workflow_preset_request, opts = {})
1837
+ data, _status_code, _headers = set_partner_workflow_preset_1_with_http_info(partner_id, key, offer_workflow_preset_request, opts)
1838
+ data
1839
+ end
1840
+
1841
+ # Offer a workflow as a place to start, or replace what a key offers
1842
+ # Offers one of the partner account&#39;s own published workflows to its managed users under &#x60;key&#x60;. If the partner already offers something under that key it is replaced, so sending the same request twice is safe. Saving replaces the whole starting point: a &#x60;title&#x60;, &#x60;description&#x60; or &#x60;position&#x60; you leave out goes back to its default. Keys are 1 to 64 characters: lowercase letters, digits, hyphens and underscores, the first a letter or a digit. A workflow is offered once. What people get is the workflow&#39;s live version as it is when they start, so publishing the workflow changes what new starts get; workflows people already started are never touched. The offer is refused, and &#x60;error.details.reason&#x60; says why, when the workflow: - is not the partner account&#39;s own (a workflow of a team or of a customer, or of somebody else), or does not exist: 404, the same for both; - is archived (409 &#x60;workflow_archived&#x60;), or was never published (409 &#x60;workflow_not_published&#x60;); - shows no composition (422 &#x60;workflow_empty&#x60;), or a block shows a composition made for a customer or a team (422 &#x60;composition_not_own&#x60;); - chains more than 10 widgets (422 &#x60;too_many_widgets&#x60;), or a widget that the partner does not offer as a preset (422 &#x60;widget_not_preset&#x60;; &#x60;error.details.widgets&#x60; lists them, each with its &#x60;id&#x60; and &#x60;name&#x60;, so they can be offered first with &#x60;setPartnerPreset&#x60;); - is already offered under another key (409 &#x60;workflow_already_offered&#x60;; &#x60;error.details.key&#x60; says which), or the partner already offers 50 (409 &#x60;too_many_presets&#x60;). The caller must be the person who administers the partner (an API key of that account works), or a Widgetic administrator, who offers the partner&#39;s workflow on its behalf.
1843
+ # @param partner_id [String] The partner whose starting point to set
1844
+ # @param key [String] The name your code and the picker use for the starting point
1845
+ # @param offer_workflow_preset_request [OfferWorkflowPresetRequest]
1846
+ # @param [Hash] opts the optional parameters
1847
+ # @return [Array<(SetPartnerWorkflowPreset200Response, Integer, Hash)>] SetPartnerWorkflowPreset200Response data, response status code and response headers
1848
+ def set_partner_workflow_preset_1_with_http_info(partner_id, key, offer_workflow_preset_request, opts = {})
1849
+ if @api_client.config.debugging
1850
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.set_partner_workflow_preset_1 ...'
1851
+ end
1852
+ # verify the required parameter 'partner_id' is set
1853
+ if @api_client.config.client_side_validation && partner_id.nil?
1854
+ fail ArgumentError, "Missing the required parameter 'partner_id' when calling WorkflowsApi.set_partner_workflow_preset_1"
1855
+ end
1856
+ # verify the required parameter 'key' is set
1857
+ if @api_client.config.client_side_validation && key.nil?
1858
+ fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.set_partner_workflow_preset_1"
1859
+ end
1860
+ pattern = Regexp.new(/^[a-z0-9][a-z0-9_-]{0,63}$/)
1861
+ if @api_client.config.client_side_validation && key !~ pattern
1862
+ fail ArgumentError, "invalid value for 'key' when calling WorkflowsApi.set_partner_workflow_preset_1, must conform to the pattern #{pattern}."
1863
+ end
1864
+
1865
+ # verify the required parameter 'offer_workflow_preset_request' is set
1866
+ if @api_client.config.client_side_validation && offer_workflow_preset_request.nil?
1867
+ fail ArgumentError, "Missing the required parameter 'offer_workflow_preset_request' when calling WorkflowsApi.set_partner_workflow_preset_1"
1868
+ end
1869
+ # resource path
1870
+ local_var_path = '/partners/{partnerId}/workflow-presets/{key}'.sub('{' + 'partnerId' + '}', CGI.escape(partner_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))
1871
+
1872
+ # query parameters
1873
+ query_params = opts[:query_params] || {}
1874
+
1875
+ # header parameters
1876
+ header_params = opts[:header_params] || {}
1877
+ # HTTP header 'Accept' (if needed)
1878
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1879
+ # HTTP header 'Content-Type'
1880
+ content_type = @api_client.select_header_content_type(['application/json'])
1881
+ if !content_type.nil?
1882
+ header_params['Content-Type'] = content_type
1883
+ end
1884
+
1885
+ # form parameters
1886
+ form_params = opts[:form_params] || {}
1887
+
1888
+ # http body (model)
1889
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(offer_workflow_preset_request)
1890
+
1891
+ # return_type
1892
+ return_type = opts[:debug_return_type] || 'SetPartnerWorkflowPreset200Response'
1893
+
1894
+ # auth_names
1895
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1896
+
1897
+ new_options = opts.merge(
1898
+ :operation => :"WorkflowsApi.set_partner_workflow_preset_1",
1899
+ :header_params => header_params,
1900
+ :query_params => query_params,
1901
+ :form_params => form_params,
1902
+ :body => post_body,
1903
+ :auth_names => auth_names,
1904
+ :return_type => return_type
1905
+ )
1906
+
1907
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1908
+ if @api_client.config.debugging
1909
+ @api_client.config.logger.debug "API called: WorkflowsApi#set_partner_workflow_preset_1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1910
+ end
1911
+ return data, status_code, headers
1912
+ end
1913
+
1914
+ # Unarchive a Workflow
1915
+ # Brings an archived workflow back into the list: as paused when it was ever published (resume it to serve visitors again), as a draft when it never was. For personal workspace, use 'personal' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can unarchive.
1916
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1917
+ # @param workflow_id [String] The workflow&#39;s id
1918
+ # @param [Hash] opts the optional parameters
1919
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1920
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1921
+ # @return [SaveWorkspaceWorkflow200Response]
1922
+ def unarchive_workspace_workflow_0(workspace_id, workflow_id, opts = {})
1923
+ data, _status_code, _headers = unarchive_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts)
1924
+ data
1925
+ end
1926
+
1927
+ # Unarchive a Workflow
1928
+ # Brings an archived workflow back into the list: as paused when it was ever published (resume it to serve visitors again), as a draft when it never was. For personal workspace, use &#39;personal&#39; as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can unarchive.
1929
+ # @param workspace_id [String] The workspace: &#39;personal&#39; for your own workspace, or the UUID of an organization. A call made for one of your managed users (&#x60;X-Managed-User-Id&#x60;) always uses &#39;personal&#39;: a managed user has no other workspace, and a call that names an organization is refused with 403.
1930
+ # @param workflow_id [String] The workflow&#39;s id
1931
+ # @param [Hash] opts the optional parameters
1932
+ # @option opts [String] :x_managed_user_id The id Widgetic gave the managed user (&#x60;POST /managed-users&#x60;). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1933
+ # @option opts [String] :x_managed_user_external_id Your own id for the managed user (its &#x60;externalId&#x60;), when you do not keep Widgetic&#39;s. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer&#39;s work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user&#39;s compositions and workflows: a list shows only theirs, a composition or a workflow the call makes is filed under them, and one of another user, or one that does not exist, answers &#x60;404&#x60; (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers &#x60;404&#x60; with &#x60;MANAGED_USER_NOT_FOUND&#x60;. An empty, repeated or malformed header is &#x60;400&#x60; with &#x60;MANAGED_USER_SCOPE_INVALID&#x60;; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with &#x60;403&#x60; and &#x60;MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE&#x60;: send it without the header. Only your API key can send it. The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer&#39;s browser holds, use an editor session. An &#x60;Idempotency-Key&#x60; is kept apart for each managed user.
1934
+ # @return [Array<(SaveWorkspaceWorkflow200Response, Integer, Hash)>] SaveWorkspaceWorkflow200Response data, response status code and response headers
1935
+ def unarchive_workspace_workflow_0_with_http_info(workspace_id, workflow_id, opts = {})
1936
+ if @api_client.config.debugging
1937
+ @api_client.config.logger.debug 'Calling API: WorkflowsApi.unarchive_workspace_workflow_0 ...'
1938
+ end
1939
+ # verify the required parameter 'workspace_id' is set
1940
+ if @api_client.config.client_side_validation && workspace_id.nil?
1941
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkflowsApi.unarchive_workspace_workflow_0"
1942
+ end
1943
+ # verify the required parameter 'workflow_id' is set
1944
+ if @api_client.config.client_side_validation && workflow_id.nil?
1945
+ fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.unarchive_workspace_workflow_0"
1946
+ end
1947
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length > 255
1948
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.unarchive_workspace_workflow_0, the character length must be smaller than or equal to 255.'
1949
+ end
1950
+
1951
+ if @api_client.config.client_side_validation && !opts[:'x_managed_user_external_id'].nil? && opts[:'x_managed_user_external_id'].to_s.length < 1
1952
+ fail ArgumentError, 'invalid value for "opts[:"x_managed_user_external_id"]" when calling WorkflowsApi.unarchive_workspace_workflow_0, the character length must be great than or equal to 1.'
1953
+ end
1954
+
1955
+ # resource path
1956
+ local_var_path = '/workspaces/{workspaceId}/workflows/{workflowId}/unarchive'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'workflowId' + '}', CGI.escape(workflow_id.to_s))
1957
+
1958
+ # query parameters
1959
+ query_params = opts[:query_params] || {}
1960
+
1961
+ # header parameters
1962
+ header_params = opts[:header_params] || {}
1963
+ # HTTP header 'Accept' (if needed)
1964
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1965
+ header_params[:'X-Managed-User-Id'] = opts[:'x_managed_user_id'] if !opts[:'x_managed_user_id'].nil?
1966
+ header_params[:'X-Managed-User-External-Id'] = opts[:'x_managed_user_external_id'] if !opts[:'x_managed_user_external_id'].nil?
1967
+
1968
+ # form parameters
1969
+ form_params = opts[:form_params] || {}
1970
+
1971
+ # http body (model)
1972
+ post_body = opts[:debug_body]
1973
+
1974
+ # return_type
1975
+ return_type = opts[:debug_return_type] || 'SaveWorkspaceWorkflow200Response'
1976
+
1977
+ # auth_names
1978
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
1979
+
1980
+ new_options = opts.merge(
1981
+ :operation => :"WorkflowsApi.unarchive_workspace_workflow_0",
1982
+ :header_params => header_params,
1983
+ :query_params => query_params,
1984
+ :form_params => form_params,
1985
+ :body => post_body,
1986
+ :auth_names => auth_names,
1987
+ :return_type => return_type
1988
+ )
1989
+
1990
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1991
+ if @api_client.config.debugging
1992
+ @api_client.config.logger.debug "API called: WorkflowsApi#unarchive_workspace_workflow_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1993
+ end
1994
+ return data, status_code, headers
1995
+ end
1996
+ end
1997
+ end