From 48a8f56e413e117f92acacddb27645a6628e3e54 Mon Sep 17 00:00:00 2001 From: David Amrani Date: Thu, 25 Jun 2026 11:08:14 -0400 Subject: [PATCH 1/5] initial openapi generation --- .DS_Store | Bin 0 -> 6148 bytes .gitignore | 38 +- .openapi-generator-ignore | 23 + .openapi-generator/FILES | 266 +++++ .openapi-generator/VERSION | 1 + .rspec | 2 + Gemfile | 10 +- Gemfile.lock | 63 -- LICENSE | 2 +- README.md | 307 +++--- Rakefile | 10 + bin/console | 8 - bin/publish | 5 - docs/AccountsApi.md | 358 +++++++ docs/ActionTypesApi.md | 497 ++++++++++ docs/ActionsApi.md | 475 +++++++++ docs/AppConnectionsApi.md | 371 +++++++ docs/AvailableAppsApi.md | 145 +++ docs/CatchHookRequest.md | 18 + docs/CreateActionType422Response.md | 22 + docs/CreateActionTypeRequest.md | 50 + docs/CreateActionTypeRequestFormDraftInner.md | 32 + docs/CreateActionTypeRequestIconDraft.md | 22 + docs/CreateAppConnectionRequest.md | 24 + docs/CreateUserToken200Response.md | 18 + docs/CreateUserTokenRequest.md | 20 + docs/CreateWorkflow201Response.md | 92 ++ docs/CreateWorkflowRequest.md | 32 + docs/CreateWorkflowRequestTemplateDraft.md | 20 + ...eWorkflowRequestTemplateDraftNodesInner.md | 48 + docs/DataFieldsApi.md | 233 +++++ docs/DeleteActionType200Response.md | 18 + docs/DeleteWorkflow200Response.md | 49 + docs/DeleteWorkflow200ResponseOneOf.md | 18 + docs/DeleteWorkflow200ResponseOneOf1.md | 18 + docs/DiscardWorkflowDraftRequest.md | 20 + docs/EvaluateExpression200Response.md | 18 + docs/EvaluateExpressionRequest.md | 20 + docs/EventsApi.md | 81 ++ docs/ExecuteWorkflow201Response.md | 50 + docs/ExecuteWorkflowRequest.md | 22 + docs/ExecutionsApi.md | 225 +++++ docs/ExportConfiguration200Response.md | 18 + ...rtConfiguration200ResponseConfiguration.md | 49 + docs/ImportConfiguration201Response.md | 28 + docs/ImportConfigurationRequest.md | 20 + docs/ImportConfigurationRequestSchema.md | 49 + docs/InstallApp201Response.md | 50 + docs/InstallAppRequest.md | 20 + docs/InstalledAppsApi.md | 282 ++++++ docs/ListActionTypes200Response.md | 20 + ...stActionTypes200ResponseCollectionInner.md | 106 ++ docs/ListActionTypes200ResponseMeta.md | 22 + docs/ListActions200Response.md | 20 + docs/ListActions200ResponseCollectionInner.md | 58 ++ docs/ListAppConnections200Response.md | 20 + ...ppConnections200ResponseCollectionInner.md | 32 + docs/ListAvailableApps200Response.md | 20 + ...AvailableApps200ResponseCollectionInner.md | 32 + docs/ListDataFields200Response.md | 20 + ...istDataFields200ResponseCollectionInner.md | 46 + docs/ListDataFieldsTypeParameter.md | 49 + docs/ListEvents200Response.md | 20 + docs/ListEvents200ResponseCollectionInner.md | 36 + docs/ListInstalledApps200Response.md | 20 + ...InstalledApps200ResponseCollectionInner.md | 48 + docs/ListTriggers200Response.md | 20 + .../ListTriggers200ResponseCollectionInner.md | 50 + docs/ListUsers200Response.md | 20 + docs/ListUsers200ResponseCollectionInner.md | 38 + docs/ListWorkflowExecutions200Response.md | 20 + docs/ListWorkflowVersions200Response.md | 20 + ...kflowVersions200ResponseCollectionInner.md | 30 + docs/ListWorkflows200Response.md | 20 + ...ListWorkflows200ResponseCollectionInner.md | 76 ++ docs/PaymentsApi.md | 81 ++ docs/PublishWorkflowRequest.md | 18 + docs/RetrieveAccount200Response.md | 46 + docs/RetrieveAccountUsage200Response.md | 30 + docs/RetrieveAvailableApp200Response.md | 34 + docs/RetrieveExecution200Response.md | 54 + docs/RetryActionRequest.md | 20 + docs/StopExecutionsRequest.md | 20 + docs/TriggerWorkflowRequest.md | 26 + docs/TriggersApi.md | 289 ++++++ docs/UpdateAccountRequest.md | 38 + ...AccountRequestActionTypeCategoriesInner.md | 24 + ...untRequestActionTypeCategoriesInnerIcon.md | 22 + ...UpdateAccountRequestUserDataSchemaInner.md | 26 + docs/UpdateActionTypeRequest.md | 52 + docs/UpdateInstalledAppRequest.md | 18 + docs/UpdateTriggerRequest.md | 20 + docs/UpdateWorkflowRequest.md | 38 + docs/UpsertUserRequest.md | 26 + docs/UsersApi.md | 361 +++++++ docs/WorkflowsApi.md | 892 +++++++++++++++++ embed_workflow.gemspec | 62 +- lib/embed_workflow.rb | 273 +++++- lib/embed_workflow/actions.rb | 19 - lib/embed_workflow/api/accounts_api.rb | 364 +++++++ lib/embed_workflow/api/action_types_api.rb | 531 ++++++++++ lib/embed_workflow/api/actions_api.rb | 468 +++++++++ lib/embed_workflow/api/app_connections_api.rb | 368 +++++++ lib/embed_workflow/api/available_apps_api.rb | 141 +++ lib/embed_workflow/api/data_fields_api.rb | 232 +++++ lib/embed_workflow/api/events_api.rb | 86 ++ lib/embed_workflow/api/executions_api.rb | 225 +++++ lib/embed_workflow/api/installed_apps_api.rb | 276 ++++++ lib/embed_workflow/api/payments_api.rb | 86 ++ lib/embed_workflow/api/triggers_api.rb | 281 ++++++ lib/embed_workflow/api/users_api.rb | 359 +++++++ lib/embed_workflow/api/workflows_api.rb | 926 ++++++++++++++++++ lib/embed_workflow/api_client.rb | 431 ++++++++ lib/embed_workflow/api_error.rb | 58 ++ lib/embed_workflow/app_connections.rb | 75 -- lib/embed_workflow/base.rb | 19 - lib/embed_workflow/catch_hook.rb | 24 - lib/embed_workflow/client.rb | 128 --- lib/embed_workflow/configuration.rb | 389 ++++++++ lib/embed_workflow/errors.rb | 17 - lib/embed_workflow/executions.rb | 28 - .../models/catch_hook_request.rb | 222 +++++ .../models/create_action_type422_response.rb | 256 +++++ .../models/create_action_type_request.rb | 388 ++++++++ ...te_action_type_request_form_draft_inner.rb | 342 +++++++ .../create_action_type_request_icon_draft.rb | 245 +++++ .../models/create_app_connection_request.rb | 273 ++++++ .../models/create_user_token200_response.rb | 222 +++++ .../models/create_user_token_request.rb | 227 +++++ .../models/create_workflow201_response.rb | 660 +++++++++++++ .../models/create_workflow_request.rb | 295 ++++++ .../create_workflow_request_template_draft.rb | 244 +++++ ...flow_request_template_draft_nodes_inner.rb | 431 ++++++++ .../models/delete_action_type200_response.rb | 222 +++++ .../models/delete_workflow200_response.rb | 106 ++ .../delete_workflow200_response_one_of.rb | 223 +++++ .../delete_workflow200_response_one_of1.rb | 223 +++++ .../models/discard_workflow_draft_request.rb | 229 +++++ .../models/evaluate_expression200_response.rb | 214 ++++ .../models/evaluate_expression_request.rb | 241 +++++ .../models/execute_workflow201_response.rb | 383 ++++++++ .../models/execute_workflow_request.rb | 275 ++++++ .../export_configuration200_response.rb | 214 ++++ ...configuration200_response_configuration.rb | 105 ++ .../import_configuration201_response.rb | 275 ++++++ .../models/import_configuration_request.rb | 259 +++++ .../import_configuration_request_schema.rb | 106 ++ .../models/install_app201_response.rb | 388 ++++++++ .../models/install_app_request.rb | 234 +++++ .../models/list_action_types200_response.rb | 239 +++++ ...tion_types200_response_collection_inner.rb | 755 ++++++++++++++ .../list_action_types200_response_meta.rb | 233 +++++ .../models/list_actions200_response.rb | 239 +++++ ...st_actions200_response_collection_inner.rb | 429 ++++++++ .../list_app_connections200_response.rb | 239 +++++ ...onnections200_response_collection_inner.rb | 288 ++++++ .../models/list_available_apps200_response.rb | 239 +++++ ...lable_apps200_response_collection_inner.rb | 287 ++++++ .../models/list_data_fields200_response.rb | 239 +++++ ...ata_fields200_response_collection_inner.rb | 369 +++++++ .../models/list_data_fields_type_parameter.rb | 105 ++ .../models/list_events200_response.rb | 239 +++++ ...ist_events200_response_collection_inner.rb | 312 ++++++ .../models/list_installed_apps200_response.rb | 239 +++++ ...alled_apps200_response_collection_inner.rb | 376 +++++++ .../models/list_triggers200_response.rb | 239 +++++ ...t_triggers200_response_collection_inner.rb | 387 ++++++++ .../models/list_users200_response.rb | 239 +++++ ...list_users200_response_collection_inner.rb | 326 ++++++ .../list_workflow_executions200_response.rb | 239 +++++ .../list_workflow_versions200_response.rb | 239 +++++ ...w_versions200_response_collection_inner.rb | 278 ++++++ .../models/list_workflows200_response.rb | 239 +++++ ..._workflows200_response_collection_inner.rb | 562 +++++++++++ .../models/publish_workflow_request.rb | 217 ++++ .../models/retrieve_account200_response.rb | 371 +++++++ .../retrieve_account_usage200_response.rb | 275 ++++++ .../retrieve_available_app200_response.rb | 299 ++++++ .../models/retrieve_execution200_response.rb | 405 ++++++++ .../models/retry_action_request.rb | 239 +++++ .../models/stop_executions_request.rb | 232 +++++ .../models/trigger_workflow_request.rb | 263 +++++ .../models/update_account_request.rb | 327 +++++++ ...nt_request_action_type_categories_inner.rb | 258 +++++ ...quest_action_type_categories_inner_icon.rb | 233 +++++ ..._account_request_user_data_schema_inner.rb | 271 +++++ .../models/update_action_type_request.rb | 384 ++++++++ .../models/update_installed_app_request.rb | 217 ++++ .../models/update_trigger_request.rb | 225 +++++ .../models/update_workflow_request.rb | 329 +++++++ .../models/upsert_user_request.rb | 259 +++++ lib/embed_workflow/trigger.rb | 31 - lib/embed_workflow/users.rb | 52 - lib/embed_workflow/version.rb | 14 +- lib/embed_workflow/workflows.rb | 107 -- spec/.DS_Store | Bin 0 -> 6148 bytes spec/api/accounts_api_spec.rb | 92 ++ spec/api/action_types_api_spec.rb | 116 +++ spec/api/actions_api_spec.rb | 125 +++ spec/api/app_connections_api_spec.rb | 97 ++ spec/api/available_apps_api_spec.rb | 57 ++ spec/api/data_fields_api_spec.rb | 76 ++ spec/api/events_api_spec.rb | 48 + spec/api/executions_api_spec.rb | 72 ++ spec/api/installed_apps_api_spec.rb | 79 ++ spec/api/payments_api_spec.rb | 48 + spec/api/triggers_api_spec.rb | 82 ++ spec/api/users_api_spec.rb | 94 ++ spec/api/workflows_api_spec.rb | 190 ++++ spec/app_connections_spec.rb | 168 ---- spec/models/catch_hook_request_spec.rb | 36 + .../create_action_type422_response_spec.rb | 48 + ...tion_type_request_form_draft_inner_spec.rb | 82 ++ ...ate_action_type_request_icon_draft_spec.rb | 48 + .../models/create_action_type_request_spec.rb | 126 +++ .../create_app_connection_request_spec.rb | 54 + .../create_user_token200_response_spec.rb | 36 + spec/models/create_user_token_request_spec.rb | 42 + .../create_workflow201_response_spec.rb | 266 +++++ spec/models/create_workflow_request_spec.rb | 78 ++ ...request_template_draft_nodes_inner_spec.rb | 134 +++ ...te_workflow_request_template_draft_spec.rb | 42 + .../delete_action_type200_response_spec.rb | 36 + ...elete_workflow200_response_one_of1_spec.rb | 36 + ...delete_workflow200_response_one_of_spec.rb | 36 + .../delete_workflow200_response_spec.rb | 32 + .../discard_workflow_draft_request_spec.rb | 42 + .../evaluate_expression200_response_spec.rb | 36 + .../evaluate_expression_request_spec.rb | 42 + .../execute_workflow201_response_spec.rb | 132 +++ spec/models/execute_workflow_request_spec.rb | 52 + ...guration200_response_configuration_spec.rb | 32 + .../export_configuration200_response_spec.rb | 36 + .../import_configuration201_response_spec.rb | 66 ++ ...mport_configuration_request_schema_spec.rb | 32 + .../import_configuration_request_spec.rb | 46 + spec/models/install_app201_response_spec.rb | 132 +++ spec/models/install_app_request_spec.rb | 42 + ...types200_response_collection_inner_spec.rb | 312 ++++++ ...list_action_types200_response_meta_spec.rb | 48 + .../list_action_types200_response_spec.rb | 42 + ...tions200_response_collection_inner_spec.rb | 156 +++ spec/models/list_actions200_response_spec.rb | 42 + ...tions200_response_collection_inner_spec.rb | 78 ++ .../list_app_connections200_response_spec.rb | 42 + ..._apps200_response_collection_inner_spec.rb | 78 ++ .../list_available_apps200_response_spec.rb | 42 + ...ields200_response_collection_inner_spec.rb | 120 +++ .../list_data_fields200_response_spec.rb | 42 + .../list_data_fields_type_parameter_spec.rb | 32 + ...vents200_response_collection_inner_spec.rb | 90 ++ spec/models/list_events200_response_spec.rb | 42 + ..._apps200_response_collection_inner_spec.rb | 126 +++ .../list_installed_apps200_response_spec.rb | 42 + ...ggers200_response_collection_inner_spec.rb | 132 +++ spec/models/list_triggers200_response_spec.rb | 42 + ...users200_response_collection_inner_spec.rb | 96 ++ spec/models/list_users200_response_spec.rb | 42 + ...st_workflow_executions200_response_spec.rb | 42 + ...sions200_response_collection_inner_spec.rb | 72 ++ ...list_workflow_versions200_response_spec.rb | 42 + ...flows200_response_collection_inner_spec.rb | 214 ++++ .../models/list_workflows200_response_spec.rb | 42 + spec/models/publish_workflow_request_spec.rb | 36 + .../retrieve_account200_response_spec.rb | 120 +++ ...retrieve_account_usage200_response_spec.rb | 72 ++ ...retrieve_available_app200_response_spec.rb | 84 ++ .../retrieve_execution200_response_spec.rb | 144 +++ spec/models/retry_action_request_spec.rb | 42 + spec/models/stop_executions_request_spec.rb | 42 + spec/models/trigger_workflow_request_spec.rb | 60 ++ ..._action_type_categories_inner_icon_spec.rb | 48 + ...quest_action_type_categories_inner_spec.rb | 54 + spec/models/update_account_request_spec.rb | 96 ++ ...unt_request_user_data_schema_inner_spec.rb | 60 ++ .../models/update_action_type_request_spec.rb | 132 +++ .../update_installed_app_request_spec.rb | 36 + spec/models/update_trigger_request_spec.rb | 42 + spec/models/update_workflow_request_spec.rb | 96 ++ spec/models/upsert_user_request_spec.rb | 60 ++ spec/spec_helper.rb | 111 +++ spec/users_spec.rb | 165 ---- spec/workflows_spec.rb | 64 -- 283 files changed, 38797 insertions(+), 1207 deletions(-) create mode 100644 .DS_Store create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION create mode 100644 .rspec delete mode 100644 Gemfile.lock create mode 100644 Rakefile delete mode 100755 bin/console delete mode 100755 bin/publish create mode 100644 docs/AccountsApi.md create mode 100644 docs/ActionTypesApi.md create mode 100644 docs/ActionsApi.md create mode 100644 docs/AppConnectionsApi.md create mode 100644 docs/AvailableAppsApi.md create mode 100644 docs/CatchHookRequest.md create mode 100644 docs/CreateActionType422Response.md create mode 100644 docs/CreateActionTypeRequest.md create mode 100644 docs/CreateActionTypeRequestFormDraftInner.md create mode 100644 docs/CreateActionTypeRequestIconDraft.md create mode 100644 docs/CreateAppConnectionRequest.md create mode 100644 docs/CreateUserToken200Response.md create mode 100644 docs/CreateUserTokenRequest.md create mode 100644 docs/CreateWorkflow201Response.md create mode 100644 docs/CreateWorkflowRequest.md create mode 100644 docs/CreateWorkflowRequestTemplateDraft.md create mode 100644 docs/CreateWorkflowRequestTemplateDraftNodesInner.md create mode 100644 docs/DataFieldsApi.md create mode 100644 docs/DeleteActionType200Response.md create mode 100644 docs/DeleteWorkflow200Response.md create mode 100644 docs/DeleteWorkflow200ResponseOneOf.md create mode 100644 docs/DeleteWorkflow200ResponseOneOf1.md create mode 100644 docs/DiscardWorkflowDraftRequest.md create mode 100644 docs/EvaluateExpression200Response.md create mode 100644 docs/EvaluateExpressionRequest.md create mode 100644 docs/EventsApi.md create mode 100644 docs/ExecuteWorkflow201Response.md create mode 100644 docs/ExecuteWorkflowRequest.md create mode 100644 docs/ExecutionsApi.md create mode 100644 docs/ExportConfiguration200Response.md create mode 100644 docs/ExportConfiguration200ResponseConfiguration.md create mode 100644 docs/ImportConfiguration201Response.md create mode 100644 docs/ImportConfigurationRequest.md create mode 100644 docs/ImportConfigurationRequestSchema.md create mode 100644 docs/InstallApp201Response.md create mode 100644 docs/InstallAppRequest.md create mode 100644 docs/InstalledAppsApi.md create mode 100644 docs/ListActionTypes200Response.md create mode 100644 docs/ListActionTypes200ResponseCollectionInner.md create mode 100644 docs/ListActionTypes200ResponseMeta.md create mode 100644 docs/ListActions200Response.md create mode 100644 docs/ListActions200ResponseCollectionInner.md create mode 100644 docs/ListAppConnections200Response.md create mode 100644 docs/ListAppConnections200ResponseCollectionInner.md create mode 100644 docs/ListAvailableApps200Response.md create mode 100644 docs/ListAvailableApps200ResponseCollectionInner.md create mode 100644 docs/ListDataFields200Response.md create mode 100644 docs/ListDataFields200ResponseCollectionInner.md create mode 100644 docs/ListDataFieldsTypeParameter.md create mode 100644 docs/ListEvents200Response.md create mode 100644 docs/ListEvents200ResponseCollectionInner.md create mode 100644 docs/ListInstalledApps200Response.md create mode 100644 docs/ListInstalledApps200ResponseCollectionInner.md create mode 100644 docs/ListTriggers200Response.md create mode 100644 docs/ListTriggers200ResponseCollectionInner.md create mode 100644 docs/ListUsers200Response.md create mode 100644 docs/ListUsers200ResponseCollectionInner.md create mode 100644 docs/ListWorkflowExecutions200Response.md create mode 100644 docs/ListWorkflowVersions200Response.md create mode 100644 docs/ListWorkflowVersions200ResponseCollectionInner.md create mode 100644 docs/ListWorkflows200Response.md create mode 100644 docs/ListWorkflows200ResponseCollectionInner.md create mode 100644 docs/PaymentsApi.md create mode 100644 docs/PublishWorkflowRequest.md create mode 100644 docs/RetrieveAccount200Response.md create mode 100644 docs/RetrieveAccountUsage200Response.md create mode 100644 docs/RetrieveAvailableApp200Response.md create mode 100644 docs/RetrieveExecution200Response.md create mode 100644 docs/RetryActionRequest.md create mode 100644 docs/StopExecutionsRequest.md create mode 100644 docs/TriggerWorkflowRequest.md create mode 100644 docs/TriggersApi.md create mode 100644 docs/UpdateAccountRequest.md create mode 100644 docs/UpdateAccountRequestActionTypeCategoriesInner.md create mode 100644 docs/UpdateAccountRequestActionTypeCategoriesInnerIcon.md create mode 100644 docs/UpdateAccountRequestUserDataSchemaInner.md create mode 100644 docs/UpdateActionTypeRequest.md create mode 100644 docs/UpdateInstalledAppRequest.md create mode 100644 docs/UpdateTriggerRequest.md create mode 100644 docs/UpdateWorkflowRequest.md create mode 100644 docs/UpsertUserRequest.md create mode 100644 docs/UsersApi.md create mode 100644 docs/WorkflowsApi.md delete mode 100644 lib/embed_workflow/actions.rb create mode 100644 lib/embed_workflow/api/accounts_api.rb create mode 100644 lib/embed_workflow/api/action_types_api.rb create mode 100644 lib/embed_workflow/api/actions_api.rb create mode 100644 lib/embed_workflow/api/app_connections_api.rb create mode 100644 lib/embed_workflow/api/available_apps_api.rb create mode 100644 lib/embed_workflow/api/data_fields_api.rb create mode 100644 lib/embed_workflow/api/events_api.rb create mode 100644 lib/embed_workflow/api/executions_api.rb create mode 100644 lib/embed_workflow/api/installed_apps_api.rb create mode 100644 lib/embed_workflow/api/payments_api.rb create mode 100644 lib/embed_workflow/api/triggers_api.rb create mode 100644 lib/embed_workflow/api/users_api.rb create mode 100644 lib/embed_workflow/api/workflows_api.rb create mode 100644 lib/embed_workflow/api_client.rb create mode 100644 lib/embed_workflow/api_error.rb delete mode 100644 lib/embed_workflow/app_connections.rb delete mode 100644 lib/embed_workflow/base.rb delete mode 100644 lib/embed_workflow/catch_hook.rb delete mode 100644 lib/embed_workflow/client.rb create mode 100644 lib/embed_workflow/configuration.rb delete mode 100644 lib/embed_workflow/errors.rb delete mode 100644 lib/embed_workflow/executions.rb create mode 100644 lib/embed_workflow/models/catch_hook_request.rb create mode 100644 lib/embed_workflow/models/create_action_type422_response.rb create mode 100644 lib/embed_workflow/models/create_action_type_request.rb create mode 100644 lib/embed_workflow/models/create_action_type_request_form_draft_inner.rb create mode 100644 lib/embed_workflow/models/create_action_type_request_icon_draft.rb create mode 100644 lib/embed_workflow/models/create_app_connection_request.rb create mode 100644 lib/embed_workflow/models/create_user_token200_response.rb create mode 100644 lib/embed_workflow/models/create_user_token_request.rb create mode 100644 lib/embed_workflow/models/create_workflow201_response.rb create mode 100644 lib/embed_workflow/models/create_workflow_request.rb create mode 100644 lib/embed_workflow/models/create_workflow_request_template_draft.rb create mode 100644 lib/embed_workflow/models/create_workflow_request_template_draft_nodes_inner.rb create mode 100644 lib/embed_workflow/models/delete_action_type200_response.rb create mode 100644 lib/embed_workflow/models/delete_workflow200_response.rb create mode 100644 lib/embed_workflow/models/delete_workflow200_response_one_of.rb create mode 100644 lib/embed_workflow/models/delete_workflow200_response_one_of1.rb create mode 100644 lib/embed_workflow/models/discard_workflow_draft_request.rb create mode 100644 lib/embed_workflow/models/evaluate_expression200_response.rb create mode 100644 lib/embed_workflow/models/evaluate_expression_request.rb create mode 100644 lib/embed_workflow/models/execute_workflow201_response.rb create mode 100644 lib/embed_workflow/models/execute_workflow_request.rb create mode 100644 lib/embed_workflow/models/export_configuration200_response.rb create mode 100644 lib/embed_workflow/models/export_configuration200_response_configuration.rb create mode 100644 lib/embed_workflow/models/import_configuration201_response.rb create mode 100644 lib/embed_workflow/models/import_configuration_request.rb create mode 100644 lib/embed_workflow/models/import_configuration_request_schema.rb create mode 100644 lib/embed_workflow/models/install_app201_response.rb create mode 100644 lib/embed_workflow/models/install_app_request.rb create mode 100644 lib/embed_workflow/models/list_action_types200_response.rb create mode 100644 lib/embed_workflow/models/list_action_types200_response_collection_inner.rb create mode 100644 lib/embed_workflow/models/list_action_types200_response_meta.rb create mode 100644 lib/embed_workflow/models/list_actions200_response.rb create mode 100644 lib/embed_workflow/models/list_actions200_response_collection_inner.rb create mode 100644 lib/embed_workflow/models/list_app_connections200_response.rb create mode 100644 lib/embed_workflow/models/list_app_connections200_response_collection_inner.rb create mode 100644 lib/embed_workflow/models/list_available_apps200_response.rb create mode 100644 lib/embed_workflow/models/list_available_apps200_response_collection_inner.rb create mode 100644 lib/embed_workflow/models/list_data_fields200_response.rb create mode 100644 lib/embed_workflow/models/list_data_fields200_response_collection_inner.rb create mode 100644 lib/embed_workflow/models/list_data_fields_type_parameter.rb create mode 100644 lib/embed_workflow/models/list_events200_response.rb create mode 100644 lib/embed_workflow/models/list_events200_response_collection_inner.rb create mode 100644 lib/embed_workflow/models/list_installed_apps200_response.rb create mode 100644 lib/embed_workflow/models/list_installed_apps200_response_collection_inner.rb create mode 100644 lib/embed_workflow/models/list_triggers200_response.rb create mode 100644 lib/embed_workflow/models/list_triggers200_response_collection_inner.rb create mode 100644 lib/embed_workflow/models/list_users200_response.rb create mode 100644 lib/embed_workflow/models/list_users200_response_collection_inner.rb create mode 100644 lib/embed_workflow/models/list_workflow_executions200_response.rb create mode 100644 lib/embed_workflow/models/list_workflow_versions200_response.rb create mode 100644 lib/embed_workflow/models/list_workflow_versions200_response_collection_inner.rb create mode 100644 lib/embed_workflow/models/list_workflows200_response.rb create mode 100644 lib/embed_workflow/models/list_workflows200_response_collection_inner.rb create mode 100644 lib/embed_workflow/models/publish_workflow_request.rb create mode 100644 lib/embed_workflow/models/retrieve_account200_response.rb create mode 100644 lib/embed_workflow/models/retrieve_account_usage200_response.rb create mode 100644 lib/embed_workflow/models/retrieve_available_app200_response.rb create mode 100644 lib/embed_workflow/models/retrieve_execution200_response.rb create mode 100644 lib/embed_workflow/models/retry_action_request.rb create mode 100644 lib/embed_workflow/models/stop_executions_request.rb create mode 100644 lib/embed_workflow/models/trigger_workflow_request.rb create mode 100644 lib/embed_workflow/models/update_account_request.rb create mode 100644 lib/embed_workflow/models/update_account_request_action_type_categories_inner.rb create mode 100644 lib/embed_workflow/models/update_account_request_action_type_categories_inner_icon.rb create mode 100644 lib/embed_workflow/models/update_account_request_user_data_schema_inner.rb create mode 100644 lib/embed_workflow/models/update_action_type_request.rb create mode 100644 lib/embed_workflow/models/update_installed_app_request.rb create mode 100644 lib/embed_workflow/models/update_trigger_request.rb create mode 100644 lib/embed_workflow/models/update_workflow_request.rb create mode 100644 lib/embed_workflow/models/upsert_user_request.rb delete mode 100644 lib/embed_workflow/trigger.rb delete mode 100644 lib/embed_workflow/users.rb delete mode 100644 lib/embed_workflow/workflows.rb create mode 100644 spec/.DS_Store create mode 100644 spec/api/accounts_api_spec.rb create mode 100644 spec/api/action_types_api_spec.rb create mode 100644 spec/api/actions_api_spec.rb create mode 100644 spec/api/app_connections_api_spec.rb create mode 100644 spec/api/available_apps_api_spec.rb create mode 100644 spec/api/data_fields_api_spec.rb create mode 100644 spec/api/events_api_spec.rb create mode 100644 spec/api/executions_api_spec.rb create mode 100644 spec/api/installed_apps_api_spec.rb create mode 100644 spec/api/payments_api_spec.rb create mode 100644 spec/api/triggers_api_spec.rb create mode 100644 spec/api/users_api_spec.rb create mode 100644 spec/api/workflows_api_spec.rb delete mode 100644 spec/app_connections_spec.rb create mode 100644 spec/models/catch_hook_request_spec.rb create mode 100644 spec/models/create_action_type422_response_spec.rb create mode 100644 spec/models/create_action_type_request_form_draft_inner_spec.rb create mode 100644 spec/models/create_action_type_request_icon_draft_spec.rb create mode 100644 spec/models/create_action_type_request_spec.rb create mode 100644 spec/models/create_app_connection_request_spec.rb create mode 100644 spec/models/create_user_token200_response_spec.rb create mode 100644 spec/models/create_user_token_request_spec.rb create mode 100644 spec/models/create_workflow201_response_spec.rb create mode 100644 spec/models/create_workflow_request_spec.rb create mode 100644 spec/models/create_workflow_request_template_draft_nodes_inner_spec.rb create mode 100644 spec/models/create_workflow_request_template_draft_spec.rb create mode 100644 spec/models/delete_action_type200_response_spec.rb create mode 100644 spec/models/delete_workflow200_response_one_of1_spec.rb create mode 100644 spec/models/delete_workflow200_response_one_of_spec.rb create mode 100644 spec/models/delete_workflow200_response_spec.rb create mode 100644 spec/models/discard_workflow_draft_request_spec.rb create mode 100644 spec/models/evaluate_expression200_response_spec.rb create mode 100644 spec/models/evaluate_expression_request_spec.rb create mode 100644 spec/models/execute_workflow201_response_spec.rb create mode 100644 spec/models/execute_workflow_request_spec.rb create mode 100644 spec/models/export_configuration200_response_configuration_spec.rb create mode 100644 spec/models/export_configuration200_response_spec.rb create mode 100644 spec/models/import_configuration201_response_spec.rb create mode 100644 spec/models/import_configuration_request_schema_spec.rb create mode 100644 spec/models/import_configuration_request_spec.rb create mode 100644 spec/models/install_app201_response_spec.rb create mode 100644 spec/models/install_app_request_spec.rb create mode 100644 spec/models/list_action_types200_response_collection_inner_spec.rb create mode 100644 spec/models/list_action_types200_response_meta_spec.rb create mode 100644 spec/models/list_action_types200_response_spec.rb create mode 100644 spec/models/list_actions200_response_collection_inner_spec.rb create mode 100644 spec/models/list_actions200_response_spec.rb create mode 100644 spec/models/list_app_connections200_response_collection_inner_spec.rb create mode 100644 spec/models/list_app_connections200_response_spec.rb create mode 100644 spec/models/list_available_apps200_response_collection_inner_spec.rb create mode 100644 spec/models/list_available_apps200_response_spec.rb create mode 100644 spec/models/list_data_fields200_response_collection_inner_spec.rb create mode 100644 spec/models/list_data_fields200_response_spec.rb create mode 100644 spec/models/list_data_fields_type_parameter_spec.rb create mode 100644 spec/models/list_events200_response_collection_inner_spec.rb create mode 100644 spec/models/list_events200_response_spec.rb create mode 100644 spec/models/list_installed_apps200_response_collection_inner_spec.rb create mode 100644 spec/models/list_installed_apps200_response_spec.rb create mode 100644 spec/models/list_triggers200_response_collection_inner_spec.rb create mode 100644 spec/models/list_triggers200_response_spec.rb create mode 100644 spec/models/list_users200_response_collection_inner_spec.rb create mode 100644 spec/models/list_users200_response_spec.rb create mode 100644 spec/models/list_workflow_executions200_response_spec.rb create mode 100644 spec/models/list_workflow_versions200_response_collection_inner_spec.rb create mode 100644 spec/models/list_workflow_versions200_response_spec.rb create mode 100644 spec/models/list_workflows200_response_collection_inner_spec.rb create mode 100644 spec/models/list_workflows200_response_spec.rb create mode 100644 spec/models/publish_workflow_request_spec.rb create mode 100644 spec/models/retrieve_account200_response_spec.rb create mode 100644 spec/models/retrieve_account_usage200_response_spec.rb create mode 100644 spec/models/retrieve_available_app200_response_spec.rb create mode 100644 spec/models/retrieve_execution200_response_spec.rb create mode 100644 spec/models/retry_action_request_spec.rb create mode 100644 spec/models/stop_executions_request_spec.rb create mode 100644 spec/models/trigger_workflow_request_spec.rb create mode 100644 spec/models/update_account_request_action_type_categories_inner_icon_spec.rb create mode 100644 spec/models/update_account_request_action_type_categories_inner_spec.rb create mode 100644 spec/models/update_account_request_spec.rb create mode 100644 spec/models/update_account_request_user_data_schema_inner_spec.rb create mode 100644 spec/models/update_action_type_request_spec.rb create mode 100644 spec/models/update_installed_app_request_spec.rb create mode 100644 spec/models/update_trigger_request_spec.rb create mode 100644 spec/models/update_workflow_request_spec.rb create mode 100644 spec/models/upsert_user_request_spec.rb create mode 100644 spec/spec_helper.rb delete mode 100644 spec/users_spec.rb delete mode 100644 spec/workflows_spec.rb diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a3115c08d32c1fe8648c02895c010f17fbb8b140 GIT binary patch literal 6148 zcmeHKzl#$=7=4qhm-quY8?jK>$}(`^9}v$Ca-brYKR``3mjpL#@I0=t*Gt0{d zvE&mWMUEj3_p*Fw=PDmYnP=yhHleL~UdB!J-u1b;zJ0T}F<$Cr$8fW(^LzPieUNc4 zV}uz7tW!L|F>`%_$2dU7r(><9_zy8BV_2HQ3FF;4v~XMZcEEMdF!I^zT8Z5xXNp0I z^}L?tsdC}uD_J())#Uq^l_o3idflpCPmhZWcFO&82Ya}M9`2!!UMahuWVkbKV;_&G z*NBSM%(*cx@z0XqoI*mcEtW{b7Y8w_<&ASe(NSScXihnPjMYq2n>KOL;}6@VDASsS0_$ds7a zV%K6}kRF;cp+pm^>=i?qaJI*m*R@y}G~rP8@}ca=%HB|v9-aNinhw=980w%vP{3E9 zX?||Y`QPI^yy5=u2ZdijfuO*DrGSc(ezMCc*|W7WIXP=%mWM22!Yd5w5LWg$)(>(N dUt!TkUn~#AuEoM2TWH~rfR-UtL4m)jz;9;{3}yfT literal 0 HcmV?d00001 diff --git a/.gitignore b/.gitignore index c4bd92c..2b17855 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ +# Generated by: https://openapi-generator.tech +# + *.gem *.rbc -*.DS_Store /.config /coverage/ /InstalledFiles @@ -11,19 +13,10 @@ /test/version_tmp/ /tmp/ -# Used by dotenv library to load environment variables. -# .env - -# Ignore Byebug command history file. -.byebug_history - -## Specific to RubyMotion (use of CocoaPods): -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# vendor/Pods/ +## Specific to RubyMotion: +.dat* +.repl_history +build/ ## Documentation cache and generated files: /.yardoc/ @@ -36,18 +29,11 @@ /vendor/bundle /lib/bundler/man/ -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset +# This is a library/gem, so don't pin development dependencies for downstream +# consumers — let bundler resolve fresh against each project's constraints. +Gemfile.lock +.ruby-version +.ruby-gemset # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: .rvmrc - -# Used by RuboCop. Remote config files pulled in from inherit_from directive. -# .rubocop-https?--* -.env* -!.env.example - -/kb \ No newline at end of file diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..8ff9dae --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,266 @@ +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.rspec +.rubocop.yml +.travis.yml +Gemfile +README.md +Rakefile +docs/AccountsApi.md +docs/ActionTypesApi.md +docs/ActionsApi.md +docs/AppConnectionsApi.md +docs/AvailableAppsApi.md +docs/CatchHookRequest.md +docs/CreateActionType422Response.md +docs/CreateActionTypeRequest.md +docs/CreateActionTypeRequestFormDraftInner.md +docs/CreateActionTypeRequestIconDraft.md +docs/CreateAppConnectionRequest.md +docs/CreateUserToken200Response.md +docs/CreateUserTokenRequest.md +docs/CreateWorkflow201Response.md +docs/CreateWorkflowRequest.md +docs/CreateWorkflowRequestTemplateDraft.md +docs/CreateWorkflowRequestTemplateDraftNodesInner.md +docs/DataFieldsApi.md +docs/DeleteActionType200Response.md +docs/DeleteWorkflow200Response.md +docs/DeleteWorkflow200ResponseOneOf.md +docs/DeleteWorkflow200ResponseOneOf1.md +docs/DiscardWorkflowDraftRequest.md +docs/EvaluateExpression200Response.md +docs/EvaluateExpressionRequest.md +docs/EventsApi.md +docs/ExecuteWorkflow201Response.md +docs/ExecuteWorkflowRequest.md +docs/ExecutionsApi.md +docs/ExportConfiguration200Response.md +docs/ExportConfiguration200ResponseConfiguration.md +docs/ImportConfiguration201Response.md +docs/ImportConfigurationRequest.md +docs/ImportConfigurationRequestSchema.md +docs/InstallApp201Response.md +docs/InstallAppRequest.md +docs/InstalledAppsApi.md +docs/ListActionTypes200Response.md +docs/ListActionTypes200ResponseCollectionInner.md +docs/ListActionTypes200ResponseMeta.md +docs/ListActions200Response.md +docs/ListActions200ResponseCollectionInner.md +docs/ListAppConnections200Response.md +docs/ListAppConnections200ResponseCollectionInner.md +docs/ListAvailableApps200Response.md +docs/ListAvailableApps200ResponseCollectionInner.md +docs/ListDataFields200Response.md +docs/ListDataFields200ResponseCollectionInner.md +docs/ListDataFieldsTypeParameter.md +docs/ListEvents200Response.md +docs/ListEvents200ResponseCollectionInner.md +docs/ListInstalledApps200Response.md +docs/ListInstalledApps200ResponseCollectionInner.md +docs/ListTriggers200Response.md +docs/ListTriggers200ResponseCollectionInner.md +docs/ListUsers200Response.md +docs/ListUsers200ResponseCollectionInner.md +docs/ListWorkflowExecutions200Response.md +docs/ListWorkflowVersions200Response.md +docs/ListWorkflowVersions200ResponseCollectionInner.md +docs/ListWorkflows200Response.md +docs/ListWorkflows200ResponseCollectionInner.md +docs/PaymentsApi.md +docs/PublishWorkflowRequest.md +docs/RetrieveAccount200Response.md +docs/RetrieveAccountUsage200Response.md +docs/RetrieveAvailableApp200Response.md +docs/RetrieveExecution200Response.md +docs/RetryActionRequest.md +docs/StopExecutionsRequest.md +docs/TriggerWorkflowRequest.md +docs/TriggersApi.md +docs/UpdateAccountRequest.md +docs/UpdateAccountRequestActionTypeCategoriesInner.md +docs/UpdateAccountRequestActionTypeCategoriesInnerIcon.md +docs/UpdateAccountRequestUserDataSchemaInner.md +docs/UpdateActionTypeRequest.md +docs/UpdateInstalledAppRequest.md +docs/UpdateTriggerRequest.md +docs/UpdateWorkflowRequest.md +docs/UpsertUserRequest.md +docs/UsersApi.md +docs/WorkflowsApi.md +embed_workflow.gemspec +git_push.sh +lib/embed_workflow.rb +lib/embed_workflow/api/accounts_api.rb +lib/embed_workflow/api/action_types_api.rb +lib/embed_workflow/api/actions_api.rb +lib/embed_workflow/api/app_connections_api.rb +lib/embed_workflow/api/available_apps_api.rb +lib/embed_workflow/api/data_fields_api.rb +lib/embed_workflow/api/events_api.rb +lib/embed_workflow/api/executions_api.rb +lib/embed_workflow/api/installed_apps_api.rb +lib/embed_workflow/api/payments_api.rb +lib/embed_workflow/api/triggers_api.rb +lib/embed_workflow/api/users_api.rb +lib/embed_workflow/api/workflows_api.rb +lib/embed_workflow/api_client.rb +lib/embed_workflow/api_error.rb +lib/embed_workflow/configuration.rb +lib/embed_workflow/models/catch_hook_request.rb +lib/embed_workflow/models/create_action_type422_response.rb +lib/embed_workflow/models/create_action_type_request.rb +lib/embed_workflow/models/create_action_type_request_form_draft_inner.rb +lib/embed_workflow/models/create_action_type_request_icon_draft.rb +lib/embed_workflow/models/create_app_connection_request.rb +lib/embed_workflow/models/create_user_token200_response.rb +lib/embed_workflow/models/create_user_token_request.rb +lib/embed_workflow/models/create_workflow201_response.rb +lib/embed_workflow/models/create_workflow_request.rb +lib/embed_workflow/models/create_workflow_request_template_draft.rb +lib/embed_workflow/models/create_workflow_request_template_draft_nodes_inner.rb +lib/embed_workflow/models/delete_action_type200_response.rb +lib/embed_workflow/models/delete_workflow200_response.rb +lib/embed_workflow/models/delete_workflow200_response_one_of.rb +lib/embed_workflow/models/delete_workflow200_response_one_of1.rb +lib/embed_workflow/models/discard_workflow_draft_request.rb +lib/embed_workflow/models/evaluate_expression200_response.rb +lib/embed_workflow/models/evaluate_expression_request.rb +lib/embed_workflow/models/execute_workflow201_response.rb +lib/embed_workflow/models/execute_workflow_request.rb +lib/embed_workflow/models/export_configuration200_response.rb +lib/embed_workflow/models/export_configuration200_response_configuration.rb +lib/embed_workflow/models/import_configuration201_response.rb +lib/embed_workflow/models/import_configuration_request.rb +lib/embed_workflow/models/import_configuration_request_schema.rb +lib/embed_workflow/models/install_app201_response.rb +lib/embed_workflow/models/install_app_request.rb +lib/embed_workflow/models/list_action_types200_response.rb +lib/embed_workflow/models/list_action_types200_response_collection_inner.rb +lib/embed_workflow/models/list_action_types200_response_meta.rb +lib/embed_workflow/models/list_actions200_response.rb +lib/embed_workflow/models/list_actions200_response_collection_inner.rb +lib/embed_workflow/models/list_app_connections200_response.rb +lib/embed_workflow/models/list_app_connections200_response_collection_inner.rb +lib/embed_workflow/models/list_available_apps200_response.rb +lib/embed_workflow/models/list_available_apps200_response_collection_inner.rb +lib/embed_workflow/models/list_data_fields200_response.rb +lib/embed_workflow/models/list_data_fields200_response_collection_inner.rb +lib/embed_workflow/models/list_data_fields_type_parameter.rb +lib/embed_workflow/models/list_events200_response.rb +lib/embed_workflow/models/list_events200_response_collection_inner.rb +lib/embed_workflow/models/list_installed_apps200_response.rb +lib/embed_workflow/models/list_installed_apps200_response_collection_inner.rb +lib/embed_workflow/models/list_triggers200_response.rb +lib/embed_workflow/models/list_triggers200_response_collection_inner.rb +lib/embed_workflow/models/list_users200_response.rb +lib/embed_workflow/models/list_users200_response_collection_inner.rb +lib/embed_workflow/models/list_workflow_executions200_response.rb +lib/embed_workflow/models/list_workflow_versions200_response.rb +lib/embed_workflow/models/list_workflow_versions200_response_collection_inner.rb +lib/embed_workflow/models/list_workflows200_response.rb +lib/embed_workflow/models/list_workflows200_response_collection_inner.rb +lib/embed_workflow/models/publish_workflow_request.rb +lib/embed_workflow/models/retrieve_account200_response.rb +lib/embed_workflow/models/retrieve_account_usage200_response.rb +lib/embed_workflow/models/retrieve_available_app200_response.rb +lib/embed_workflow/models/retrieve_execution200_response.rb +lib/embed_workflow/models/retry_action_request.rb +lib/embed_workflow/models/stop_executions_request.rb +lib/embed_workflow/models/trigger_workflow_request.rb +lib/embed_workflow/models/update_account_request.rb +lib/embed_workflow/models/update_account_request_action_type_categories_inner.rb +lib/embed_workflow/models/update_account_request_action_type_categories_inner_icon.rb +lib/embed_workflow/models/update_account_request_user_data_schema_inner.rb +lib/embed_workflow/models/update_action_type_request.rb +lib/embed_workflow/models/update_installed_app_request.rb +lib/embed_workflow/models/update_trigger_request.rb +lib/embed_workflow/models/update_workflow_request.rb +lib/embed_workflow/models/upsert_user_request.rb +lib/embed_workflow/version.rb +spec/api/accounts_api_spec.rb +spec/api/action_types_api_spec.rb +spec/api/actions_api_spec.rb +spec/api/app_connections_api_spec.rb +spec/api/available_apps_api_spec.rb +spec/api/data_fields_api_spec.rb +spec/api/events_api_spec.rb +spec/api/executions_api_spec.rb +spec/api/installed_apps_api_spec.rb +spec/api/payments_api_spec.rb +spec/api/triggers_api_spec.rb +spec/api/users_api_spec.rb +spec/api/workflows_api_spec.rb +spec/models/catch_hook_request_spec.rb +spec/models/create_action_type422_response_spec.rb +spec/models/create_action_type_request_form_draft_inner_spec.rb +spec/models/create_action_type_request_icon_draft_spec.rb +spec/models/create_action_type_request_spec.rb +spec/models/create_app_connection_request_spec.rb +spec/models/create_user_token200_response_spec.rb +spec/models/create_user_token_request_spec.rb +spec/models/create_workflow201_response_spec.rb +spec/models/create_workflow_request_spec.rb +spec/models/create_workflow_request_template_draft_nodes_inner_spec.rb +spec/models/create_workflow_request_template_draft_spec.rb +spec/models/delete_action_type200_response_spec.rb +spec/models/delete_workflow200_response_one_of1_spec.rb +spec/models/delete_workflow200_response_one_of_spec.rb +spec/models/delete_workflow200_response_spec.rb +spec/models/discard_workflow_draft_request_spec.rb +spec/models/evaluate_expression200_response_spec.rb +spec/models/evaluate_expression_request_spec.rb +spec/models/execute_workflow201_response_spec.rb +spec/models/execute_workflow_request_spec.rb +spec/models/export_configuration200_response_configuration_spec.rb +spec/models/export_configuration200_response_spec.rb +spec/models/import_configuration201_response_spec.rb +spec/models/import_configuration_request_schema_spec.rb +spec/models/import_configuration_request_spec.rb +spec/models/install_app201_response_spec.rb +spec/models/install_app_request_spec.rb +spec/models/list_action_types200_response_collection_inner_spec.rb +spec/models/list_action_types200_response_meta_spec.rb +spec/models/list_action_types200_response_spec.rb +spec/models/list_actions200_response_collection_inner_spec.rb +spec/models/list_actions200_response_spec.rb +spec/models/list_app_connections200_response_collection_inner_spec.rb +spec/models/list_app_connections200_response_spec.rb +spec/models/list_available_apps200_response_collection_inner_spec.rb +spec/models/list_available_apps200_response_spec.rb +spec/models/list_data_fields200_response_collection_inner_spec.rb +spec/models/list_data_fields200_response_spec.rb +spec/models/list_data_fields_type_parameter_spec.rb +spec/models/list_events200_response_collection_inner_spec.rb +spec/models/list_events200_response_spec.rb +spec/models/list_installed_apps200_response_collection_inner_spec.rb +spec/models/list_installed_apps200_response_spec.rb +spec/models/list_triggers200_response_collection_inner_spec.rb +spec/models/list_triggers200_response_spec.rb +spec/models/list_users200_response_collection_inner_spec.rb +spec/models/list_users200_response_spec.rb +spec/models/list_workflow_executions200_response_spec.rb +spec/models/list_workflow_versions200_response_collection_inner_spec.rb +spec/models/list_workflow_versions200_response_spec.rb +spec/models/list_workflows200_response_collection_inner_spec.rb +spec/models/list_workflows200_response_spec.rb +spec/models/publish_workflow_request_spec.rb +spec/models/retrieve_account200_response_spec.rb +spec/models/retrieve_account_usage200_response_spec.rb +spec/models/retrieve_available_app200_response_spec.rb +spec/models/retrieve_execution200_response_spec.rb +spec/models/retry_action_request_spec.rb +spec/models/stop_executions_request_spec.rb +spec/models/trigger_workflow_request_spec.rb +spec/models/update_account_request_action_type_categories_inner_icon_spec.rb +spec/models/update_account_request_action_type_categories_inner_spec.rb +spec/models/update_account_request_spec.rb +spec/models/update_account_request_user_data_schema_inner_spec.rb +spec/models/update_action_type_request_spec.rb +spec/models/update_installed_app_request_spec.rb +spec/models/update_trigger_request_spec.rb +spec/models/update_workflow_request_spec.rb +spec/models/upsert_user_request_spec.rb +spec/spec_helper.rb diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..4b49d9b --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.2.0 \ No newline at end of file diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..83e16f8 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/Gemfile b/Gemfile index ee80a23..c2e3127 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,9 @@ -# frozen_string_literal: true - -source "https://rubygems.org" +source 'https://rubygems.org' gemspec -group :test do - gem "rspec", "~> 3.11" +group :development, :test do + gem 'rake', '~> 13.0.1' + gem 'pry-byebug' + gem 'rubocop', '~> 0.66.0' end diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index f7669fd..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,63 +0,0 @@ -PATH - remote: . - specs: - embed_workflow (0.3.0) - -GEM - remote: https://rubygems.org/ - specs: - ast (2.4.2) - diff-lcs (1.5.0) - parallel (1.20.1) - parser (3.0.2.0) - ast (~> 2.4.1) - rainbow (3.0.0) - rake (13.0.6) - regexp_parser (2.1.1) - rexml (3.4.2) - rspec (3.11.0) - rspec-core (~> 3.11.0) - rspec-expectations (~> 3.11.0) - rspec-mocks (~> 3.11.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-mocks (3.11.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-support (3.11.0) - rubocop (1.18.4) - parallel (~> 1.10) - parser (>= 3.0.0.0) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.8.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.10.0) - parser (>= 3.0.1.1) - rubocop-performance (1.11.4) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) - standard (1.1.7) - rubocop (= 1.18.4) - rubocop-performance (= 1.11.4) - unicode-display_width (2.0.0) - -PLATFORMS - ruby - x86_64-darwin-19 - -DEPENDENCIES - bundler (>= 2.0.1) - embed_workflow! - rake - rspec (~> 3.11) - standard - -BUNDLED WITH - 2.4.22 diff --git a/LICENSE b/LICENSE index f142823..deee8e5 100644 --- a/LICENSE +++ b/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/README.md b/README.md index fed8ea2..2c71aa7 100644 --- a/README.md +++ b/README.md @@ -1,218 +1,235 @@ -# Embed Workflow Ruby Library +# EmbedWorkflow Ruby SDK -The Embed Workflow Ruby library provides convenient access to the Embed Workflow API from applications written in the Ruby language. - -## Documentation - -See the [Ruby API docs](https://api-docs.embedworkflow.com/?ruby). +Ruby client library for the [EmbedWorkflow API](https://github.com/embedworkflow/embed-workflow-ruby). ## Installation -To install this gem: +Add to your Gemfile: ```ruby -gem install embed-workflow +gem 'embed_workflow', '~> 1.2.0' ``` -or if you are adding it via bundler then add it to your gemfile: +Then run: -```ruby -gem "embed-workflow" +```shell +bundle install ``` -## Configuration - -Configure `EmbedWorkflow` by setting the publishable and secret keys. Be sure to follow best practices and keep your secret key secure. +## Usage ```ruby -require "embed_workflow" +require 'embed_workflow' -EmbedWorkflow.skey = "sk_live_REPLACE_ME" -``` +# Set your API key once +EmbedWorkflow.skey = "sk-live-your-api-key" -## Pagination +# List users +users = EmbedWorkflow.users.list_users -The EmbedWorkflow API uses cursor-based pagination for list endpoints. The following pagination parameters are supported: +# Retrieve a specific user +user = EmbedWorkflow.users.retrieve_user(key: "user-key") -- `starting_after`: Returns objects after this cursor position (exclusive) -- `ending_before`: Returns objects before this cursor position (exclusive) -- `limit`: Maximum number of objects to return (defaults to 25 if not specified) +# Upsert a user +EmbedWorkflow.users.upsert_user(key: "user-1", name: "Jane Doe", email: "jane@example.com") -Both cursor parameters take an object ID as their value. The response will include the data array containing the requested objects, along with pagination metadata. +# List workflows +workflows = EmbedWorkflow.workflows.list_workflows -## Usage +# Execute a workflow +result = EmbedWorkflow.workflows.execute_workflow(id: "workflow-id", execution_data: { key: "value" }) -### Create Workflow +# Trigger a workflow +EmbedWorkflow.workflows.trigger_workflow(event: "new-lead", user_key: "main", execution_data: { name: "John" }) -```ruby -template = { - "edges": ["a-b", "a-c"], - "nodes": [ - {"id": "a", "name": "Wait 2 hours", "type": "Delay", "delay_n": 2, "delay_unit": "hour"}, - {"id": "b", "name": "Email", "type": "Email", "recipient": "john@doe.com", "subject": "New Submission", "body": "New submission from {{Name}} - {{Email}} - {{Phone}}."}, - {"id": "c", "url": "https://domain.com/webhook_example", "name": "Webhook", "type": "Webhook", "params": "one: 1\ntwo: 2", "headers": "X-Custom-Header: my_value"} - ] -} -EmbedWorkflow::Workflows.create( - name: "My first workflow", - template: template -) +# Catch a webhook +EmbedWorkflow.workflows.catch_hook(hook_id: "hook-uuid", user_key: "main") ``` -### Fetch Workflow +### Using multiple clients ```ruby -EmbedWorkflow::Workflows.fetch(hashid: "nybra") +client_a = EmbedWorkflow::Client.new("sk-live-key-a") +client_b = EmbedWorkflow::Client.new("sk-live-key-b") + +client_a.users.list_users +client_b.users.list_users ``` -### List Workflows +## API Endpoints -```ruby -# Default pagination (25 items) -EmbedWorkflow::Workflows.list +All URIs are relative to *https://embedworkflow.com* -# With pagination parameters -EmbedWorkflow::Workflows.list(starting_after: "550e8400-e29b-41d4-a716-446655440000", limit: 10) +### AccountsApi -# Filter by user -EmbedWorkflow::Workflows.list(user_key: "api-user-1") -``` +Method | HTTP request | Description +------------- | ------------- | ------------- +**export_configuration** | **GET** /api/v1/configurations/export | Export configuration +**import_configuration** | **POST** /api/v1/configurations/import | Import configuration +**retrieve_account** | **GET** /api/v1/account | Retrieve account +**retrieve_account_usage** | **GET** /api/v1/account/usage | Retrieve account usage +**update_account** | **PUT** /api/v1/account | Update account -### Update Workflow +### ActionTypesApi -```ruby -EmbedWorkflow::Workflows.update(hashid: "nybra", name: "Updated Name") -``` +Method | HTTP request | Description +------------- | ------------- | ------------- +**create_action_type** | **POST** /api/v1/action_types | Create action type +**delete_action_type** | **DELETE** /api/v1/action_types/{id} | Delete action type +**discard_action_type_draft** | **POST** /api/v1/action_types/{id}/discard_draft | Discard action type draft +**list_action_types** | **GET** /api/v1/action_types | List action types +**publish_action_type** | **POST** /api/v1/action_types/{id}/publish | Publish action type +**retrieve_action_type** | **GET** /api/v1/action_types/{id} | Retrieve action type +**update_action_type** | **PUT** /api/v1/action_types/{id} | Update action type -### List Workflow Activities +### ActionsApi -```ruby -EmbedWorkflow::Workflows.activities(hashid: "nybra") -``` +Method | HTTP request | Description +------------- | ------------- | ------------- +**list_actions** | **GET** /api/v1/actions | List actions +**list_completed_actions** | **GET** /api/v1/actions/completed | List completed actions +**list_failed_actions** | **GET** /api/v1/actions/failed | List failed actions +**list_scheduled_actions** | **GET** /api/v1/actions/scheduled | List scheduled actions +**list_workflow_actions** | **GET** /api/v1/workflows/{workflow_id}/actions | List workflow actions +**retry_action** | **POST** /api/v1/actions/{hashid}/retry | Retry action -### Execute Workflow +### AppConnectionsApi -```ruby -EmbedWorkflow::Workflows.execute( - hashid: "79zeo", - execution: {"Account Email": "mail@embedworkflow.com" }, - form: { - Name: "David", - Email: "david@embedworkflow.com", - Phone: "954-321-1234" - } -) -``` +Method | HTTP request | Description +------------- | ------------- | ------------- +**create_app_connection** | **POST** /api/v1/app_connections | Create app connection +**delete_app_connection** | **DELETE** /api/v1/app_connections/{id} | Delete app connection +**list_app_connections** | **GET** /api/v1/app_connections | List app connections +**retrieve_app_connection** | **GET** /api/v1/app_connections/{id} | Retrieve app connection +**update_app_connection** | **PUT** /api/v1/app_connections/{id} | Update app connection -### Clone Workflow +### AvailableAppsApi -```ruby -EmbedWorkflow::Workflows.clone(hashid: "xbydj") -``` +Method | HTTP request | Description +------------- | ------------- | ------------- +**list_available_apps** | **GET** /api/v1/available_apps | List available apps +**retrieve_available_app** | **GET** /api/v1/available_apps/{app_identifier} | Retrieve available app -### Run Workflow +### DataFieldsApi -```ruby -workflow = EmbedWorkflow::Workflows.create(name: "Manual Start Workflow", auto_start: false) +Method | HTTP request | Description +------------- | ------------- | ------------- +**evaluate_expression** | **POST** /api/v1/data_fields/evaluate | Evaluate expression +**list_data_fields** | **GET** /api/v1/data_fields | List data fields +**list_workflow_data_fields** | **GET** /api/v1/workflows/{id}/data_fields | List workflow data fields -EmbedWorkflow::Workflows.run(hashid: workflow["hashid"]) -``` +### EventsApi -### List Action Activities +Method | HTTP request | Description +------------- | ------------- | ------------- +**list_events** | **GET** /api/v1/events | List events -```ruby -EmbedWorkflow::Actions.activities(hashid: "7l0al") -``` +### ExecutionsApi -### Upsert a user +Method | HTTP request | Description +------------- | ------------- | ------------- +**list_workflow_executions** | **GET** /api/v1/workflows/{workflow_id}/executions | List workflow executions +**retrieve_execution** | **GET** /api/v1/executions/{id} | Retrieve execution +**stop_executions** | **POST** /api/v1/executions/stop | Stop executions -```ruby -data = { foo: "bar" } +### InstalledAppsApi -# Adding a new user -user = EmbedWorkflow::Users.upsert(key: "api-user-1", name: "Jane Doe", email: "jane@embedworkflow.com", data: data) +Method | HTTP request | Description +------------- | ------------- | ------------- +**install_app** | **POST** /api/v1/installed_apps | Install app +**list_installed_apps** | **GET** /api/v1/installed_apps | List installed apps +**retrieve_installed_app** | **GET** /api/v1/installed_apps/{app_identifier} | Retrieve installed app +**update_installed_app** | **PUT** /api/v1/installed_apps/{app_identifier} | Update installed app -# Updating a user -EmbedWorkflow::Users.upsert(name: "Jane Smith", id: user["id"], data: data) -``` +### PaymentsApi -### Fetch a user +Method | HTTP request | Description +------------- | ------------- | ------------- +**list_payments** | **GET** /api/v1/payments | List payments -```ruby -EmbedWorkflow::Users.fetch(key: "api-user-1") -``` +### TriggersApi -### List users +Method | HTTP request | Description +------------- | ------------- | ------------- +**delete_trigger** | **DELETE** /api/v1/triggers/{id} | Delete trigger +**list_triggers** | **GET** /api/v1/triggers | List triggers +**retrieve_trigger** | **GET** /api/v1/triggers/{id} | Retrieve trigger +**update_trigger** | **PUT** /api/v1/triggers/{id} | Update trigger -```ruby -# Default pagination (25 items) -EmbedWorkflow::Users.list +### UsersApi -# With pagination parameters -EmbedWorkflow::Users.list(starting_after: "550e8400-e29b-41d4-a716-446655440000", limit: 10) -``` +Method | HTTP request | Description +------------- | ------------- | ------------- +**create_user_token** | **POST** /api/v1/user_token | Create user token +**delete_user** | **DELETE** /api/v1/users/{key} | Delete user +**list_users** | **GET** /api/v1/users | List users +**retrieve_user** | **GET** /api/v1/users/{key} | Retrieve user +**upsert_user** | **PUT** /api/v1/users/{key} | Upsert user -### Delete a user +### WorkflowsApi -```ruby -EmbedWorkflow::Users.delete(key: "api-user-1") -``` +Method | HTTP request | Description +------------- | ------------- | ------------- +**catch_hook** | **POST** /api/v1/hooks/{hook_id}/catch | Catch hook +**clone_workflow** | **POST** /api/v1/workflows/{id}/clone | Clone workflow +**create_workflow** | **POST** /api/v1/workflows | Create workflow +**delete_workflow** | **DELETE** /api/v1/workflows/{id} | Delete workflow +**discard_workflow_draft** | **POST** /api/v1/workflows/{id}/discard_draft | Discard workflow draft +**execute_workflow** | **POST** /api/v1/workflows/{id}/execute | Execute workflow +**list_workflow_versions** | **GET** /api/v1/workflows/{workflow_id}/versions | List workflow versions +**list_workflows** | **GET** /api/v1/workflows | List workflows +**publish_workflow** | **POST** /api/v1/workflows/{id}/publish | Publish workflow +**retrieve_workflow** | **GET** /api/v1/workflows/{id} | Retrieve workflow +**trigger_workflow** | **POST** /api/v1/trigger | Trigger workflow +**update_workflow** | **PUT** /api/v1/workflows/{id} | Update workflow -### Catch a webhook + +## Authentication + +All API requests require a bearer token: ```ruby -EmbedWorkflow.catch_hook(user_key: "main", hook_id: "70e59f4d-1dc4-4720-b0bb-46929dc48d47", anything: "else", you: "need") +EmbedWorkflow.skey = "sk-live-your-api-key" ``` -### App Connections - -App Connections allow you to store encrypted credentials for third-party integrations. +### Advanced configuration -#### List app connections +For settings like timeouts, custom middleware, or SSL options, use `EmbedWorkflow.configure` **before** setting `skey=` (or constructing a `Client`): ```ruby -# Default pagination (25 items) -EmbedWorkflow::AppConnections.list +EmbedWorkflow.configure do |config| + config.timeout = 10 +end -# With pagination parameters -EmbedWorkflow::AppConnections.list(starting_after: "550e8400-e29b-41d4-a716-446655440000", limit: 50) - -# For a specific user -EmbedWorkflow::AppConnections.list(user_key: "api-user-1") +EmbedWorkflow.skey = "sk-live-your-api-key" ``` -#### Fetch an app connection - -```ruby -EmbedWorkflow::AppConnections.fetch(id: "75233470-6316-4fa9-a7f5-5196f3d06067") -``` +Configure once at boot before instantiating clients. Mutating `Configuration.default` after a client has been constructed has undefined effects on that client. -#### Create an app connection +## Upgrading from 0.3.x -```ruby -config = { - api_key: "sk-1234567890abcdef", - organization_id: "org-abcdefg123456" -} - -EmbedWorkflow::AppConnections.create( - name: "My OpenAI Connection", - app_type: "openai", - config: config -) -``` +1.x is a major rewrite generated from the EmbedWorkflow OpenAPI spec. The public interface changed: -#### Update an app connection +- Resources are now methods on the default client (or a `Client` you construct yourself) instead of standalone modules. +- Methods take keyword arguments and use full operation names (e.g. `list_users`, `retrieve_user`, `execute_workflow`). +- Every documented endpoint is covered, with typed request and response models. ```ruby -EmbedWorkflow::AppConnections.update( - id: "75233470-6316-4fa9-a7f5-5196f3d06067", - name: "Updated OpenAI Connection" -) +# Before (0.3.x) +EmbedWorkflow::Users.list +EmbedWorkflow::Users.fetch("user-key") +EmbedWorkflow::Workflows.execute("workflow-id", execution_data: { foo: "bar" }) +EmbedWorkflow::CatchHook.create(hook_id: "...", user_key: "main", first_name: "Jane") + +# After (1.x) +EmbedWorkflow.users.list_users +EmbedWorkflow.users.retrieve_user(key: "user-key") +EmbedWorkflow.workflows.execute_workflow(id: "workflow-id", execution_data: { foo: "bar" }) +EmbedWorkflow.workflows.catch_hook(hook_id: "...", user_key: "main", first_name: "Jane") ``` -#### Delete an app connection +`EmbedWorkflow.skey =` still works the same way. -```ruby -EmbedWorkflow::AppConnections.delete(id: "75233470-6316-4fa9-a7f5-5196f3d06067") -``` +## License + +MIT diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..c72ca30 --- /dev/null +++ b/Rakefile @@ -0,0 +1,10 @@ +require "bundler/gem_tasks" + +begin + require 'rspec/core/rake_task' + + RSpec::Core::RakeTask.new(:spec) + task default: :spec +rescue LoadError + # no rspec available +end diff --git a/bin/console b/bin/console deleted file mode 100755 index 6626992..0000000 --- a/bin/console +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require "bundler/setup" -require "embed_workflow" - -require "irb" -IRB.start(__FILE__) diff --git a/bin/publish b/bin/publish deleted file mode 100755 index 7511867..0000000 --- a/bin/publish +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -bundle install -bundle exec gem build embed_workflow --output=release.gem -bundle exec gem push release.gem \ No newline at end of file diff --git a/docs/AccountsApi.md b/docs/AccountsApi.md new file mode 100644 index 0000000..b4c1a1a --- /dev/null +++ b/docs/AccountsApi.md @@ -0,0 +1,358 @@ +# EmbedWorkflow::AccountsApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**export_configuration**](AccountsApi.md#export_configuration) | **GET** /api/v1/configurations/export | Export configuration | +| [**import_configuration**](AccountsApi.md#import_configuration) | **POST** /api/v1/configurations/import | Import configuration | +| [**retrieve_account**](AccountsApi.md#retrieve_account) | **GET** /api/v1/account | Retrieve account | +| [**retrieve_account_usage**](AccountsApi.md#retrieve_account_usage) | **GET** /api/v1/account/usage | Retrieve account usage | +| [**update_account**](AccountsApi.md#update_account) | **PUT** /api/v1/account | Update account | + + +## export_configuration + +> export_configuration(opts) + +Export configuration + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AccountsApi.new +opts = { + schema_format: 'yaml', # String | + sections: ['action_types'] # Array | +} + +begin + # Export configuration + result = api_instance.export_configuration(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AccountsApi->export_configuration: #{e}" +end +``` + +#### Using the export_configuration_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> export_configuration_with_http_info(opts) + +```ruby +begin + # Export configuration + data, status_code, headers = api_instance.export_configuration_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AccountsApi->export_configuration_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **schema_format** | **String** | | [optional][default to 'yaml'] | +| **sections** | [**Array<String>**](String.md) | | [optional] | + +### Return type + +[**ExportConfiguration200Response**](ExportConfiguration200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## import_configuration + +> import_configuration(opts) + +Import configuration + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AccountsApi.new +opts = { + import_configuration_request: EmbedWorkflow::ImportConfigurationRequest.new # ImportConfigurationRequest | +} + +begin + # Import configuration + result = api_instance.import_configuration(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AccountsApi->import_configuration: #{e}" +end +``` + +#### Using the import_configuration_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> import_configuration_with_http_info(opts) + +```ruby +begin + # Import configuration + data, status_code, headers = api_instance.import_configuration_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AccountsApi->import_configuration_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **import_configuration_request** | [**ImportConfigurationRequest**](ImportConfigurationRequest.md) | | [optional] | + +### Return type + +[**ImportConfiguration201Response**](ImportConfiguration201Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## retrieve_account + +> retrieve_account + +Retrieve account + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AccountsApi.new + +begin + # Retrieve account + result = api_instance.retrieve_account + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AccountsApi->retrieve_account: #{e}" +end +``` + +#### Using the retrieve_account_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> retrieve_account_with_http_info + +```ruby +begin + # Retrieve account + data, status_code, headers = api_instance.retrieve_account_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AccountsApi->retrieve_account_with_http_info: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**RetrieveAccount200Response**](RetrieveAccount200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## retrieve_account_usage + +> retrieve_account_usage(opts) + +Retrieve account usage + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AccountsApi.new +opts = { + start_time: Time.parse('2024-01-01T00:00Z'), # Time | + end_time: Time.parse('2024-01-31T23:59:59Z'), # Time | + user_key: 'user_key_example' # String | User key to filter usage for a specific user +} + +begin + # Retrieve account usage + result = api_instance.retrieve_account_usage(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AccountsApi->retrieve_account_usage: #{e}" +end +``` + +#### Using the retrieve_account_usage_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> retrieve_account_usage_with_http_info(opts) + +```ruby +begin + # Retrieve account usage + data, status_code, headers = api_instance.retrieve_account_usage_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AccountsApi->retrieve_account_usage_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **start_time** | **Time** | | [optional] | +| **end_time** | **Time** | | [optional] | +| **user_key** | **String** | User key to filter usage for a specific user | [optional] | + +### Return type + +[**RetrieveAccountUsage200Response**](RetrieveAccountUsage200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_account + +> update_account(opts) + +Update account + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AccountsApi.new +opts = { + update_account_request: EmbedWorkflow::UpdateAccountRequest.new # UpdateAccountRequest | +} + +begin + # Update account + result = api_instance.update_account(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AccountsApi->update_account: #{e}" +end +``` + +#### Using the update_account_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_account_with_http_info(opts) + +```ruby +begin + # Update account + data, status_code, headers = api_instance.update_account_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AccountsApi->update_account_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **update_account_request** | [**UpdateAccountRequest**](UpdateAccountRequest.md) | | [optional] | + +### Return type + +[**RetrieveAccount200Response**](RetrieveAccount200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/ActionTypesApi.md b/docs/ActionTypesApi.md new file mode 100644 index 0000000..deabc53 --- /dev/null +++ b/docs/ActionTypesApi.md @@ -0,0 +1,497 @@ +# EmbedWorkflow::ActionTypesApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_action_type**](ActionTypesApi.md#create_action_type) | **POST** /api/v1/action_types | Create action type | +| [**delete_action_type**](ActionTypesApi.md#delete_action_type) | **DELETE** /api/v1/action_types/{id} | Delete action type | +| [**discard_action_type_draft**](ActionTypesApi.md#discard_action_type_draft) | **POST** /api/v1/action_types/{id}/discard_draft | Discard action type draft | +| [**list_action_types**](ActionTypesApi.md#list_action_types) | **GET** /api/v1/action_types | List action types | +| [**publish_action_type**](ActionTypesApi.md#publish_action_type) | **POST** /api/v1/action_types/{id}/publish | Publish action type | +| [**retrieve_action_type**](ActionTypesApi.md#retrieve_action_type) | **GET** /api/v1/action_types/{id} | Retrieve action type | +| [**update_action_type**](ActionTypesApi.md#update_action_type) | **PUT** /api/v1/action_types/{id} | Update action type | + + +## create_action_type + +> create_action_type(opts) + +Create action type + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionTypesApi.new +opts = { + create_action_type_request: EmbedWorkflow::CreateActionTypeRequest.new({name: 'name_example', type: 'CustomApiRequest'}) # CreateActionTypeRequest | +} + +begin + # Create action type + result = api_instance.create_action_type(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->create_action_type: #{e}" +end +``` + +#### Using the create_action_type_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_action_type_with_http_info(opts) + +```ruby +begin + # Create action type + data, status_code, headers = api_instance.create_action_type_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->create_action_type_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_action_type_request** | [**CreateActionTypeRequest**](CreateActionTypeRequest.md) | | [optional] | + +### Return type + +[**ListActionTypes200ResponseCollectionInner**](ListActionTypes200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_action_type + +> delete_action_type(id) + +Delete action type + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionTypesApi.new +id = 'id_example' # String | System-generated unique identifier + +begin + # Delete action type + result = api_instance.delete_action_type(id) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->delete_action_type: #{e}" +end +``` + +#### Using the delete_action_type_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> delete_action_type_with_http_info(id) + +```ruby +begin + # Delete action type + data, status_code, headers = api_instance.delete_action_type_with_http_info(id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->delete_action_type_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | + +### Return type + +[**DeleteActionType200Response**](DeleteActionType200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## discard_action_type_draft + +> discard_action_type_draft(id) + +Discard action type draft + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionTypesApi.new +id = 'id_example' # String | System-generated unique identifier + +begin + # Discard action type draft + result = api_instance.discard_action_type_draft(id) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->discard_action_type_draft: #{e}" +end +``` + +#### Using the discard_action_type_draft_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> discard_action_type_draft_with_http_info(id) + +```ruby +begin + # Discard action type draft + data, status_code, headers = api_instance.discard_action_type_draft_with_http_info(id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->discard_action_type_draft_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | + +### Return type + +[**ListActionTypes200ResponseCollectionInner**](ListActionTypes200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_action_types + +> list_action_types(opts) + +List action types + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionTypesApi.new +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25, # Integer | Number of items to return (max 100) + category: 'category_example' # String | Filter by category (matches primary or secondary) +} + +begin + # List action types + result = api_instance.list_action_types(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->list_action_types: #{e}" +end +``` + +#### Using the list_action_types_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_action_types_with_http_info(opts) + +```ruby +begin + # List action types + data, status_code, headers = api_instance.list_action_types_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->list_action_types_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | +| **category** | **String** | Filter by category (matches primary or secondary) | [optional] | + +### Return type + +[**ListActionTypes200Response**](ListActionTypes200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## publish_action_type + +> publish_action_type(id) + +Publish action type + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionTypesApi.new +id = 'id_example' # String | System-generated unique identifier + +begin + # Publish action type + result = api_instance.publish_action_type(id) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->publish_action_type: #{e}" +end +``` + +#### Using the publish_action_type_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> publish_action_type_with_http_info(id) + +```ruby +begin + # Publish action type + data, status_code, headers = api_instance.publish_action_type_with_http_info(id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->publish_action_type_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | + +### Return type + +[**ListActionTypes200ResponseCollectionInner**](ListActionTypes200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## retrieve_action_type + +> retrieve_action_type(id) + +Retrieve action type + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionTypesApi.new +id = 'id_example' # String | System-generated unique identifier + +begin + # Retrieve action type + result = api_instance.retrieve_action_type(id) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->retrieve_action_type: #{e}" +end +``` + +#### Using the retrieve_action_type_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> retrieve_action_type_with_http_info(id) + +```ruby +begin + # Retrieve action type + data, status_code, headers = api_instance.retrieve_action_type_with_http_info(id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->retrieve_action_type_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | + +### Return type + +[**ListActionTypes200ResponseCollectionInner**](ListActionTypes200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_action_type + +> update_action_type(id, opts) + +Update action type + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionTypesApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + update_action_type_request: EmbedWorkflow::UpdateActionTypeRequest.new # UpdateActionTypeRequest | +} + +begin + # Update action type + result = api_instance.update_action_type(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->update_action_type: #{e}" +end +``` + +#### Using the update_action_type_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_action_type_with_http_info(id, opts) + +```ruby +begin + # Update action type + data, status_code, headers = api_instance.update_action_type_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionTypesApi->update_action_type_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **update_action_type_request** | [**UpdateActionTypeRequest**](UpdateActionTypeRequest.md) | | [optional] | + +### Return type + +[**ListActionTypes200ResponseCollectionInner**](ListActionTypes200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/ActionsApi.md b/docs/ActionsApi.md new file mode 100644 index 0000000..bb0f1ab --- /dev/null +++ b/docs/ActionsApi.md @@ -0,0 +1,475 @@ +# EmbedWorkflow::ActionsApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**list_actions**](ActionsApi.md#list_actions) | **GET** /api/v1/actions | List actions | +| [**list_completed_actions**](ActionsApi.md#list_completed_actions) | **GET** /api/v1/actions/completed | List completed actions | +| [**list_failed_actions**](ActionsApi.md#list_failed_actions) | **GET** /api/v1/actions/failed | List failed actions | +| [**list_scheduled_actions**](ActionsApi.md#list_scheduled_actions) | **GET** /api/v1/actions/scheduled | List scheduled actions | +| [**list_workflow_actions**](ActionsApi.md#list_workflow_actions) | **GET** /api/v1/workflows/{workflow_id}/actions | List workflow actions | +| [**retry_action**](ActionsApi.md#retry_action) | **POST** /api/v1/actions/{hashid}/retry | Retry action | + + +## list_actions + +> list_actions(opts) + +List actions + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionsApi.new +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25, # Integer | Number of items to return (max 100) + status: 'completed', # String | Filter results by status + execution_id: 'execution_id_example', # String | Filter results by execution id + workflow_id: 'workflow_id_example' # String | Filter results by workflow id +} + +begin + # List actions + result = api_instance.list_actions(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->list_actions: #{e}" +end +``` + +#### Using the list_actions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_actions_with_http_info(opts) + +```ruby +begin + # List actions + data, status_code, headers = api_instance.list_actions_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->list_actions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | +| **status** | **String** | Filter results by status | [optional] | +| **execution_id** | **String** | Filter results by execution id | [optional] | +| **workflow_id** | **String** | Filter results by workflow id | [optional] | + +### Return type + +[**ListActions200Response**](ListActions200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_completed_actions + +> list_completed_actions(status, opts) + +List completed actions + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionsApi.new +status = 'completed' # String | Filter results by status +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25, # Integer | Number of items to return (max 100) + execution_id: 'execution_id_example', # String | Filter results by execution id + workflow_id: 'workflow_id_example' # String | Filter results by workflow id +} + +begin + # List completed actions + result = api_instance.list_completed_actions(status, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->list_completed_actions: #{e}" +end +``` + +#### Using the list_completed_actions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_completed_actions_with_http_info(status, opts) + +```ruby +begin + # List completed actions + data, status_code, headers = api_instance.list_completed_actions_with_http_info(status, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->list_completed_actions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **status** | **String** | Filter results by status | | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | +| **execution_id** | **String** | Filter results by execution id | [optional] | +| **workflow_id** | **String** | Filter results by workflow id | [optional] | + +### Return type + +[**ListActions200Response**](ListActions200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_failed_actions + +> list_failed_actions(status, opts) + +List failed actions + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionsApi.new +status = 'completed' # String | Filter results by status +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25, # Integer | Number of items to return (max 100) + execution_id: 'execution_id_example', # String | Filter results by execution id + workflow_id: 'workflow_id_example' # String | Filter results by workflow id +} + +begin + # List failed actions + result = api_instance.list_failed_actions(status, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->list_failed_actions: #{e}" +end +``` + +#### Using the list_failed_actions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_failed_actions_with_http_info(status, opts) + +```ruby +begin + # List failed actions + data, status_code, headers = api_instance.list_failed_actions_with_http_info(status, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->list_failed_actions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **status** | **String** | Filter results by status | | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | +| **execution_id** | **String** | Filter results by execution id | [optional] | +| **workflow_id** | **String** | Filter results by workflow id | [optional] | + +### Return type + +[**ListActions200Response**](ListActions200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_scheduled_actions + +> list_scheduled_actions(status, opts) + +List scheduled actions + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionsApi.new +status = 'completed' # String | Filter results by status +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25, # Integer | Number of items to return (max 100) + execution_id: 'execution_id_example', # String | Filter results by execution id + workflow_id: 'workflow_id_example' # String | Filter results by workflow id +} + +begin + # List scheduled actions + result = api_instance.list_scheduled_actions(status, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->list_scheduled_actions: #{e}" +end +``` + +#### Using the list_scheduled_actions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_scheduled_actions_with_http_info(status, opts) + +```ruby +begin + # List scheduled actions + data, status_code, headers = api_instance.list_scheduled_actions_with_http_info(status, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->list_scheduled_actions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **status** | **String** | Filter results by status | | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | +| **execution_id** | **String** | Filter results by execution id | [optional] | +| **workflow_id** | **String** | Filter results by workflow id | [optional] | + +### Return type + +[**ListActions200Response**](ListActions200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_workflow_actions + +> list_workflow_actions(workflow_id, opts) + +List workflow actions + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionsApi.new +workflow_id = 'workflow_id_example' # String | Filter results by workflow id +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25 # Integer | Number of items to return (max 100) +} + +begin + # List workflow actions + result = api_instance.list_workflow_actions(workflow_id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->list_workflow_actions: #{e}" +end +``` + +#### Using the list_workflow_actions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_workflow_actions_with_http_info(workflow_id, opts) + +```ruby +begin + # List workflow actions + data, status_code, headers = api_instance.list_workflow_actions_with_http_info(workflow_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->list_workflow_actions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **workflow_id** | **String** | Filter results by workflow id | | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | + +### Return type + +[**ListActions200Response**](ListActions200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## retry_action + +> Object retry_action(hashid, opts) + +Retry action + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ActionsApi.new +hashid = 'hashid_example' # String | Action's hashid +opts = { + retry_action_request: EmbedWorkflow::RetryActionRequest.new({user_key: 'user_key_example', hook_id: '0197053c-1672-7132-b9e9-4c2033a26ac7'}) # RetryActionRequest | +} + +begin + # Retry action + result = api_instance.retry_action(hashid, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->retry_action: #{e}" +end +``` + +#### Using the retry_action_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> retry_action_with_http_info(hashid, opts) + +```ruby +begin + # Retry action + data, status_code, headers = api_instance.retry_action_with_http_info(hashid, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ActionsApi->retry_action_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **hashid** | **String** | Action's hashid | | +| **retry_action_request** | [**RetryActionRequest**](RetryActionRequest.md) | | [optional] | + +### Return type + +**Object** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/AppConnectionsApi.md b/docs/AppConnectionsApi.md new file mode 100644 index 0000000..58c2a64 --- /dev/null +++ b/docs/AppConnectionsApi.md @@ -0,0 +1,371 @@ +# EmbedWorkflow::AppConnectionsApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_app_connection**](AppConnectionsApi.md#create_app_connection) | **POST** /api/v1/app_connections | Create app connection | +| [**delete_app_connection**](AppConnectionsApi.md#delete_app_connection) | **DELETE** /api/v1/app_connections/{id} | Delete app connection | +| [**list_app_connections**](AppConnectionsApi.md#list_app_connections) | **GET** /api/v1/app_connections | List app connections | +| [**retrieve_app_connection**](AppConnectionsApi.md#retrieve_app_connection) | **GET** /api/v1/app_connections/{id} | Retrieve app connection | +| [**update_app_connection**](AppConnectionsApi.md#update_app_connection) | **PUT** /api/v1/app_connections/{id} | Update app connection | + + +## create_app_connection + +> create_app_connection(opts) + +Create app connection + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AppConnectionsApi.new +opts = { + create_app_connection_request: EmbedWorkflow::CreateAppConnectionRequest.new({name: 'name_example', app_type: 'gmail', user_key: 'user_key_example', config: {"api_key":"abc_123"}}) # CreateAppConnectionRequest | +} + +begin + # Create app connection + result = api_instance.create_app_connection(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AppConnectionsApi->create_app_connection: #{e}" +end +``` + +#### Using the create_app_connection_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_app_connection_with_http_info(opts) + +```ruby +begin + # Create app connection + data, status_code, headers = api_instance.create_app_connection_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AppConnectionsApi->create_app_connection_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_app_connection_request** | [**CreateAppConnectionRequest**](CreateAppConnectionRequest.md) | | [optional] | + +### Return type + +[**ListAppConnections200ResponseCollectionInner**](ListAppConnections200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_app_connection + +> delete_app_connection(id, opts) + +Delete app connection + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AppConnectionsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + user_key: 'user_key_example' # String | Unique user identifier +} + +begin + # Delete app connection + result = api_instance.delete_app_connection(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AppConnectionsApi->delete_app_connection: #{e}" +end +``` + +#### Using the delete_app_connection_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> delete_app_connection_with_http_info(id, opts) + +```ruby +begin + # Delete app connection + data, status_code, headers = api_instance.delete_app_connection_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AppConnectionsApi->delete_app_connection_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **user_key** | **String** | Unique user identifier | [optional] | + +### Return type + +[**DeleteActionType200Response**](DeleteActionType200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_app_connections + +> list_app_connections(opts) + +List app connections + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AppConnectionsApi.new +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25, # Integer | Number of items to return (max 100) + user_key: 'user_key_example', # String | Unique user identifier + app_type: 'app_type_example' # String | Filter results by app type +} + +begin + # List app connections + result = api_instance.list_app_connections(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AppConnectionsApi->list_app_connections: #{e}" +end +``` + +#### Using the list_app_connections_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_app_connections_with_http_info(opts) + +```ruby +begin + # List app connections + data, status_code, headers = api_instance.list_app_connections_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AppConnectionsApi->list_app_connections_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | +| **user_key** | **String** | Unique user identifier | [optional] | +| **app_type** | **String** | Filter results by app type | [optional] | + +### Return type + +[**ListAppConnections200Response**](ListAppConnections200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## retrieve_app_connection + +> retrieve_app_connection(id, opts) + +Retrieve app connection + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AppConnectionsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + user_key: 'user_key_example' # String | Unique user identifier +} + +begin + # Retrieve app connection + result = api_instance.retrieve_app_connection(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AppConnectionsApi->retrieve_app_connection: #{e}" +end +``` + +#### Using the retrieve_app_connection_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> retrieve_app_connection_with_http_info(id, opts) + +```ruby +begin + # Retrieve app connection + data, status_code, headers = api_instance.retrieve_app_connection_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AppConnectionsApi->retrieve_app_connection_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **user_key** | **String** | Unique user identifier | [optional] | + +### Return type + +[**ListAppConnections200ResponseCollectionInner**](ListAppConnections200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_app_connection + +> update_app_connection(id, opts) + +Update app connection + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AppConnectionsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + create_app_connection_request: EmbedWorkflow::CreateAppConnectionRequest.new({name: 'name_example', app_type: 'gmail', user_key: 'user_key_example', config: {"api_key":"abc_123"}}) # CreateAppConnectionRequest | +} + +begin + # Update app connection + result = api_instance.update_app_connection(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AppConnectionsApi->update_app_connection: #{e}" +end +``` + +#### Using the update_app_connection_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_app_connection_with_http_info(id, opts) + +```ruby +begin + # Update app connection + data, status_code, headers = api_instance.update_app_connection_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AppConnectionsApi->update_app_connection_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **create_app_connection_request** | [**CreateAppConnectionRequest**](CreateAppConnectionRequest.md) | | [optional] | + +### Return type + +[**ListAppConnections200ResponseCollectionInner**](ListAppConnections200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/AvailableAppsApi.md b/docs/AvailableAppsApi.md new file mode 100644 index 0000000..87383c9 --- /dev/null +++ b/docs/AvailableAppsApi.md @@ -0,0 +1,145 @@ +# EmbedWorkflow::AvailableAppsApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**list_available_apps**](AvailableAppsApi.md#list_available_apps) | **GET** /api/v1/available_apps | List available apps | +| [**retrieve_available_app**](AvailableAppsApi.md#retrieve_available_app) | **GET** /api/v1/available_apps/{app_identifier} | Retrieve available app | + + +## list_available_apps + +> list_available_apps(opts) + +List available apps + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AvailableAppsApi.new +opts = { + exclude_installed: 'exclude_installed_example' # String | Exclude already installed apps +} + +begin + # List available apps + result = api_instance.list_available_apps(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AvailableAppsApi->list_available_apps: #{e}" +end +``` + +#### Using the list_available_apps_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_available_apps_with_http_info(opts) + +```ruby +begin + # List available apps + data, status_code, headers = api_instance.list_available_apps_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AvailableAppsApi->list_available_apps_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **exclude_installed** | **String** | Exclude already installed apps | [optional] | + +### Return type + +[**ListAvailableApps200Response**](ListAvailableApps200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## retrieve_available_app + +> retrieve_available_app(app_identifier) + +Retrieve available app + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::AvailableAppsApi.new +app_identifier = 'app_identifier_example' # String | App indentifier + +begin + # Retrieve available app + result = api_instance.retrieve_available_app(app_identifier) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AvailableAppsApi->retrieve_available_app: #{e}" +end +``` + +#### Using the retrieve_available_app_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> retrieve_available_app_with_http_info(app_identifier) + +```ruby +begin + # Retrieve available app + data, status_code, headers = api_instance.retrieve_available_app_with_http_info(app_identifier) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling AvailableAppsApi->retrieve_available_app_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_identifier** | **String** | App indentifier | | + +### Return type + +[**RetrieveAvailableApp200Response**](RetrieveAvailableApp200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/CatchHookRequest.md b/docs/CatchHookRequest.md new file mode 100644 index 0000000..3e55495 --- /dev/null +++ b/docs/CatchHookRequest.md @@ -0,0 +1,18 @@ +# EmbedWorkflow::CatchHookRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user_key** | **String** | User's key | [default to 'main'] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CatchHookRequest.new( + user_key: null +) +``` + diff --git a/docs/CreateActionType422Response.md b/docs/CreateActionType422Response.md new file mode 100644 index 0000000..46deeab --- /dev/null +++ b/docs/CreateActionType422Response.md @@ -0,0 +1,22 @@ +# EmbedWorkflow::CreateActionType422Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | Type of error | | +| **code** | **String** | Specific error code | | +| **message** | **String** | Human-readable message providing more details about the error | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CreateActionType422Response.new( + type: invalid_request_error, + code: parameter_invalid, + message: null +) +``` + diff --git a/docs/CreateActionTypeRequest.md b/docs/CreateActionTypeRequest.md new file mode 100644 index 0000000..552b420 --- /dev/null +++ b/docs/CreateActionTypeRequest.md @@ -0,0 +1,50 @@ +# EmbedWorkflow::CreateActionTypeRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of resource | | +| **description** | **String** | Description of action type | [optional] | +| **type** | **String** | Type of action | | +| **on** | **Boolean** | Enable or disable the resource. | [optional][default to true] | +| **params_draft** | **String** | HTTP parameters as key:value pairs, one per line | [optional] | +| **headers_draft** | **String** | HTTP headers as key:value pairs, one per line | [optional] | +| **url_draft** | **String** | HTTP url | [optional] | +| **http_method_draft** | **String** | HTTP method | [optional] | +| **code_draft** | **String** | JavaScript code snippt | [optional] | +| **publish** | **Boolean** | Whether or not you want to publish on create | [optional][default to false] | +| **form_draft** | [**Array<CreateActionTypeRequestFormDraftInner>**](CreateActionTypeRequestFormDraftInner.md) | Form field configuration | [optional] | +| **response_data_schema_draft** | [**Array<UpdateAccountRequestUserDataSchemaInner>**](UpdateAccountRequestUserDataSchemaInner.md) | Data schema configuration | [optional] | +| **groups** | **Array<String>** | User permission groups. Only available to users with admin role. | [optional] | +| **icon_draft** | [**CreateActionTypeRequestIconDraft**](CreateActionTypeRequestIconDraft.md) | | [optional] | +| **primary_category** | **String** | Primary category for the action type | [optional] | +| **secondary_category** | **String** | Secondary category for the action type | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CreateActionTypeRequest.new( + name: null, + description: Sends an email, + type: CustomApiRequest, + on: false, + params_draft: name:John +email:john@example.com, + headers_draft: Authorization:Bearer {{ api_key }} +Content-Type:application/json, + url_draft: https://{{base_url}}/cool_action, + http_method_draft: post, + code_draft: null, + publish: null, + form_draft: [{"id":"user_name","name":"user_name","required":true,"label":"Full Name","description":"Enter your full name","type":"text","data":{"max_length":100}},{"id":"user_email","name":"email","required":true,"label":"Email Address","type":"email","data":{}}], + response_data_schema_draft: null, + groups: ["admins","leads"], + icon_draft: null, + primary_category: flow_control, + secondary_category: communication +) +``` + diff --git a/docs/CreateActionTypeRequestFormDraftInner.md b/docs/CreateActionTypeRequestFormDraftInner.md new file mode 100644 index 0000000..5d6325b --- /dev/null +++ b/docs/CreateActionTypeRequestFormDraftInner.md @@ -0,0 +1,32 @@ +# EmbedWorkflow::CreateActionTypeRequestFormDraftInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier for the form field | | +| **name** | **String** | Field name for form submission | | +| **required** | **Boolean** | Whether this field is required | [optional] | +| **advanced** | **Boolean** | Whether this field is for advanced configuration | [optional] | +| **label** | **String** | Display label for the form field | [optional] | +| **description** | **String** | Help text or description for the field | [optional] | +| **type** | **String** | Form field type | | +| **data** | **Hash<String, Object>** | Additional field configuration (options, validation, etc.) | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CreateActionTypeRequestFormDraftInner.new( + id: null, + name: null, + required: null, + advanced: null, + label: null, + description: null, + type: null, + data: null +) +``` + diff --git a/docs/CreateActionTypeRequestIconDraft.md b/docs/CreateActionTypeRequestIconDraft.md new file mode 100644 index 0000000..0948b3b --- /dev/null +++ b/docs/CreateActionTypeRequestIconDraft.md @@ -0,0 +1,22 @@ +# EmbedWorkflow::CreateActionTypeRequestIconDraft + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | Icon type identifier | | +| **background_color** | **String** | Background color for the icon | [optional][default to 'gray:500'] | +| **url** | **String** | Custom icon URL (optional) | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CreateActionTypeRequestIconDraft.new( + type: clock, + background_color: blue:900, + url: https://example.com/icon.png +) +``` + diff --git a/docs/CreateAppConnectionRequest.md b/docs/CreateAppConnectionRequest.md new file mode 100644 index 0000000..9507481 --- /dev/null +++ b/docs/CreateAppConnectionRequest.md @@ -0,0 +1,24 @@ +# EmbedWorkflow::CreateAppConnectionRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of resource | | +| **app_type** | **String** | App Type | | +| **user_key** | **String** | User's key | [default to 'main'] | +| **config** | **Object** | App connection configuration | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CreateAppConnectionRequest.new( + name: null, + app_type: gmail, + user_key: null, + config: {"api_key":"abc_123"} +) +``` + diff --git a/docs/CreateUserToken200Response.md b/docs/CreateUserToken200Response.md new file mode 100644 index 0000000..bef76c2 --- /dev/null +++ b/docs/CreateUserToken200Response.md @@ -0,0 +1,18 @@ +# EmbedWorkflow::CreateUserToken200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user_token** | **String** | Authentication token for the user | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CreateUserToken200Response.new( + user_token: eyJhbGciOiJIUzI1NiJ9... +) +``` + diff --git a/docs/CreateUserTokenRequest.md b/docs/CreateUserTokenRequest.md new file mode 100644 index 0000000..ce184b1 --- /dev/null +++ b/docs/CreateUserTokenRequest.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::CreateUserTokenRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key** | **String** | User's key | [optional][default to 'main'] | +| **id** | **String** | System-generated unique identifier | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CreateUserTokenRequest.new( + key: null, + id: 019ef1d7-6611-72e1-ba1a-9ddc830f8d08 +) +``` + diff --git a/docs/CreateWorkflow201Response.md b/docs/CreateWorkflow201Response.md new file mode 100644 index 0000000..2e10b57 --- /dev/null +++ b/docs/CreateWorkflow201Response.md @@ -0,0 +1,92 @@ +# EmbedWorkflow::CreateWorkflow201Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier | [optional] | +| **account_template_id** | **String** | ID of the account template this workflow was cloned from | [optional] | +| **action_type_ids** | **Array<String>** | Action type IDs used in this workflow's template | [optional] | +| **actions_count** | **Integer** | Number of actions in the workflow | [optional] | +| **auto_clone_for_new_users** | **Boolean** | Auto-clone this template for new users (Admin only) | [optional] | +| **created_at** | **String** | Created at in specified timezone | [optional] | +| **created_at_string** | **String** | Created at formatted as human-readable string | [optional] | +| **created_at_utc** | **String** | Created at in UTC | [optional] | +| **description** | **String** | Description of the workflow | [optional] | +| **event_trigger** | **Object** | Event trigger configuration | [optional] | +| **event_trigger_draft** | **Object** | Draft event trigger configuration | [optional] | +| **executions_count** | **Integer** | Number of times workflow has been executed | [optional] | +| **groups** | **Array<String>** | Permission groups (Admin only) | [optional] | +| **has_draft** | **Boolean** | Whether the workflow has unsaved draft changes | [optional] | +| **is_managed** | **Boolean** | Whether this workflow is managed by the account and read-only | [optional] | +| **is_template** | **Boolean** | Mark as template visible in library (Admin only) | [optional] | +| **key** | **String** | Unique key for the workflow | [optional] | +| **last_executed_at** | **String** | Last executed at in specified timezone | [optional] | +| **last_executed_at_string** | **String** | Last executed at formatted as human-readable string | [optional] | +| **last_executed_at_utc** | **String** | Last executed at in UTC | [optional] | +| **last_published_at** | **String** | Last published at in specified timezone | [optional] | +| **last_published_at_string** | **String** | Last published at formatted as human-readable string | [optional] | +| **last_published_at_utc** | **String** | Last published at in UTC | [optional] | +| **managed_by** | **String** | Who manages this workflow (Admin only) | [optional] | +| **match_conditions** | **Object** | Conditions for matching workflow execution | [optional] | +| **match_conditions_draft** | **Object** | Draft conditions for matching workflow execution | [optional] | +| **name** | **String** | Name of the workflow | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **on** | **Boolean** | Whether the workflow is enabled | [optional] | +| **stats** | **Hash<String, Object>** | Workflow execution statistics | [optional] | +| **status** | **String** | Current status of the workflow | [optional] | +| **template** | **Object** | Published workflow template layout | [optional] | +| **template_draft** | **Object** | Draft workflow template layout | [optional] | +| **trigger_conditions** | **Hash<String, Object>** | Conditions for triggering the workflow | [optional] | +| **trigger_conditions_draft** | **Hash<String, Object>** | Draft conditions for triggering the workflow | [optional] | +| **updated_at** | **String** | Updated at in specified timezone | [optional] | +| **updated_at_string** | **String** | Updated at formatted as human-readable string | [optional] | +| **updated_at_utc** | **String** | Updated at in UTC | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CreateWorkflow201Response.new( + id: 01970396-e105-7bbc-ae46-591765fbaa72, + account_template_id: null, + action_type_ids: ["abc123","def456"], + actions_count: 0, + auto_clone_for_new_users: null, + created_at: null, + created_at_string: May 24, 2025 03:06 pm EDT, + created_at_utc: null, + description: Welcome workflow for new users, + event_trigger: null, + event_trigger_draft: null, + executions_count: 0, + groups: ["admins","leads"], + has_draft: null, + is_managed: null, + is_template: null, + key: workflow_3, + last_executed_at: null, + last_executed_at_string: May 24, 2025 03:06 pm EDT, + last_executed_at_utc: null, + last_published_at: null, + last_published_at_string: May 24, 2025 03:06 pm EDT, + last_published_at_utc: null, + managed_by: tenant, + match_conditions: null, + match_conditions_draft: null, + name: Workflow 3, + object: workflow, + on: null, + stats: {}, + status: off, + template: null, + template_draft: null, + trigger_conditions: {}, + trigger_conditions_draft: {}, + updated_at: null, + updated_at_string: May 24, 2025 03:06 pm EDT, + updated_at_utc: null +) +``` + diff --git a/docs/CreateWorkflowRequest.md b/docs/CreateWorkflowRequest.md new file mode 100644 index 0000000..e0115d4 --- /dev/null +++ b/docs/CreateWorkflowRequest.md @@ -0,0 +1,32 @@ +# EmbedWorkflow::CreateWorkflowRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of resource | | +| **user_key** | **String** | User's key | [optional][default to 'main'] | +| **details** | **String** | Description of the resource | [optional] | +| **template_draft** | [**CreateWorkflowRequestTemplateDraft**](CreateWorkflowRequestTemplateDraft.md) | | [optional] | +| **trigger_conditions_draft** | **Object** | The trigger's conditions | [optional] | +| **event_trigger_draft** | **String** | The trigger's key | [optional] | +| **match_conditions_draft** | **String** | Whether all or any of the trigger conditions must match | [optional] | +| **groups** | **Array<String>** | User permission groups. Only available to users with admin role. | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CreateWorkflowRequest.new( + name: null, + user_key: null, + details: null, + template_draft: null, + trigger_conditions_draft: null, + event_trigger_draft: new-lead, + match_conditions_draft: null, + groups: ["admins","leads"] +) +``` + diff --git a/docs/CreateWorkflowRequestTemplateDraft.md b/docs/CreateWorkflowRequestTemplateDraft.md new file mode 100644 index 0000000..cebcc8e --- /dev/null +++ b/docs/CreateWorkflowRequestTemplateDraft.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::CreateWorkflowRequestTemplateDraft + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **nodes** | [**Array<CreateWorkflowRequestTemplateDraftNodesInner>**](CreateWorkflowRequestTemplateDraftNodesInner.md) | Array of workflow nodes | | +| **edges** | **Array<String>** | Array of connections between nodes in format 'sourceId-targetId' | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CreateWorkflowRequestTemplateDraft.new( + nodes: null, + edges: null +) +``` + diff --git a/docs/CreateWorkflowRequestTemplateDraftNodesInner.md b/docs/CreateWorkflowRequestTemplateDraftNodesInner.md new file mode 100644 index 0000000..71c6a5a --- /dev/null +++ b/docs/CreateWorkflowRequestTemplateDraftNodesInner.md @@ -0,0 +1,48 @@ +# EmbedWorkflow::CreateWorkflowRequestTemplateDraftNodesInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier for the node | | +| **type** | **String** | Type of the node | | +| **action_type_id** | **String** | Identifier for the action type | [optional] | +| **name** | **String** | Display name of the node | [optional] | +| **required_condition_result** | **Boolean** | Whether condition result is required | [optional] | +| **app_connection_id** | **String** | App connection identifier | [optional] | +| **action_data** | **Hash<String, Object>** | Additional action data (for Custom nodes) | [optional] | +| **prefix** | **String** | Data response schema prefix (for Custom nodes) | [optional] | +| **delay_n** | **Integer** | Delay amount (for Delay/Trigger nodes) | [optional] | +| **delay_unit** | **String** | Delay unit (for Delay/Trigger nodes) | [optional] | +| **minute_of_day** | **Integer** | Minute of day (for Delay/WaitUntil nodes) | [optional] | +| **minute_of_day_end** | **Integer** | End minute of day (for WaitUntil nodes) | [optional] | +| **days_of_week** | **Array<Integer>** | Days of week (for WaitUntil nodes) | [optional] | +| **event_trigger** | **String** | Event trigger identifier (for Trigger nodes) | [optional] | +| **conditions** | **Array<Hash<String, Object>>** | Array of conditions (for Trigger/Condition nodes) | [optional] | +| **match_conditions** | **String** | How to match conditions (for Trigger/Condition nodes) | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::CreateWorkflowRequestTemplateDraftNodesInner.new( + id: null, + type: null, + action_type_id: null, + name: null, + required_condition_result: null, + app_connection_id: null, + action_data: null, + prefix: null, + delay_n: null, + delay_unit: null, + minute_of_day: null, + minute_of_day_end: null, + days_of_week: null, + event_trigger: null, + conditions: null, + match_conditions: null +) +``` + diff --git a/docs/DataFieldsApi.md b/docs/DataFieldsApi.md new file mode 100644 index 0000000..07559c1 --- /dev/null +++ b/docs/DataFieldsApi.md @@ -0,0 +1,233 @@ +# EmbedWorkflow::DataFieldsApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**evaluate_expression**](DataFieldsApi.md#evaluate_expression) | **POST** /api/v1/data_fields/evaluate | Evaluate expression | +| [**list_data_fields**](DataFieldsApi.md#list_data_fields) | **GET** /api/v1/data_fields | List data fields | +| [**list_workflow_data_fields**](DataFieldsApi.md#list_workflow_data_fields) | **GET** /api/v1/workflows/{id}/data_fields | List workflow data fields | + + +## evaluate_expression + +> evaluate_expression(opts) + +Evaluate expression + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::DataFieldsApi.new +opts = { + evaluate_expression_request: EmbedWorkflow::EvaluateExpressionRequest.new({expression: 'expression_example', data: { key: 3.56}}) # EvaluateExpressionRequest | +} + +begin + # Evaluate expression + result = api_instance.evaluate_expression(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling DataFieldsApi->evaluate_expression: #{e}" +end +``` + +#### Using the evaluate_expression_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> evaluate_expression_with_http_info(opts) + +```ruby +begin + # Evaluate expression + data, status_code, headers = api_instance.evaluate_expression_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling DataFieldsApi->evaluate_expression_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **evaluate_expression_request** | [**EvaluateExpressionRequest**](EvaluateExpressionRequest.md) | | [optional] | + +### Return type + +[**EvaluateExpression200Response**](EvaluateExpression200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## list_data_fields + +> list_data_fields(opts) + +List data fields + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::DataFieldsApi.new +opts = { + user_key: 'user_123', # String | Filter results by user key + event_trigger: 'event_trigger_example', # String | Filter results by event trigger + type: nil # ListDataFieldsTypeParameter | Data type filter - can be a single type or multiple types +} + +begin + # List data fields + result = api_instance.list_data_fields(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling DataFieldsApi->list_data_fields: #{e}" +end +``` + +#### Using the list_data_fields_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_data_fields_with_http_info(opts) + +```ruby +begin + # List data fields + data, status_code, headers = api_instance.list_data_fields_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling DataFieldsApi->list_data_fields_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user_key** | **String** | Filter results by user key | [optional] | +| **event_trigger** | **String** | Filter results by event trigger | [optional] | +| **type** | [**ListDataFieldsTypeParameter**](.md) | Data type filter - can be a single type or multiple types | [optional] | + +### Return type + +[**ListDataFields200Response**](ListDataFields200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_workflow_data_fields + +> list_workflow_data_fields(id, opts) + +List workflow data fields + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::DataFieldsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + node_id: 'node_456', # String | Node ID to determine current workflow position + parent_node_id: 'node_123', # String | Parent node ID to determine workflow position + user_key: 'user_123', # String | User context for determining available data fields + event_trigger: 'event_trigger_example', # String | Event trigger context for determining available data fields + action_event_trigger: 'action_event_trigger_example', # String | Action's event trigger context for determining available data fields + type: nil # ListDataFieldsTypeParameter | Data type filter - can be a single type or multiple types +} + +begin + # List workflow data fields + result = api_instance.list_workflow_data_fields(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling DataFieldsApi->list_workflow_data_fields: #{e}" +end +``` + +#### Using the list_workflow_data_fields_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_workflow_data_fields_with_http_info(id, opts) + +```ruby +begin + # List workflow data fields + data, status_code, headers = api_instance.list_workflow_data_fields_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling DataFieldsApi->list_workflow_data_fields_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **node_id** | **String** | Node ID to determine current workflow position | [optional] | +| **parent_node_id** | **String** | Parent node ID to determine workflow position | [optional] | +| **user_key** | **String** | User context for determining available data fields | [optional] | +| **event_trigger** | **String** | Event trigger context for determining available data fields | [optional] | +| **action_event_trigger** | **String** | Action's event trigger context for determining available data fields | [optional] | +| **type** | [**ListDataFieldsTypeParameter**](.md) | Data type filter - can be a single type or multiple types | [optional] | + +### Return type + +[**ListDataFields200Response**](ListDataFields200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/DeleteActionType200Response.md b/docs/DeleteActionType200Response.md new file mode 100644 index 0000000..f1a201c --- /dev/null +++ b/docs/DeleteActionType200Response.md @@ -0,0 +1,18 @@ +# EmbedWorkflow::DeleteActionType200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | ID of deleted resource | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::DeleteActionType200Response.new( + id: null +) +``` + diff --git a/docs/DeleteWorkflow200Response.md b/docs/DeleteWorkflow200Response.md new file mode 100644 index 0000000..bc2ec79 --- /dev/null +++ b/docs/DeleteWorkflow200Response.md @@ -0,0 +1,49 @@ +# EmbedWorkflow::DeleteWorkflow200Response + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'embed_workflow' + +EmbedWorkflow::DeleteWorkflow200Response.openapi_one_of +# => +# [ +# :'DeleteWorkflow200ResponseOneOf', +# :'DeleteWorkflow200ResponseOneOf1' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'embed_workflow' + +EmbedWorkflow::DeleteWorkflow200Response.build(data) +# => # + +EmbedWorkflow::DeleteWorkflow200Response.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `DeleteWorkflow200ResponseOneOf` +- `DeleteWorkflow200ResponseOneOf1` +- `nil` (if no type matches) + diff --git a/docs/DeleteWorkflow200ResponseOneOf.md b/docs/DeleteWorkflow200ResponseOneOf.md new file mode 100644 index 0000000..8d1802a --- /dev/null +++ b/docs/DeleteWorkflow200ResponseOneOf.md @@ -0,0 +1,18 @@ +# EmbedWorkflow::DeleteWorkflow200ResponseOneOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::DeleteWorkflow200ResponseOneOf.new( + id: 019ef1d7-6617-7d3e-9da8-e69fca3d356c +) +``` + diff --git a/docs/DeleteWorkflow200ResponseOneOf1.md b/docs/DeleteWorkflow200ResponseOneOf1.md new file mode 100644 index 0000000..4370fe1 --- /dev/null +++ b/docs/DeleteWorkflow200ResponseOneOf1.md @@ -0,0 +1,18 @@ +# EmbedWorkflow::DeleteWorkflow200ResponseOneOf1 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key** | **String** | Client-provided unique identifier | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::DeleteWorkflow200ResponseOneOf1.new( + key: my-workflow +) +``` + diff --git a/docs/DiscardWorkflowDraftRequest.md b/docs/DiscardWorkflowDraftRequest.md new file mode 100644 index 0000000..a14836f --- /dev/null +++ b/docs/DiscardWorkflowDraftRequest.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::DiscardWorkflowDraftRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user_key** | **String** | User's key | [optional][default to 'main'] | +| **expand** | **Array<String>** | Expand related objects | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::DiscardWorkflowDraftRequest.new( + user_key: null, + expand: ["event_trigger","event_trigger_draft"] +) +``` + diff --git a/docs/EvaluateExpression200Response.md b/docs/EvaluateExpression200Response.md new file mode 100644 index 0000000..44efa27 --- /dev/null +++ b/docs/EvaluateExpression200Response.md @@ -0,0 +1,18 @@ +# EmbedWorkflow::EvaluateExpression200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **result** | **String** | | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::EvaluateExpression200Response.new( + result: null +) +``` + diff --git a/docs/EvaluateExpressionRequest.md b/docs/EvaluateExpressionRequest.md new file mode 100644 index 0000000..c1da08c --- /dev/null +++ b/docs/EvaluateExpressionRequest.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::EvaluateExpressionRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **expression** | **String** | Liquid template expression to evaluate against the provided data | | +| **data** | **Hash<String, Object>** | Data context for evaluating the expression | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::EvaluateExpressionRequest.new( + expression: null, + data: null +) +``` + diff --git a/docs/EventsApi.md b/docs/EventsApi.md new file mode 100644 index 0000000..0eea0fb --- /dev/null +++ b/docs/EventsApi.md @@ -0,0 +1,81 @@ +# EmbedWorkflow::EventsApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**list_events**](EventsApi.md#list_events) | **GET** /api/v1/events | List events | + + +## list_events + +> list_events(opts) + +List events + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::EventsApi.new +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25 # Integer | Number of items to return (max 100) +} + +begin + # List events + result = api_instance.list_events(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling EventsApi->list_events: #{e}" +end +``` + +#### Using the list_events_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_events_with_http_info(opts) + +```ruby +begin + # List events + data, status_code, headers = api_instance.list_events_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling EventsApi->list_events_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | + +### Return type + +[**ListEvents200Response**](ListEvents200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/ExecuteWorkflow201Response.md b/docs/ExecuteWorkflow201Response.md new file mode 100644 index 0000000..77e708c --- /dev/null +++ b/docs/ExecuteWorkflow201Response.md @@ -0,0 +1,50 @@ +# EmbedWorkflow::ExecuteWorkflow201Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **hashid** | **String** | System-generated unique identifier | [optional] | +| **actions_count** | **Integer** | Total number of actions in the execution | [optional] | +| **completed_actions_count** | **Integer** | Number of completed actions | [optional] | +| **created_at** | **String** | Created at in specified timezone | [optional] | +| **created_at_string** | **String** | Created at formatted as human-readable string | [optional] | +| **created_at_utc** | **String** | Created at in UTC | [optional] | +| **execution_data** | **Hash<String, Object>** | Data context for the execution | [optional] | +| **failed_actions_count** | **Integer** | Number of failed actions | [optional] | +| **id** | **String** | System-generated unique identifier | [optional] | +| **idle_actions_count** | **Integer** | Number of idle actions | [optional] | +| **key** | **String** | Unique key for the execution | [optional] | +| **log** | **Object** | Execution log details | [optional] | +| **name** | **String** | Name of the execution | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **running_actions_count** | **Integer** | Number of currently running actions | [optional] | +| **status** | **String** | Current status of the execution | [optional] | +| **stopped_actions_count** | **Integer** | Number of stopped actions | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ExecuteWorkflow201Response.new( + hashid: null, + actions_count: null, + completed_actions_count: null, + created_at: null, + created_at_string: May 24, 2025 03:06 pm EDT, + created_at_utc: null, + execution_data: null, + failed_actions_count: null, + id: null, + idle_actions_count: null, + key: null, + log: null, + name: null, + object: execution, + running_actions_count: null, + status: null, + stopped_actions_count: null +) +``` + diff --git a/docs/ExecuteWorkflowRequest.md b/docs/ExecuteWorkflowRequest.md new file mode 100644 index 0000000..449b856 --- /dev/null +++ b/docs/ExecuteWorkflowRequest.md @@ -0,0 +1,22 @@ +# EmbedWorkflow::ExecuteWorkflowRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id_type** | **String** | Type of identifier used in the URL | [optional][default to 'id'] | +| **user_key** | **String** | User's key | [optional][default to 'main'] | +| **execution_data** | **Hash<String, Object>** | Data required to execute the workflow. Key-value pairs that provide context and variables needed during workflow execution. | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ExecuteWorkflowRequest.new( + id_type: null, + user_key: null, + execution_data: {"user_name":"John Doe","company_id":"abc123","custom_field":"some value"} +) +``` + diff --git a/docs/ExecutionsApi.md b/docs/ExecutionsApi.md new file mode 100644 index 0000000..a0aa8a1 --- /dev/null +++ b/docs/ExecutionsApi.md @@ -0,0 +1,225 @@ +# EmbedWorkflow::ExecutionsApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**list_workflow_executions**](ExecutionsApi.md#list_workflow_executions) | **GET** /api/v1/workflows/{workflow_id}/executions | List workflow executions | +| [**retrieve_execution**](ExecutionsApi.md#retrieve_execution) | **GET** /api/v1/executions/{id} | Retrieve execution | +| [**stop_executions**](ExecutionsApi.md#stop_executions) | **POST** /api/v1/executions/stop | Stop executions | + + +## list_workflow_executions + +> list_workflow_executions(workflow_id, opts) + +List workflow executions + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ExecutionsApi.new +workflow_id = 'workflow_id_example' # String | Filter results by workflow id +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25 # Integer | Number of items to return (max 100) +} + +begin + # List workflow executions + result = api_instance.list_workflow_executions(workflow_id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ExecutionsApi->list_workflow_executions: #{e}" +end +``` + +#### Using the list_workflow_executions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_workflow_executions_with_http_info(workflow_id, opts) + +```ruby +begin + # List workflow executions + data, status_code, headers = api_instance.list_workflow_executions_with_http_info(workflow_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ExecutionsApi->list_workflow_executions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **workflow_id** | **String** | Filter results by workflow id | | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | + +### Return type + +[**ListWorkflowExecutions200Response**](ListWorkflowExecutions200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## retrieve_execution + +> retrieve_execution(id, opts) + +Retrieve execution + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ExecutionsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + id_type: 'id_type_example' # String | Type of identifier used in the URL +} + +begin + # Retrieve execution + result = api_instance.retrieve_execution(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ExecutionsApi->retrieve_execution: #{e}" +end +``` + +#### Using the retrieve_execution_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> retrieve_execution_with_http_info(id, opts) + +```ruby +begin + # Retrieve execution + data, status_code, headers = api_instance.retrieve_execution_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ExecutionsApi->retrieve_execution_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **id_type** | **String** | Type of identifier used in the URL | [optional] | + +### Return type + +[**RetrieveExecution200Response**](RetrieveExecution200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## stop_executions + +> Object stop_executions(opts) + +Stop executions + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::ExecutionsApi.new +opts = { + stop_executions_request: EmbedWorkflow::StopExecutionsRequest.new({user_key: 'user_key_example'}) # StopExecutionsRequest | +} + +begin + # Stop executions + result = api_instance.stop_executions(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ExecutionsApi->stop_executions: #{e}" +end +``` + +#### Using the stop_executions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> stop_executions_with_http_info(opts) + +```ruby +begin + # Stop executions + data, status_code, headers = api_instance.stop_executions_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue EmbedWorkflow::ApiError => e + puts "Error when calling ExecutionsApi->stop_executions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **stop_executions_request** | [**StopExecutionsRequest**](StopExecutionsRequest.md) | | [optional] | + +### Return type + +**Object** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/ExportConfiguration200Response.md b/docs/ExportConfiguration200Response.md new file mode 100644 index 0000000..7ed3d46 --- /dev/null +++ b/docs/ExportConfiguration200Response.md @@ -0,0 +1,18 @@ +# EmbedWorkflow::ExportConfiguration200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **configuration** | [**ExportConfiguration200ResponseConfiguration**](ExportConfiguration200ResponseConfiguration.md) | | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ExportConfiguration200Response.new( + configuration: null +) +``` + diff --git a/docs/ExportConfiguration200ResponseConfiguration.md b/docs/ExportConfiguration200ResponseConfiguration.md new file mode 100644 index 0000000..a5ccd2f --- /dev/null +++ b/docs/ExportConfiguration200ResponseConfiguration.md @@ -0,0 +1,49 @@ +# EmbedWorkflow::ExportConfiguration200ResponseConfiguration + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'embed_workflow' + +EmbedWorkflow::ExportConfiguration200ResponseConfiguration.openapi_one_of +# => +# [ +# :'Object', +# :'String' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'embed_workflow' + +EmbedWorkflow::ExportConfiguration200ResponseConfiguration.build(data) +# => # + +EmbedWorkflow::ExportConfiguration200ResponseConfiguration.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Object` +- `String` +- `nil` (if no type matches) + diff --git a/docs/ImportConfiguration201Response.md b/docs/ImportConfiguration201Response.md new file mode 100644 index 0000000..0ed1657 --- /dev/null +++ b/docs/ImportConfiguration201Response.md @@ -0,0 +1,28 @@ +# EmbedWorkflow::ImportConfiguration201Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **object** | **String** | Object type identifier | [optional] | +| **account_data_schema** | **Array<Object>** | Account data schema | [optional] | +| **action_types** | **Array<Object>** | ActionTypes | [optional] | +| **triggers** | **Array<Object>** | Triggers | [optional] | +| **user_data_schema** | **Array<Object>** | User data schema for the account | [optional] | +| **workflows** | **Array<Object>** | Workflows | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ImportConfiguration201Response.new( + object: configuration, + account_data_schema: null, + action_types: null, + triggers: null, + user_data_schema: null, + workflows: null +) +``` + diff --git a/docs/ImportConfigurationRequest.md b/docs/ImportConfigurationRequest.md new file mode 100644 index 0000000..ae93c93 --- /dev/null +++ b/docs/ImportConfigurationRequest.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ImportConfigurationRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **schema** | [**ImportConfigurationRequestSchema**](ImportConfigurationRequestSchema.md) | | [optional] | +| **schema_format** | **String** | Format for the configuration schema | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ImportConfigurationRequest.new( + schema: null, + schema_format: json +) +``` + diff --git a/docs/ImportConfigurationRequestSchema.md b/docs/ImportConfigurationRequestSchema.md new file mode 100644 index 0000000..e96cc50 --- /dev/null +++ b/docs/ImportConfigurationRequestSchema.md @@ -0,0 +1,49 @@ +# EmbedWorkflow::ImportConfigurationRequestSchema + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'embed_workflow' + +EmbedWorkflow::ImportConfigurationRequestSchema.openapi_one_of +# => +# [ +# :'Hash', +# :'String' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'embed_workflow' + +EmbedWorkflow::ImportConfigurationRequestSchema.build(data) +# => #:0x00007fdd4aab02a0> + +EmbedWorkflow::ImportConfigurationRequestSchema.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Hash` +- `String` +- `nil` (if no type matches) + diff --git a/docs/InstallApp201Response.md b/docs/InstallApp201Response.md new file mode 100644 index 0000000..068396c --- /dev/null +++ b/docs/InstallApp201Response.md @@ -0,0 +1,50 @@ +# EmbedWorkflow::InstallApp201Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | [optional] | +| **app_identifier** | **String** | Unique identifier for the app | [optional] | +| **app_version** | **String** | Currently installed version of the app | [optional] | +| **available_version** | **String** | Latest available version of the app | [optional] | +| **groups** | **Array<String>** | Permission groups that can access this app | [optional] | +| **icon** | **Object** | Icon configuration for the installed app | [optional] | +| **installed_schema** | **Hash<String, Object>** | Schema configuration for the installed app | [optional] | +| **last_used_at** | **String** | Last used at in specified timezone | [optional] | +| **last_used_at_string** | **String** | Last used at formatted as human-readable string | [optional] | +| **last_used_at_utc** | **String** | Last used at in UTC | [optional] | +| **name** | **String** | Display name of the installed app | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **previous_version** | **String** | Previously installed version of the app | [optional] | +| **upgrade_available** | **Boolean** | Whether an upgrade is available for this app | [optional] | +| **upgraded_at** | **String** | Upgraded at in specified timezone | [optional] | +| **upgraded_at_string** | **String** | Upgraded at formatted as human-readable string | [optional] | +| **upgraded_at_utc** | **String** | Upgraded at in UTC | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::InstallApp201Response.new( + id: null, + app_identifier: null, + app_version: null, + available_version: null, + groups: null, + icon: null, + installed_schema: null, + last_used_at: null, + last_used_at_string: May 24, 2025 03:06 pm EDT, + last_used_at_utc: null, + name: null, + object: installed_app, + previous_version: null, + upgrade_available: null, + upgraded_at: null, + upgraded_at_string: May 24, 2025 03:06 pm EDT, + upgraded_at_utc: null +) +``` + diff --git a/docs/InstallAppRequest.md b/docs/InstallAppRequest.md new file mode 100644 index 0000000..8368670 --- /dev/null +++ b/docs/InstallAppRequest.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::InstallAppRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_identifier** | **String** | App indentifier | | +| **groups** | **Array<String>** | User permission groups. Only available to users with admin role. | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::InstallAppRequest.new( + app_identifier: slack, + groups: ["admins","leads"] +) +``` + diff --git a/docs/InstalledAppsApi.md b/docs/InstalledAppsApi.md new file mode 100644 index 0000000..cc7bb12 --- /dev/null +++ b/docs/InstalledAppsApi.md @@ -0,0 +1,282 @@ +# EmbedWorkflow::InstalledAppsApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**install_app**](InstalledAppsApi.md#install_app) | **POST** /api/v1/installed_apps | Install app | +| [**list_installed_apps**](InstalledAppsApi.md#list_installed_apps) | **GET** /api/v1/installed_apps | List installed apps | +| [**retrieve_installed_app**](InstalledAppsApi.md#retrieve_installed_app) | **GET** /api/v1/installed_apps/{app_identifier} | Retrieve installed app | +| [**update_installed_app**](InstalledAppsApi.md#update_installed_app) | **PUT** /api/v1/installed_apps/{app_identifier} | Update installed app | + + +## install_app + +> install_app(opts) + +Install app + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::InstalledAppsApi.new +opts = { + install_app_request: EmbedWorkflow::InstallAppRequest.new({app_identifier: 'slack'}) # InstallAppRequest | +} + +begin + # Install app + result = api_instance.install_app(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling InstalledAppsApi->install_app: #{e}" +end +``` + +#### Using the install_app_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> install_app_with_http_info(opts) + +```ruby +begin + # Install app + data, status_code, headers = api_instance.install_app_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling InstalledAppsApi->install_app_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **install_app_request** | [**InstallAppRequest**](InstallAppRequest.md) | | [optional] | + +### Return type + +[**InstallApp201Response**](InstallApp201Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## list_installed_apps + +> list_installed_apps + +List installed apps + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::InstalledAppsApi.new + +begin + # List installed apps + result = api_instance.list_installed_apps + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling InstalledAppsApi->list_installed_apps: #{e}" +end +``` + +#### Using the list_installed_apps_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_installed_apps_with_http_info + +```ruby +begin + # List installed apps + data, status_code, headers = api_instance.list_installed_apps_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling InstalledAppsApi->list_installed_apps_with_http_info: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**ListInstalledApps200Response**](ListInstalledApps200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## retrieve_installed_app + +> retrieve_installed_app(app_identifier) + +Retrieve installed app + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::InstalledAppsApi.new +app_identifier = 'app_identifier_example' # String | App indentifier + +begin + # Retrieve installed app + result = api_instance.retrieve_installed_app(app_identifier) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling InstalledAppsApi->retrieve_installed_app: #{e}" +end +``` + +#### Using the retrieve_installed_app_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> retrieve_installed_app_with_http_info(app_identifier) + +```ruby +begin + # Retrieve installed app + data, status_code, headers = api_instance.retrieve_installed_app_with_http_info(app_identifier) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling InstalledAppsApi->retrieve_installed_app_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_identifier** | **String** | App indentifier | | + +### Return type + +[**InstallApp201Response**](InstallApp201Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_installed_app + +> update_installed_app(app_identifier, opts) + +Update installed app + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::InstalledAppsApi.new +app_identifier = 'app_identifier_example' # String | App indentifier +opts = { + update_installed_app_request: EmbedWorkflow::UpdateInstalledAppRequest.new # UpdateInstalledAppRequest | +} + +begin + # Update installed app + result = api_instance.update_installed_app(app_identifier, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling InstalledAppsApi->update_installed_app: #{e}" +end +``` + +#### Using the update_installed_app_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_installed_app_with_http_info(app_identifier, opts) + +```ruby +begin + # Update installed app + data, status_code, headers = api_instance.update_installed_app_with_http_info(app_identifier, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling InstalledAppsApi->update_installed_app_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_identifier** | **String** | App indentifier | | +| **update_installed_app_request** | [**UpdateInstalledAppRequest**](UpdateInstalledAppRequest.md) | | [optional] | + +### Return type + +[**InstallApp201Response**](InstallApp201Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/ListActionTypes200Response.md b/docs/ListActionTypes200Response.md new file mode 100644 index 0000000..7f03ba5 --- /dev/null +++ b/docs/ListActionTypes200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListActionTypes200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ListActionTypes200ResponseCollectionInner>**](ListActionTypes200ResponseCollectionInner.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListActionTypes200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListActionTypes200ResponseCollectionInner.md b/docs/ListActionTypes200ResponseCollectionInner.md new file mode 100644 index 0000000..5d77108 --- /dev/null +++ b/docs/ListActionTypes200ResponseCollectionInner.md @@ -0,0 +1,106 @@ +# EmbedWorkflow::ListActionTypes200ResponseCollectionInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | [optional] | +| **app_name** | **String** | Human-readable name of the app connection | [optional] | +| **callback_timeout_n** | **Integer** | Callback timeout duration value | [optional] | +| **callback_timeout_unit** | **String** | Callback timeout duration unit | [optional] | +| **code** | **String** | Code content for the action type | [optional] | +| **code_draft** | **String** | Draft code content for the action type | [optional] | +| **created_at** | **String** | Created at in specified timezone | [optional] | +| **created_at_string** | **String** | Created at formatted as human-readable string | [optional] | +| **created_at_utc** | **String** | Created at in UTC | [optional] | +| **description** | **String** | Description of the action type | [optional] | +| **executed_count** | **Integer** | Number of times this action type has been executed | [optional] | +| **groups** | **Array<String>** | Permission groups for this action type | [optional] | +| **has_draft** | **Boolean** | Whether the action type has unsaved draft changes | [optional] | +| **headers** | **String** | Headers configuration for the action type | [optional] | +| **headers_draft** | **String** | Draft headers configuration for the action type | [optional] | +| **http_method** | **String** | HTTP method for the action type | [optional] | +| **http_method_draft** | **String** | Draft HTTP method for the action type | [optional] | +| **icon** | **Object** | Icon configuration for the action type | [optional] | +| **icon_draft** | **Object** | Draft icon configuration for the action type | [optional] | +| **last_executed_at** | **String** | Last executed at in specified timezone | [optional] | +| **last_executed_at_string** | **String** | Last executed at formatted as human-readable string | [optional] | +| **last_executed_at_utc** | **String** | Last executed at in UTC | [optional] | +| **last_published_at** | **String** | Last published at in specified timezone | [optional] | +| **last_published_at_string** | **String** | Last published at formatted as human-readable string | [optional] | +| **last_published_at_utc** | **String** | Last published at in UTC | [optional] | +| **name** | **String** | Name of the action type | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **on** | **Boolean** | Whether the action type is enabled | [optional] | +| **params** | **String** | Parameters configuration for the action type | [optional] | +| **params_draft** | **String** | Draft parameters configuration for the action type | [optional] | +| **primary_category** | **String** | Primary category classification | [optional] | +| **required_app_connection** | **String** | The required app connection for this action type | [optional] | +| **secondary_category** | **String** | Secondary category classification | [optional] | +| **source** | **String** | Source identifier for the action type | [optional] | +| **type** | **String** | Type classification of the action | [optional] | +| **updated_at** | **String** | Updated at in specified timezone | [optional] | +| **updated_at_string** | **String** | Updated at formatted as human-readable string | [optional] | +| **updated_at_utc** | **String** | Updated at in UTC | [optional] | +| **url** | **String** | URL for the action type | [optional] | +| **url_draft** | **String** | Draft URL for the action type | [optional] | +| **wait_for_callback** | **Boolean** | When true, actions fire the webhook but wait for an external callback before completing | [optional] | +| **form** | **Array<Object>** | Form fields for the action type | [optional] | +| **form_draft** | **Array<Object>** | Draft form fields for the action type | [optional] | +| **response_data_schema** | **Array<Object>** | Response data schema for the action type | [optional] | +| **response_data_schema_draft** | **Array<Object>** | Draft response data schema for the action type | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListActionTypes200ResponseCollectionInner.new( + id: null, + app_name: null, + callback_timeout_n: null, + callback_timeout_unit: null, + code: null, + code_draft: null, + created_at: null, + created_at_string: May 24, 2025 03:06 pm EDT, + created_at_utc: null, + description: null, + executed_count: null, + groups: null, + has_draft: null, + headers: null, + headers_draft: null, + http_method: null, + http_method_draft: null, + icon: null, + icon_draft: null, + last_executed_at: null, + last_executed_at_string: May 24, 2025 03:06 pm EDT, + last_executed_at_utc: null, + last_published_at: null, + last_published_at_string: May 24, 2025 03:06 pm EDT, + last_published_at_utc: null, + name: null, + object: action_type, + on: null, + params: null, + params_draft: null, + primary_category: null, + required_app_connection: null, + secondary_category: null, + source: null, + type: null, + updated_at: null, + updated_at_string: May 24, 2025 03:06 pm EDT, + updated_at_utc: null, + url: null, + url_draft: null, + wait_for_callback: null, + form: null, + form_draft: null, + response_data_schema: null, + response_data_schema_draft: null +) +``` + diff --git a/docs/ListActionTypes200ResponseMeta.md b/docs/ListActionTypes200ResponseMeta.md new file mode 100644 index 0000000..b44119d --- /dev/null +++ b/docs/ListActionTypes200ResponseMeta.md @@ -0,0 +1,22 @@ +# EmbedWorkflow::ListActionTypes200ResponseMeta + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **page_limit** | **Integer** | | [optional] | +| **has_next_page** | **Boolean** | | [optional] | +| **has_previous_page** | **Boolean** | | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListActionTypes200ResponseMeta.new( + page_limit: null, + has_next_page: null, + has_previous_page: null +) +``` + diff --git a/docs/ListActions200Response.md b/docs/ListActions200Response.md new file mode 100644 index 0000000..e6bb34e --- /dev/null +++ b/docs/ListActions200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListActions200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ListActions200ResponseCollectionInner>**](ListActions200ResponseCollectionInner.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListActions200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListActions200ResponseCollectionInner.md b/docs/ListActions200ResponseCollectionInner.md new file mode 100644 index 0000000..74ddcb3 --- /dev/null +++ b/docs/ListActions200ResponseCollectionInner.md @@ -0,0 +1,58 @@ +# EmbedWorkflow::ListActions200ResponseCollectionInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **hashid** | **String** | System-generated unique identifier | [optional] | +| **completed_at** | **String** | Completed at in specified timezone | [optional] | +| **completed_at_string** | **String** | Completed at formatted as human-readable string | [optional] | +| **completed_at_utc** | **String** | Completed at in UTC | [optional] | +| **execution_id** | **String** | ID of the execution this action belongs to | [optional] | +| **failed_at** | **String** | Failed at in specified timezone | [optional] | +| **failed_at_string** | **String** | Failed at formatted as human-readable string | [optional] | +| **failed_at_utc** | **String** | Failed at in UTC | [optional] | +| **failure_note** | **String** | Error message when action fails | [optional] | +| **log** | **Object** | Execution log details for the action | [optional] | +| **name** | **String** | Name of the action | [optional] | +| **node_id** | **String** | Node identifier associated with this action | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **run_at** | **String** | Run at in specified timezone | [optional] | +| **run_at_string** | **String** | Run at formatted as human-readable string | [optional] | +| **run_at_utc** | **String** | Run at in UTC | [optional] | +| **status** | **String** | Current status of the action | [optional] | +| **stopped_at** | **String** | Stopped at in specified timezone | [optional] | +| **stopped_at_string** | **String** | Stopped at formatted as human-readable string | [optional] | +| **stopped_at_utc** | **String** | Stopped at in UTC | [optional] | +| **uuid** | **String** | UUID identifier for the action | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListActions200ResponseCollectionInner.new( + hashid: null, + completed_at: null, + completed_at_string: May 24, 2025 03:06 pm EDT, + completed_at_utc: null, + execution_id: null, + failed_at: null, + failed_at_string: May 24, 2025 03:06 pm EDT, + failed_at_utc: null, + failure_note: Server Error, + log: null, + name: null, + node_id: null, + object: action, + run_at: null, + run_at_string: May 24, 2025 03:06 pm EDT, + run_at_utc: null, + status: null, + stopped_at: null, + stopped_at_string: May 24, 2025 03:06 pm EDT, + stopped_at_utc: null, + uuid: null +) +``` + diff --git a/docs/ListAppConnections200Response.md b/docs/ListAppConnections200Response.md new file mode 100644 index 0000000..ad0ca9f --- /dev/null +++ b/docs/ListAppConnections200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListAppConnections200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ListAppConnections200ResponseCollectionInner>**](ListAppConnections200ResponseCollectionInner.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListAppConnections200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListAppConnections200ResponseCollectionInner.md b/docs/ListAppConnections200ResponseCollectionInner.md new file mode 100644 index 0000000..8bae03a --- /dev/null +++ b/docs/ListAppConnections200ResponseCollectionInner.md @@ -0,0 +1,32 @@ +# EmbedWorkflow::ListAppConnections200ResponseCollectionInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | [optional] | +| **app_type** | **String** | Type of application being connected | [optional] | +| **last_used_at** | **String** | Last used at in specified timezone | [optional] | +| **last_used_at_string** | **String** | Last used at formatted as human-readable string | [optional] | +| **last_used_at_utc** | **String** | Last used at in UTC | [optional] | +| **name** | **String** | Name of the app connection | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **status** | **String** | Current status of the app connection | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListAppConnections200ResponseCollectionInner.new( + id: null, + app_type: null, + last_used_at: null, + last_used_at_string: May 24, 2025 03:06 pm EDT, + last_used_at_utc: null, + name: null, + object: app_connection, + status: null +) +``` + diff --git a/docs/ListAvailableApps200Response.md b/docs/ListAvailableApps200Response.md new file mode 100644 index 0000000..28ebc87 --- /dev/null +++ b/docs/ListAvailableApps200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListAvailableApps200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ListAvailableApps200ResponseCollectionInner>**](ListAvailableApps200ResponseCollectionInner.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListAvailableApps200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListAvailableApps200ResponseCollectionInner.md b/docs/ListAvailableApps200ResponseCollectionInner.md new file mode 100644 index 0000000..8918917 --- /dev/null +++ b/docs/ListAvailableApps200ResponseCollectionInner.md @@ -0,0 +1,32 @@ +# EmbedWorkflow::ListAvailableApps200ResponseCollectionInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the app | [optional] | +| **app_identifier** | **String** | Unique identifier for the app | [optional] | +| **description** | **String** | Description of the available app | [optional] | +| **icon** | **Object** | Icon configuration for the available app | [optional] | +| **latest_version** | **String** | Latest available version of the app | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **primary_category** | **String** | Primary category classification for the app | [optional] | +| **secondary_category** | **String** | Secondary category classification for the app | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListAvailableApps200ResponseCollectionInner.new( + name: null, + app_identifier: null, + description: null, + icon: null, + latest_version: null, + object: available_app, + primary_category: null, + secondary_category: null +) +``` + diff --git a/docs/ListDataFields200Response.md b/docs/ListDataFields200Response.md new file mode 100644 index 0000000..ebf88e2 --- /dev/null +++ b/docs/ListDataFields200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListDataFields200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ListDataFields200ResponseCollectionInner>**](ListDataFields200ResponseCollectionInner.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListDataFields200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListDataFields200ResponseCollectionInner.md b/docs/ListDataFields200ResponseCollectionInner.md new file mode 100644 index 0000000..0b5eef9 --- /dev/null +++ b/docs/ListDataFields200ResponseCollectionInner.md @@ -0,0 +1,46 @@ +# EmbedWorkflow::ListDataFields200ResponseCollectionInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **variable** | **String** | Variable name used in templates | [optional] | +| **data_path** | **String** | Path to the data within the structure | [optional] | +| **display_label** | **String** | Display label for the data type | [optional] | +| **format** | **String** | Format specification for the data type | [optional] | +| **groups** | **Array<String>** | Permission groups for this data type | [optional] | +| **item_type** | **String** | Type of each item in a List (e.g., 'Object', 'String', 'Integer') | [optional] | +| **iterator** | **String** | Variable name for the current item when iterating over a List | [optional] | +| **list_values_variable** | **String** | Variable name for list values | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **required** | **Boolean** | Whether this data type is required | [optional] | +| **secret** | **Boolean** | Whether this field value should be redacted in logs and API responses | [optional] | +| **source** | **String** | Source identifier for the data type | [optional] | +| **type** | **String** | Data type identifier | [optional] | +| **value** | **String** | Default or current value | [optional] | +| **children** | **Array<Object>** | Nested schema definitions. For arrays: single element defining item type. For objects: multiple elements defining properties | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListDataFields200ResponseCollectionInner.new( + variable: null, + data_path: null, + display_label: null, + format: null, + groups: null, + item_type: null, + iterator: null, + list_values_variable: null, + object: data_type, + required: null, + secret: null, + source: null, + type: null, + value: null, + children: null +) +``` + diff --git a/docs/ListDataFieldsTypeParameter.md b/docs/ListDataFieldsTypeParameter.md new file mode 100644 index 0000000..f262fa8 --- /dev/null +++ b/docs/ListDataFieldsTypeParameter.md @@ -0,0 +1,49 @@ +# EmbedWorkflow::ListDataFieldsTypeParameter + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'embed_workflow' + +EmbedWorkflow::ListDataFieldsTypeParameter.openapi_one_of +# => +# [ +# :'Array', +# :'String' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'embed_workflow' + +EmbedWorkflow::ListDataFieldsTypeParameter.build(data) +# => #:0x00007fdd4aab02a0> + +EmbedWorkflow::ListDataFieldsTypeParameter.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Array` +- `String` +- `nil` (if no type matches) + diff --git a/docs/ListEvents200Response.md b/docs/ListEvents200Response.md new file mode 100644 index 0000000..36f6345 --- /dev/null +++ b/docs/ListEvents200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListEvents200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ListEvents200ResponseCollectionInner>**](ListEvents200ResponseCollectionInner.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListEvents200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListEvents200ResponseCollectionInner.md b/docs/ListEvents200ResponseCollectionInner.md new file mode 100644 index 0000000..83ebc9b --- /dev/null +++ b/docs/ListEvents200ResponseCollectionInner.md @@ -0,0 +1,36 @@ +# EmbedWorkflow::ListEvents200ResponseCollectionInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | [optional] | +| **ended_at** | **String** | Ended at in specified timezone | [optional] | +| **ended_at_string** | **String** | Ended at formatted as human-readable string | [optional] | +| **ended_at_utc** | **String** | Ended at in UTC | [optional] | +| **event_type** | **String** | Type of event that occurred | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **response_body** | **String** | Response body from the event | [optional] | +| **started_at** | **String** | Started at in specified timezone | [optional] | +| **started_at_string** | **String** | Started at formatted as human-readable string | [optional] | +| **started_at_utc** | **String** | Started at in UTC | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListEvents200ResponseCollectionInner.new( + id: null, + ended_at: null, + ended_at_string: May 24, 2025 03:06 pm EDT, + ended_at_utc: null, + event_type: null, + object: event, + response_body: null, + started_at: null, + started_at_string: May 24, 2025 03:06 pm EDT, + started_at_utc: null +) +``` + diff --git a/docs/ListInstalledApps200Response.md b/docs/ListInstalledApps200Response.md new file mode 100644 index 0000000..c0cce96 --- /dev/null +++ b/docs/ListInstalledApps200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListInstalledApps200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ListInstalledApps200ResponseCollectionInner>**](ListInstalledApps200ResponseCollectionInner.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListInstalledApps200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListInstalledApps200ResponseCollectionInner.md b/docs/ListInstalledApps200ResponseCollectionInner.md new file mode 100644 index 0000000..fd9b5d0 --- /dev/null +++ b/docs/ListInstalledApps200ResponseCollectionInner.md @@ -0,0 +1,48 @@ +# EmbedWorkflow::ListInstalledApps200ResponseCollectionInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | [optional] | +| **app_identifier** | **String** | Unique identifier for the app | [optional] | +| **app_version** | **String** | Currently installed version of the app | [optional] | +| **available_version** | **String** | Latest available version of the app | [optional] | +| **groups** | **Array<String>** | Permission groups that can access this app | [optional] | +| **icon** | **Object** | Icon configuration for the installed app | [optional] | +| **last_used_at** | **String** | Last used at in specified timezone | [optional] | +| **last_used_at_string** | **String** | Last used at formatted as human-readable string | [optional] | +| **last_used_at_utc** | **String** | Last used at in UTC | [optional] | +| **name** | **String** | Display name of the installed app | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **previous_version** | **String** | Previously installed version of the app | [optional] | +| **upgrade_available** | **Boolean** | Whether an upgrade is available for this app | [optional] | +| **upgraded_at** | **String** | Upgraded at in specified timezone | [optional] | +| **upgraded_at_string** | **String** | Upgraded at formatted as human-readable string | [optional] | +| **upgraded_at_utc** | **String** | Upgraded at in UTC | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListInstalledApps200ResponseCollectionInner.new( + id: null, + app_identifier: null, + app_version: null, + available_version: null, + groups: null, + icon: null, + last_used_at: null, + last_used_at_string: May 24, 2025 03:06 pm EDT, + last_used_at_utc: null, + name: null, + object: installed_app, + previous_version: null, + upgrade_available: null, + upgraded_at: null, + upgraded_at_string: May 24, 2025 03:06 pm EDT, + upgraded_at_utc: null +) +``` + diff --git a/docs/ListTriggers200Response.md b/docs/ListTriggers200Response.md new file mode 100644 index 0000000..d88fa98 --- /dev/null +++ b/docs/ListTriggers200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListTriggers200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ListTriggers200ResponseCollectionInner>**](ListTriggers200ResponseCollectionInner.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListTriggers200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListTriggers200ResponseCollectionInner.md b/docs/ListTriggers200ResponseCollectionInner.md new file mode 100644 index 0000000..bbe0358 --- /dev/null +++ b/docs/ListTriggers200ResponseCollectionInner.md @@ -0,0 +1,50 @@ +# EmbedWorkflow::ListTriggers200ResponseCollectionInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | [optional] | +| **created_at** | **String** | Created at in specified timezone | [optional] | +| **created_at_string** | **String** | Created at formatted as human-readable string | [optional] | +| **created_at_utc** | **String** | Created at in UTC | [optional] | +| **description** | **String** | Short description for the trigger | [optional] | +| **event** | **String** | Event type that activates this trigger | [optional] | +| **groups** | **Array<String>** | Permission groups for this trigger | [optional] | +| **hook_id** | **String** | Hook identifier for the trigger | [optional] | +| **icon** | **Object** | Icon configuration for the trigger | [optional] | +| **last_triggered_at** | **String** | Last triggered at in specified timezone | [optional] | +| **last_triggered_at_string** | **String** | Last triggered at formatted as human-readable string | [optional] | +| **last_triggered_at_utc** | **String** | Last triggered at in UTC | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **on** | **Boolean** | Whether the trigger is enabled | [optional] | +| **processed_count** | **Integer** | Number of times this trigger has been processed | [optional] | +| **title** | **String** | Display title for the trigger | [optional] | +| **data_input_schema** | **Array<Object>** | Data input schema for the trigger | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListTriggers200ResponseCollectionInner.new( + id: null, + created_at: null, + created_at_string: May 24, 2025 03:06 pm EDT, + created_at_utc: null, + description: null, + event: null, + groups: null, + hook_id: null, + icon: null, + last_triggered_at: null, + last_triggered_at_string: May 24, 2025 03:06 pm EDT, + last_triggered_at_utc: null, + object: trigger, + on: null, + processed_count: null, + title: null, + data_input_schema: null +) +``` + diff --git a/docs/ListUsers200Response.md b/docs/ListUsers200Response.md new file mode 100644 index 0000000..db417e6 --- /dev/null +++ b/docs/ListUsers200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListUsers200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ListUsers200ResponseCollectionInner>**](ListUsers200ResponseCollectionInner.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListUsers200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListUsers200ResponseCollectionInner.md b/docs/ListUsers200ResponseCollectionInner.md new file mode 100644 index 0000000..3cf7c8d --- /dev/null +++ b/docs/ListUsers200ResponseCollectionInner.md @@ -0,0 +1,38 @@ +# EmbedWorkflow::ListUsers200ResponseCollectionInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key** | **String** | Unique identifier for the user | [optional] | +| **created_at** | **String** | Created at in specified timezone | [optional] | +| **created_at_string** | **String** | Created at formatted as human-readable string | [optional] | +| **created_at_utc** | **String** | Created at in UTC | [optional] | +| **email** | **String** | User's email address | [optional] | +| **groups** | **Array<String>** | Permission groups the user belongs to | [optional] | +| **id** | **String** | System-generated unique identifier | [optional] | +| **name** | **String** | User's display name | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **time_zone** | **String** | Time zone setting for the user in IANA timezone format (e.g. 'America/New_York', 'Europe/London', 'Asia/Tokyo', 'Etc/UTC') | [optional] | +| **user_data_schema** | **Array<Object>** | User's data schema configuration | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListUsers200ResponseCollectionInner.new( + key: null, + created_at: null, + created_at_string: May 24, 2025 03:06 pm EDT, + created_at_utc: null, + email: null, + groups: null, + id: null, + name: null, + object: user, + time_zone: null, + user_data_schema: null +) +``` + diff --git a/docs/ListWorkflowExecutions200Response.md b/docs/ListWorkflowExecutions200Response.md new file mode 100644 index 0000000..c016ad9 --- /dev/null +++ b/docs/ListWorkflowExecutions200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListWorkflowExecutions200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ExecuteWorkflow201Response>**](ExecuteWorkflow201Response.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListWorkflowExecutions200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListWorkflowVersions200Response.md b/docs/ListWorkflowVersions200Response.md new file mode 100644 index 0000000..2a16916 --- /dev/null +++ b/docs/ListWorkflowVersions200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListWorkflowVersions200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ListWorkflowVersions200ResponseCollectionInner>**](ListWorkflowVersions200ResponseCollectionInner.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListWorkflowVersions200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListWorkflowVersions200ResponseCollectionInner.md b/docs/ListWorkflowVersions200ResponseCollectionInner.md new file mode 100644 index 0000000..b0cc81c --- /dev/null +++ b/docs/ListWorkflowVersions200ResponseCollectionInner.md @@ -0,0 +1,30 @@ +# EmbedWorkflow::ListWorkflowVersions200ResponseCollectionInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | [optional] | +| **created_at** | **String** | Created at in specified timezone | [optional] | +| **created_at_string** | **String** | Created at formatted as human-readable string | [optional] | +| **created_at_utc** | **String** | Created at in UTC | [optional] | +| **event** | **String** | The event that created this version | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **resource_type** | **String** | Type of resource this version belongs to | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListWorkflowVersions200ResponseCollectionInner.new( + id: null, + created_at: null, + created_at_string: May 24, 2025 03:06 pm EDT, + created_at_utc: null, + event: null, + object: version, + resource_type: null +) +``` + diff --git a/docs/ListWorkflows200Response.md b/docs/ListWorkflows200Response.md new file mode 100644 index 0000000..75e932f --- /dev/null +++ b/docs/ListWorkflows200Response.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::ListWorkflows200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | [**Array<ListWorkflows200ResponseCollectionInner>**](ListWorkflows200ResponseCollectionInner.md) | | | +| **meta** | [**ListActionTypes200ResponseMeta**](ListActionTypes200ResponseMeta.md) | | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListWorkflows200Response.new( + collection: null, + meta: null +) +``` + diff --git a/docs/ListWorkflows200ResponseCollectionInner.md b/docs/ListWorkflows200ResponseCollectionInner.md new file mode 100644 index 0000000..6460536 --- /dev/null +++ b/docs/ListWorkflows200ResponseCollectionInner.md @@ -0,0 +1,76 @@ +# EmbedWorkflow::ListWorkflows200ResponseCollectionInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier | [optional] | +| **action_type_ids** | **Array<String>** | Action type IDs used in this workflow's template | [optional] | +| **actions_count** | **Integer** | Number of actions in the workflow | [optional] | +| **created_at** | **String** | Created at in specified timezone | [optional] | +| **created_at_string** | **String** | Created at formatted as human-readable string | [optional] | +| **created_at_utc** | **String** | Created at in UTC | [optional] | +| **description** | **String** | Description of the workflow | [optional] | +| **event_trigger** | **Object** | Event trigger configuration | [optional] | +| **event_trigger_draft** | **Object** | Draft event trigger configuration | [optional] | +| **executions_count** | **Integer** | Number of times workflow has been executed | [optional] | +| **has_draft** | **Boolean** | Whether the workflow has unsaved draft changes | [optional] | +| **is_managed** | **Boolean** | Whether this workflow is managed by the account and read-only | [optional] | +| **key** | **String** | Unique key for the workflow | [optional] | +| **last_executed_at** | **String** | Last executed at in specified timezone | [optional] | +| **last_executed_at_string** | **String** | Last executed at formatted as human-readable string | [optional] | +| **last_executed_at_utc** | **String** | Last executed at in UTC | [optional] | +| **last_published_at** | **String** | Last published at in specified timezone | [optional] | +| **last_published_at_string** | **String** | Last published at formatted as human-readable string | [optional] | +| **last_published_at_utc** | **String** | Last published at in UTC | [optional] | +| **match_conditions** | **Object** | Conditions for matching workflow execution | [optional] | +| **match_conditions_draft** | **Object** | Draft conditions for matching workflow execution | [optional] | +| **name** | **String** | Name of the workflow | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **on** | **Boolean** | Whether the workflow is enabled | [optional] | +| **status** | **String** | Current status of the workflow | [optional] | +| **trigger_conditions** | **Hash<String, Object>** | Conditions for triggering the workflow | [optional] | +| **trigger_conditions_draft** | **Hash<String, Object>** | Draft conditions for triggering the workflow | [optional] | +| **updated_at** | **String** | Updated at in specified timezone | [optional] | +| **updated_at_string** | **String** | Updated at formatted as human-readable string | [optional] | +| **updated_at_utc** | **String** | Updated at in UTC | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::ListWorkflows200ResponseCollectionInner.new( + id: 01970396-e105-7bbc-ae46-591765fbaa72, + action_type_ids: ["abc123","def456"], + actions_count: 0, + created_at: null, + created_at_string: May 24, 2025 03:06 pm EDT, + created_at_utc: null, + description: Welcome workflow for new users, + event_trigger: null, + event_trigger_draft: null, + executions_count: 0, + has_draft: null, + is_managed: null, + key: workflow_3, + last_executed_at: null, + last_executed_at_string: May 24, 2025 03:06 pm EDT, + last_executed_at_utc: null, + last_published_at: null, + last_published_at_string: May 24, 2025 03:06 pm EDT, + last_published_at_utc: null, + match_conditions: null, + match_conditions_draft: null, + name: Workflow 3, + object: workflow, + on: null, + status: off, + trigger_conditions: {}, + trigger_conditions_draft: {}, + updated_at: null, + updated_at_string: May 24, 2025 03:06 pm EDT, + updated_at_utc: null +) +``` + diff --git a/docs/PaymentsApi.md b/docs/PaymentsApi.md new file mode 100644 index 0000000..e4170da --- /dev/null +++ b/docs/PaymentsApi.md @@ -0,0 +1,81 @@ +# EmbedWorkflow::PaymentsApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**list_payments**](PaymentsApi.md#list_payments) | **GET** /api/v1/payments | List payments | + + +## list_payments + +> list_payments(opts) + +List payments + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::PaymentsApi.new +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25 # Integer | Number of items to return (max 100) +} + +begin + # List payments + result = api_instance.list_payments(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling PaymentsApi->list_payments: #{e}" +end +``` + +#### Using the list_payments_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_payments_with_http_info(opts) + +```ruby +begin + # List payments + data, status_code, headers = api_instance.list_payments_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling PaymentsApi->list_payments_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | + +### Return type + +[**ListEvents200Response**](ListEvents200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/PublishWorkflowRequest.md b/docs/PublishWorkflowRequest.md new file mode 100644 index 0000000..8ad53ad --- /dev/null +++ b/docs/PublishWorkflowRequest.md @@ -0,0 +1,18 @@ +# EmbedWorkflow::PublishWorkflowRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user_key** | **String** | User's key | [optional][default to 'main'] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::PublishWorkflowRequest.new( + user_key: null +) +``` + diff --git a/docs/RetrieveAccount200Response.md b/docs/RetrieveAccount200Response.md new file mode 100644 index 0000000..3d57681 --- /dev/null +++ b/docs/RetrieveAccount200Response.md @@ -0,0 +1,46 @@ +# EmbedWorkflow::RetrieveAccount200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **action_type_categories** | **Array<Object>** | Available action type categories for the account | [optional] | +| **action_type_categories_enabled** | **Boolean** | Whether action type categories are enabled for display | [optional] | +| **company_name** | **String** | Company name associated with the account | [optional] | +| **custom_domain** | **String** | Custom domain for the account | [optional] | +| **data** | **Hash<String, Object>** | Additional account data | [optional] | +| **groups** | **Array<String>** | Permission groups for the account | [optional] | +| **id** | **String** | System-generated unique identifier | [optional] | +| **level** | **Integer** | Account level or tier | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **theme** | **String** | Theme setting for the account | [optional] | +| **time_zone** | **String** | Time zone setting for the account in IANA timezone format (e.g. 'America/New_York', 'Europe/London', 'Asia/Tokyo', 'Etc/UTC') | [optional] | +| **user_name** | **String** | User name from context | [optional] | +| **user_time_zone** | **String** | Time zone setting for the user in IANA timezone format (e.g. 'America/New_York', 'Europe/London', 'Asia/Tokyo', 'Etc/UTC') | [optional] | +| **data_schema** | **Array<Object>** | Account data schema | [optional] | +| **user_data_schema** | **Array<Object>** | User data schema for the account | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::RetrieveAccount200Response.new( + action_type_categories: null, + action_type_categories_enabled: null, + company_name: null, + custom_domain: null, + data: null, + groups: null, + id: null, + level: null, + object: account, + theme: null, + time_zone: null, + user_name: null, + user_time_zone: null, + data_schema: null, + user_data_schema: null +) +``` + diff --git a/docs/RetrieveAccountUsage200Response.md b/docs/RetrieveAccountUsage200Response.md new file mode 100644 index 0000000..9ca62a1 --- /dev/null +++ b/docs/RetrieveAccountUsage200Response.md @@ -0,0 +1,30 @@ +# EmbedWorkflow::RetrieveAccountUsage200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **active_workflows_count** | **Integer** | Number of active workflows (on: true) | [optional] | +| **end_time** | **String** | End of the usage period (ISO 8601 format) | [optional] | +| **executions_count** | **Integer** | Number of executions in the specified time period | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **start_time** | **String** | Start of the usage period (ISO 8601 format) | [optional] | +| **usage** | **Integer** | Total number of actions in the specified time period | [optional] | +| **users_count** | **Integer** | Total number of users in the account | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::RetrieveAccountUsage200Response.new( + active_workflows_count: 42, + end_time: 2024-01-31T23:59:59Z, + executions_count: 847, + object: usage, + start_time: 2024-01-01T00:00:00Z, + usage: 1523, + users_count: 150 +) +``` + diff --git a/docs/RetrieveAvailableApp200Response.md b/docs/RetrieveAvailableApp200Response.md new file mode 100644 index 0000000..f7c6de9 --- /dev/null +++ b/docs/RetrieveAvailableApp200Response.md @@ -0,0 +1,34 @@ +# EmbedWorkflow::RetrieveAvailableApp200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the app | [optional] | +| **app_identifier** | **String** | Unique identifier for the app | [optional] | +| **description** | **String** | Description of the available app | [optional] | +| **icon** | **Object** | Icon configuration for the available app | [optional] | +| **latest_version** | **String** | Latest available version of the app | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **primary_category** | **String** | Primary category classification for the app | [optional] | +| **schema** | **Hash<String, Object>** | App schema configuration | [optional] | +| **secondary_category** | **String** | Secondary category classification for the app | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::RetrieveAvailableApp200Response.new( + name: null, + app_identifier: null, + description: null, + icon: null, + latest_version: null, + object: available_app, + primary_category: null, + schema: null, + secondary_category: null +) +``` + diff --git a/docs/RetrieveExecution200Response.md b/docs/RetrieveExecution200Response.md new file mode 100644 index 0000000..afc1946 --- /dev/null +++ b/docs/RetrieveExecution200Response.md @@ -0,0 +1,54 @@ +# EmbedWorkflow::RetrieveExecution200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **hashid** | **String** | System-generated unique identifier | [optional] | +| **actions_count** | **Integer** | Total number of actions in the execution | [optional] | +| **completed_actions_count** | **Integer** | Number of completed actions | [optional] | +| **created_at** | **String** | Created at in specified timezone | [optional] | +| **created_at_string** | **String** | Created at formatted as human-readable string | [optional] | +| **created_at_utc** | **String** | Created at in UTC | [optional] | +| **execution_data** | **Hash<String, Object>** | Data context for the execution | [optional] | +| **failed_actions_count** | **Integer** | Number of failed actions | [optional] | +| **id** | **String** | System-generated unique identifier | [optional] | +| **idle_actions_count** | **Integer** | Number of idle actions | [optional] | +| **key** | **String** | Unique key for the execution | [optional] | +| **log** | **Object** | Execution log details | [optional] | +| **name** | **String** | Name of the execution | [optional] | +| **object** | **String** | Object type identifier | [optional] | +| **running_actions_count** | **Integer** | Number of currently running actions | [optional] | +| **stats** | **Hash<String, Object>** | Execution statistics | [optional] | +| **status** | **String** | Current status of the execution | [optional] | +| **stopped_actions_count** | **Integer** | Number of stopped actions | [optional] | +| **template** | **Object** | Template layout for the execution | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::RetrieveExecution200Response.new( + hashid: null, + actions_count: null, + completed_actions_count: null, + created_at: null, + created_at_string: May 24, 2025 03:06 pm EDT, + created_at_utc: null, + execution_data: null, + failed_actions_count: null, + id: null, + idle_actions_count: null, + key: null, + log: null, + name: null, + object: execution, + running_actions_count: null, + stats: null, + status: null, + stopped_actions_count: null, + template: null +) +``` + diff --git a/docs/RetryActionRequest.md b/docs/RetryActionRequest.md new file mode 100644 index 0000000..1e2bfa2 --- /dev/null +++ b/docs/RetryActionRequest.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::RetryActionRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user_key** | **String** | User's key | [default to 'main'] | +| **hook_id** | **String** | The trigger's hook id used for third party webhooks. | | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::RetryActionRequest.new( + user_key: null, + hook_id: 0197053c-1672-7132-b9e9-4c2033a26ac7 +) +``` + diff --git a/docs/StopExecutionsRequest.md b/docs/StopExecutionsRequest.md new file mode 100644 index 0000000..ac6bfd0 --- /dev/null +++ b/docs/StopExecutionsRequest.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::StopExecutionsRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user_key** | **String** | User's key | [default to 'main'] | +| **filters** | **String** | Data to filter | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::StopExecutionsRequest.new( + user_key: null, + filters: {"anything":"you_are_looking_for"} +) +``` + diff --git a/docs/TriggerWorkflowRequest.md b/docs/TriggerWorkflowRequest.md new file mode 100644 index 0000000..c700c95 --- /dev/null +++ b/docs/TriggerWorkflowRequest.md @@ -0,0 +1,26 @@ +# EmbedWorkflow::TriggerWorkflowRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user_key** | **String** | User's key | [optional][default to 'main'] | +| **execution_data** | **Hash<String, Object>** | Data required to execute the workflow. Key-value pairs that provide context and variables needed during workflow execution. | [optional] | +| **event** | **String** | The trigger's key | [optional] | +| **workflow_ids** | **Array<String>** | Array of workflow ids. | [optional] | +| **workflow_keys** | **Array<String>** | Array of workflow keys. | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::TriggerWorkflowRequest.new( + user_key: null, + execution_data: {"user_name":"John Doe","company_id":"abc123","custom_field":"some value"}, + event: new-lead, + workflow_ids: ["01970537-71e0-7361-882d-0c0c003e9169","01970537-7475-7efb-b990-3f66ce371370"], + workflow_keys: ["workflow-a","workflow-b"] +) +``` + diff --git a/docs/TriggersApi.md b/docs/TriggersApi.md new file mode 100644 index 0000000..0a1f91b --- /dev/null +++ b/docs/TriggersApi.md @@ -0,0 +1,289 @@ +# EmbedWorkflow::TriggersApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**delete_trigger**](TriggersApi.md#delete_trigger) | **DELETE** /api/v1/triggers/{id} | Delete trigger | +| [**list_triggers**](TriggersApi.md#list_triggers) | **GET** /api/v1/triggers | List triggers | +| [**retrieve_trigger**](TriggersApi.md#retrieve_trigger) | **GET** /api/v1/triggers/{id} | Retrieve trigger | +| [**update_trigger**](TriggersApi.md#update_trigger) | **PUT** /api/v1/triggers/{id} | Update trigger | + + +## delete_trigger + +> delete_trigger(id) + +Delete trigger + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::TriggersApi.new +id = 'id_example' # String | System-generated unique identifier + +begin + # Delete trigger + result = api_instance.delete_trigger(id) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling TriggersApi->delete_trigger: #{e}" +end +``` + +#### Using the delete_trigger_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> delete_trigger_with_http_info(id) + +```ruby +begin + # Delete trigger + data, status_code, headers = api_instance.delete_trigger_with_http_info(id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling TriggersApi->delete_trigger_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | + +### Return type + +[**DeleteActionType200Response**](DeleteActionType200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_triggers + +> list_triggers(opts) + +List triggers + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::TriggersApi.new +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25 # Integer | Number of items to return (max 100) +} + +begin + # List triggers + result = api_instance.list_triggers(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling TriggersApi->list_triggers: #{e}" +end +``` + +#### Using the list_triggers_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_triggers_with_http_info(opts) + +```ruby +begin + # List triggers + data, status_code, headers = api_instance.list_triggers_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling TriggersApi->list_triggers_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | + +### Return type + +[**ListTriggers200Response**](ListTriggers200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## retrieve_trigger + +> retrieve_trigger(id) + +Retrieve trigger + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::TriggersApi.new +id = 'id_example' # String | System-generated unique identifier + +begin + # Retrieve trigger + result = api_instance.retrieve_trigger(id) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling TriggersApi->retrieve_trigger: #{e}" +end +``` + +#### Using the retrieve_trigger_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> retrieve_trigger_with_http_info(id) + +```ruby +begin + # Retrieve trigger + data, status_code, headers = api_instance.retrieve_trigger_with_http_info(id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling TriggersApi->retrieve_trigger_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | + +### Return type + +[**ListTriggers200ResponseCollectionInner**](ListTriggers200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_trigger + +> update_trigger(id, opts) + +Update trigger + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::TriggersApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + update_trigger_request: EmbedWorkflow::UpdateTriggerRequest.new # UpdateTriggerRequest | +} + +begin + # Update trigger + result = api_instance.update_trigger(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling TriggersApi->update_trigger: #{e}" +end +``` + +#### Using the update_trigger_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_trigger_with_http_info(id, opts) + +```ruby +begin + # Update trigger + data, status_code, headers = api_instance.update_trigger_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling TriggersApi->update_trigger_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **update_trigger_request** | [**UpdateTriggerRequest**](UpdateTriggerRequest.md) | | [optional] | + +### Return type + +[**ListTriggers200ResponseCollectionInner**](ListTriggers200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/UpdateAccountRequest.md b/docs/UpdateAccountRequest.md new file mode 100644 index 0000000..a30c909 --- /dev/null +++ b/docs/UpdateAccountRequest.md @@ -0,0 +1,38 @@ +# EmbedWorkflow::UpdateAccountRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **company_name** | **String** | Company name associated with the account | [optional] | +| **user_name** | **String** | User name for the account | [optional] | +| **theme** | **String** | Theme setting for the account | [optional] | +| **time_zone** | **String** | Time zone setting for the account | [optional] | +| **custom_domain** | **String** | Custom domain for the account | [optional] | +| **groups** | **Array<String>** | User permission groups. Only available to users with admin role. | [optional] | +| **action_type_categories_enabled** | **Boolean** | Enable or disable action type categories display | [optional][default to false] | +| **action_type_categories** | [**Array<UpdateAccountRequestActionTypeCategoriesInner>**](UpdateAccountRequestActionTypeCategoriesInner.md) | Action type categories for the account. | [optional] | +| **data** | **Hash<String, Object>** | Additional account data | [optional] | +| **user_data_schema** | [**Array<UpdateAccountRequestUserDataSchemaInner>**](UpdateAccountRequestUserDataSchemaInner.md) | Data schema configuration | [optional] | +| **data_schema** | [**Array<UpdateAccountRequestUserDataSchemaInner>**](UpdateAccountRequestUserDataSchemaInner.md) | Data schema configuration | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::UpdateAccountRequest.new( + company_name: null, + user_name: null, + theme: null, + time_zone: America/New_York, + custom_domain: mycompany.com, + groups: ["admins","leads"], + action_type_categories_enabled: null, + action_type_categories: [{"key":"flow_control","name":"Flow Control","description":"Logic, branching, and delays","icon":{"type":"arrows-right-left","background_color":"emerald"}},{"key":"communication","name":"Communication","description":"Messaging and email services","icon":{"type":"chat-bubble-left-right","background_color":"sky"}}], + data: null, + user_data_schema: null, + data_schema: null +) +``` + diff --git a/docs/UpdateAccountRequestActionTypeCategoriesInner.md b/docs/UpdateAccountRequestActionTypeCategoriesInner.md new file mode 100644 index 0000000..ff58345 --- /dev/null +++ b/docs/UpdateAccountRequestActionTypeCategoriesInner.md @@ -0,0 +1,24 @@ +# EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key** | **String** | Immutable category identifier | | +| **name** | **String** | Display name (user-editable) | | +| **description** | **String** | Short description (user-editable) | [optional] | +| **icon** | [**UpdateAccountRequestActionTypeCategoriesInnerIcon**](UpdateAccountRequestActionTypeCategoriesInnerIcon.md) | | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInner.new( + key: null, + name: null, + description: null, + icon: null +) +``` + diff --git a/docs/UpdateAccountRequestActionTypeCategoriesInnerIcon.md b/docs/UpdateAccountRequestActionTypeCategoriesInnerIcon.md new file mode 100644 index 0000000..bb5c2e1 --- /dev/null +++ b/docs/UpdateAccountRequestActionTypeCategoriesInnerIcon.md @@ -0,0 +1,22 @@ +# EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInnerIcon + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | | [optional] | +| **background_color** | **String** | | [optional] | +| **url** | **String** | | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInnerIcon.new( + type: null, + background_color: null, + url: null +) +``` + diff --git a/docs/UpdateAccountRequestUserDataSchemaInner.md b/docs/UpdateAccountRequestUserDataSchemaInner.md new file mode 100644 index 0000000..c691ea6 --- /dev/null +++ b/docs/UpdateAccountRequestUserDataSchemaInner.md @@ -0,0 +1,26 @@ +# EmbedWorkflow::UpdateAccountRequestUserDataSchemaInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **variable** | **String** | Variable name for the data field | | +| **data_path** | **String** | Path to the data within the structure | [optional] | +| **type** | **String** | Data type identifier | | +| **required** | **Boolean** | Whether this field is required | [optional] | +| **groups** | **Array<String>** | Permission groups for this data field | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::UpdateAccountRequestUserDataSchemaInner.new( + variable: null, + data_path: null, + type: null, + required: null, + groups: null +) +``` + diff --git a/docs/UpdateActionTypeRequest.md b/docs/UpdateActionTypeRequest.md new file mode 100644 index 0000000..43bdbc4 --- /dev/null +++ b/docs/UpdateActionTypeRequest.md @@ -0,0 +1,52 @@ +# EmbedWorkflow::UpdateActionTypeRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of resource | [optional] | +| **description** | **String** | Description of action type | [optional] | +| **on** | **Boolean** | Enable or disable the resource. | [optional][default to true] | +| **params_draft** | **String** | HTTP parameters as key:value pairs, one per line | [optional] | +| **headers_draft** | **String** | HTTP headers as key:value pairs, one per line | [optional] | +| **url_draft** | **String** | HTTP url | [optional] | +| **http_method_draft** | **String** | HTTP method | [optional] | +| **code_draft** | **String** | JavaScript code snippt | [optional] | +| **form_draft** | [**Array<CreateActionTypeRequestFormDraftInner>**](CreateActionTypeRequestFormDraftInner.md) | Form field configuration | [optional] | +| **response_data_schema_draft** | [**Array<UpdateAccountRequestUserDataSchemaInner>**](UpdateAccountRequestUserDataSchemaInner.md) | Data schema configuration | [optional] | +| **groups** | **Array<String>** | User permission groups. Only available to users with admin role. | [optional] | +| **icon_draft** | [**CreateActionTypeRequestIconDraft**](CreateActionTypeRequestIconDraft.md) | | [optional] | +| **primary_category** | **String** | Primary category for the action type | [optional] | +| **secondary_category** | **String** | Secondary category for the action type | [optional] | +| **wait_for_callback** | **Boolean** | When true, actions fire the webhook but wait for an external callback before completing | [optional][default to false] | +| **callback_timeout_n** | **Integer** | Callback timeout duration value | [optional] | +| **callback_timeout_unit** | **String** | Callback timeout duration unit (sec, min, hour, day, week, month, year) | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::UpdateActionTypeRequest.new( + name: null, + description: Sends an email, + on: false, + params_draft: name:John +email:john@example.com, + headers_draft: Authorization:Bearer {{ api_key }} +Content-Type:application/json, + url_draft: https://{{base_url}}/cool_action, + http_method_draft: post, + code_draft: null, + form_draft: [{"id":"user_name","name":"user_name","required":true,"label":"Full Name","description":"Enter your full name","type":"text","data":{"max_length":100}},{"id":"user_email","name":"email","required":true,"label":"Email Address","type":"email","data":{}}], + response_data_schema_draft: null, + groups: ["admins","leads"], + icon_draft: null, + primary_category: flow_control, + secondary_category: communication, + wait_for_callback: null, + callback_timeout_n: null, + callback_timeout_unit: hour +) +``` + diff --git a/docs/UpdateInstalledAppRequest.md b/docs/UpdateInstalledAppRequest.md new file mode 100644 index 0000000..a08ab6d --- /dev/null +++ b/docs/UpdateInstalledAppRequest.md @@ -0,0 +1,18 @@ +# EmbedWorkflow::UpdateInstalledAppRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **groups** | **Array<String>** | User permission groups. Only available to users with admin role. | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::UpdateInstalledAppRequest.new( + groups: ["admins","leads"] +) +``` + diff --git a/docs/UpdateTriggerRequest.md b/docs/UpdateTriggerRequest.md new file mode 100644 index 0000000..bbe72d3 --- /dev/null +++ b/docs/UpdateTriggerRequest.md @@ -0,0 +1,20 @@ +# EmbedWorkflow::UpdateTriggerRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event** | **String** | The trigger's key | [optional] | +| **title** | **String** | Title | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::UpdateTriggerRequest.new( + event: new-lead, + title: Contact Registered +) +``` + diff --git a/docs/UpdateWorkflowRequest.md b/docs/UpdateWorkflowRequest.md new file mode 100644 index 0000000..063843b --- /dev/null +++ b/docs/UpdateWorkflowRequest.md @@ -0,0 +1,38 @@ +# EmbedWorkflow::UpdateWorkflowRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of resource | | +| **key** | **String** | Client-provided unique identifier | [optional] | +| **auto_clone_for_new_users** | **Boolean** | Mark workflow as default template. When true, new users will automatically receive a clone of this workflow (Admin only) | [optional][default to false] | +| **is_template** | **Boolean** | Mark workflow as a template. When true, new users will see this in a library of templates (Admin only) | [optional][default to false] | +| **on** | **Boolean** | Enable or disable the resource. | [optional][default to true] | +| **details** | **String** | Description of the resource | [optional] | +| **template_draft** | [**CreateWorkflowRequestTemplateDraft**](CreateWorkflowRequestTemplateDraft.md) | | [optional] | +| **trigger_conditions_draft** | **Object** | The trigger's conditions | [optional] | +| **event_trigger_draft** | **String** | The trigger's key | [optional] | +| **match_conditions_draft** | **String** | Whether all or any of the trigger conditions must match | [optional] | +| **groups** | **Array<String>** | User permission groups. Only available to users with admin role. | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::UpdateWorkflowRequest.new( + name: null, + key: my-workflow, + auto_clone_for_new_users: true, + is_template: true, + on: false, + details: null, + template_draft: null, + trigger_conditions_draft: null, + event_trigger_draft: new-lead, + match_conditions_draft: null, + groups: ["admins","leads"] +) +``` + diff --git a/docs/UpsertUserRequest.md b/docs/UpsertUserRequest.md new file mode 100644 index 0000000..8ea86e3 --- /dev/null +++ b/docs/UpsertUserRequest.md @@ -0,0 +1,26 @@ +# EmbedWorkflow::UpsertUserRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of resource | [optional] | +| **email** | **String** | Email address | [optional] | +| **data** | **Hash<String, Object>** | Additional user data | [optional] | +| **groups** | **Array<String>** | User permission groups. Only available to users with admin role. | [optional] | +| **time_zone** | **String** | Time zone | [optional] | + +## Example + +```ruby +require 'embed_workflow' + +instance = EmbedWorkflow::UpsertUserRequest.new( + name: null, + email: user@email.com, + data: null, + groups: ["admins","leads"], + time_zone: .... +) +``` + diff --git a/docs/UsersApi.md b/docs/UsersApi.md new file mode 100644 index 0000000..0871914 --- /dev/null +++ b/docs/UsersApi.md @@ -0,0 +1,361 @@ +# EmbedWorkflow::UsersApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_user_token**](UsersApi.md#create_user_token) | **POST** /api/v1/user_token | Create user token | +| [**delete_user**](UsersApi.md#delete_user) | **DELETE** /api/v1/users/{key} | Delete user | +| [**list_users**](UsersApi.md#list_users) | **GET** /api/v1/users | List users | +| [**retrieve_user**](UsersApi.md#retrieve_user) | **GET** /api/v1/users/{key} | Retrieve user | +| [**upsert_user**](UsersApi.md#upsert_user) | **PUT** /api/v1/users/{key} | Upsert user | + + +## create_user_token + +> create_user_token(opts) + +Create user token + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::UsersApi.new +opts = { + create_user_token_request: EmbedWorkflow::CreateUserTokenRequest.new # CreateUserTokenRequest | +} + +begin + # Create user token + result = api_instance.create_user_token(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling UsersApi->create_user_token: #{e}" +end +``` + +#### Using the create_user_token_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_user_token_with_http_info(opts) + +```ruby +begin + # Create user token + data, status_code, headers = api_instance.create_user_token_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling UsersApi->create_user_token_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_user_token_request** | [**CreateUserTokenRequest**](CreateUserTokenRequest.md) | | [optional] | + +### Return type + +[**CreateUserToken200Response**](CreateUserToken200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_user + +> delete_user(key) + +Delete user + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::UsersApi.new +key = 'key_example' # String | Client-provided unique identifier + +begin + # Delete user + result = api_instance.delete_user(key) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling UsersApi->delete_user: #{e}" +end +``` + +#### Using the delete_user_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> delete_user_with_http_info(key) + +```ruby +begin + # Delete user + data, status_code, headers = api_instance.delete_user_with_http_info(key) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling UsersApi->delete_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key** | **String** | Client-provided unique identifier | | + +### Return type + +[**ListUsers200ResponseCollectionInner**](ListUsers200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_users + +> list_users(opts) + +List users + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::UsersApi.new +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25, # Integer | Number of items to return (max 100) + search: 'search_example' # String | Search users by key +} + +begin + # List users + result = api_instance.list_users(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling UsersApi->list_users: #{e}" +end +``` + +#### Using the list_users_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_users_with_http_info(opts) + +```ruby +begin + # List users + data, status_code, headers = api_instance.list_users_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling UsersApi->list_users_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | +| **search** | **String** | Search users by key | [optional] | + +### Return type + +[**ListUsers200Response**](ListUsers200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## retrieve_user + +> retrieve_user(key) + +Retrieve user + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::UsersApi.new +key = 'key_example' # String | Client-provided unique identifier + +begin + # Retrieve user + result = api_instance.retrieve_user(key) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling UsersApi->retrieve_user: #{e}" +end +``` + +#### Using the retrieve_user_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> retrieve_user_with_http_info(key) + +```ruby +begin + # Retrieve user + data, status_code, headers = api_instance.retrieve_user_with_http_info(key) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling UsersApi->retrieve_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key** | **String** | Client-provided unique identifier | | + +### Return type + +[**ListUsers200ResponseCollectionInner**](ListUsers200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## upsert_user + +> upsert_user(key, opts) + +Upsert user + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::UsersApi.new +key = 'key_example' # String | Client-provided unique identifier +opts = { + upsert_user_request: EmbedWorkflow::UpsertUserRequest.new # UpsertUserRequest | +} + +begin + # Upsert user + result = api_instance.upsert_user(key, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling UsersApi->upsert_user: #{e}" +end +``` + +#### Using the upsert_user_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> upsert_user_with_http_info(key, opts) + +```ruby +begin + # Upsert user + data, status_code, headers = api_instance.upsert_user_with_http_info(key, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling UsersApi->upsert_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key** | **String** | Client-provided unique identifier | | +| **upsert_user_request** | [**UpsertUserRequest**](UpsertUserRequest.md) | | [optional] | + +### Return type + +[**ListUsers200ResponseCollectionInner**](ListUsers200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/WorkflowsApi.md b/docs/WorkflowsApi.md new file mode 100644 index 0000000..1c913fa --- /dev/null +++ b/docs/WorkflowsApi.md @@ -0,0 +1,892 @@ +# EmbedWorkflow::WorkflowsApi + +All URIs are relative to *https://www.embedworkflow.com* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**catch_hook**](WorkflowsApi.md#catch_hook) | **POST** /api/v1/hooks/{hook_id}/catch | Catch hook | +| [**clone_workflow**](WorkflowsApi.md#clone_workflow) | **POST** /api/v1/workflows/{id}/clone | Clone workflow | +| [**create_workflow**](WorkflowsApi.md#create_workflow) | **POST** /api/v1/workflows | Create workflow | +| [**delete_workflow**](WorkflowsApi.md#delete_workflow) | **DELETE** /api/v1/workflows/{id} | Delete workflow | +| [**discard_workflow_draft**](WorkflowsApi.md#discard_workflow_draft) | **POST** /api/v1/workflows/{id}/discard_draft | Discard workflow draft | +| [**execute_workflow**](WorkflowsApi.md#execute_workflow) | **POST** /api/v1/workflows/{id}/execute | Execute workflow | +| [**list_workflow_versions**](WorkflowsApi.md#list_workflow_versions) | **GET** /api/v1/workflows/{workflow_id}/versions | List workflow versions | +| [**list_workflows**](WorkflowsApi.md#list_workflows) | **GET** /api/v1/workflows | List workflows | +| [**publish_workflow**](WorkflowsApi.md#publish_workflow) | **POST** /api/v1/workflows/{id}/publish | Publish workflow | +| [**retrieve_workflow**](WorkflowsApi.md#retrieve_workflow) | **GET** /api/v1/workflows/{id} | Retrieve workflow | +| [**trigger_workflow**](WorkflowsApi.md#trigger_workflow) | **POST** /api/v1/trigger | Trigger workflow | +| [**update_workflow**](WorkflowsApi.md#update_workflow) | **PUT** /api/v1/workflows/{id} | Update workflow | + + +## catch_hook + +> Object catch_hook(hook_id, opts) + +Catch hook + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +hook_id = 'hook_id_example' # String | The trigger's hook id used for third party webhooks +opts = { + catch_hook_request: EmbedWorkflow::CatchHookRequest.new({user_key: 'user_key_example'}) # CatchHookRequest | +} + +begin + # Catch hook + result = api_instance.catch_hook(hook_id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->catch_hook: #{e}" +end +``` + +#### Using the catch_hook_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> catch_hook_with_http_info(hook_id, opts) + +```ruby +begin + # Catch hook + data, status_code, headers = api_instance.catch_hook_with_http_info(hook_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->catch_hook_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **hook_id** | **String** | The trigger's hook id used for third party webhooks | | +| **catch_hook_request** | [**CatchHookRequest**](CatchHookRequest.md) | | [optional] | + +### Return type + +**Object** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## clone_workflow + +> clone_workflow(id, opts) + +Clone workflow + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + discard_workflow_draft_request: EmbedWorkflow::DiscardWorkflowDraftRequest.new # DiscardWorkflowDraftRequest | +} + +begin + # Clone workflow + result = api_instance.clone_workflow(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->clone_workflow: #{e}" +end +``` + +#### Using the clone_workflow_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> clone_workflow_with_http_info(id, opts) + +```ruby +begin + # Clone workflow + data, status_code, headers = api_instance.clone_workflow_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->clone_workflow_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **discard_workflow_draft_request** | [**DiscardWorkflowDraftRequest**](DiscardWorkflowDraftRequest.md) | | [optional] | + +### Return type + +[**ListWorkflows200ResponseCollectionInner**](ListWorkflows200ResponseCollectionInner.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_workflow + +> create_workflow(opts) + +Create workflow + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +opts = { + create_workflow_request: EmbedWorkflow::CreateWorkflowRequest.new({name: 'name_example'}) # CreateWorkflowRequest | +} + +begin + # Create workflow + result = api_instance.create_workflow(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->create_workflow: #{e}" +end +``` + +#### Using the create_workflow_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_workflow_with_http_info(opts) + +```ruby +begin + # Create workflow + data, status_code, headers = api_instance.create_workflow_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->create_workflow_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_workflow_request** | [**CreateWorkflowRequest**](CreateWorkflowRequest.md) | | [optional] | + +### Return type + +[**CreateWorkflow201Response**](CreateWorkflow201Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_workflow + +> delete_workflow(id, opts) + +Delete workflow + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + id_type: 'id_type_example', # String | Type of identifier used in the URL + user_key: 'user_key_example' # String | Unique user identifier +} + +begin + # Delete workflow + result = api_instance.delete_workflow(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->delete_workflow: #{e}" +end +``` + +#### Using the delete_workflow_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> delete_workflow_with_http_info(id, opts) + +```ruby +begin + # Delete workflow + data, status_code, headers = api_instance.delete_workflow_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->delete_workflow_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **id_type** | **String** | Type of identifier used in the URL | [optional] | +| **user_key** | **String** | Unique user identifier | [optional] | + +### Return type + +[**DeleteWorkflow200Response**](DeleteWorkflow200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## discard_workflow_draft + +> discard_workflow_draft(id, opts) + +Discard workflow draft + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + discard_workflow_draft_request: EmbedWorkflow::DiscardWorkflowDraftRequest.new # DiscardWorkflowDraftRequest | +} + +begin + # Discard workflow draft + result = api_instance.discard_workflow_draft(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->discard_workflow_draft: #{e}" +end +``` + +#### Using the discard_workflow_draft_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> discard_workflow_draft_with_http_info(id, opts) + +```ruby +begin + # Discard workflow draft + data, status_code, headers = api_instance.discard_workflow_draft_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->discard_workflow_draft_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **discard_workflow_draft_request** | [**DiscardWorkflowDraftRequest**](DiscardWorkflowDraftRequest.md) | | [optional] | + +### Return type + +[**CreateWorkflow201Response**](CreateWorkflow201Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## execute_workflow + +> execute_workflow(id, opts) + +Execute workflow + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + execute_workflow_request: EmbedWorkflow::ExecuteWorkflowRequest.new # ExecuteWorkflowRequest | +} + +begin + # Execute workflow + result = api_instance.execute_workflow(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->execute_workflow: #{e}" +end +``` + +#### Using the execute_workflow_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> execute_workflow_with_http_info(id, opts) + +```ruby +begin + # Execute workflow + data, status_code, headers = api_instance.execute_workflow_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->execute_workflow_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **execute_workflow_request** | [**ExecuteWorkflowRequest**](ExecuteWorkflowRequest.md) | | [optional] | + +### Return type + +[**ExecuteWorkflow201Response**](ExecuteWorkflow201Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## list_workflow_versions + +> list_workflow_versions(workflow_id, opts) + +List workflow versions + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +workflow_id = 'workflow_id_example' # String | Filter results by workflow id +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25, # Integer | Number of items to return (max 100) + user_key: 'user_key_example' # String | Unique user identifier +} + +begin + # List workflow versions + result = api_instance.list_workflow_versions(workflow_id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->list_workflow_versions: #{e}" +end +``` + +#### Using the list_workflow_versions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_workflow_versions_with_http_info(workflow_id, opts) + +```ruby +begin + # List workflow versions + data, status_code, headers = api_instance.list_workflow_versions_with_http_info(workflow_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->list_workflow_versions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **workflow_id** | **String** | Filter results by workflow id | | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | +| **user_key** | **String** | Unique user identifier | [optional] | + +### Return type + +[**ListWorkflowVersions200Response**](ListWorkflowVersions200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_workflows + +> list_workflows(opts) + +List workflows + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +opts = { + starting_after: 'starting_after_example', # String | Cursor for pagination - return results after this ID + ending_before: 'ending_before_example', # String | Cursor for pagination - return results before this ID + limit: 25, # Integer | Number of items to return (max 100) + expand: ['inner_example'], # Array | Expand related objects + user_key: 'user_key_example', # String | Unique user identifier + is_template: true, # Boolean | Filter workflows by is_template value + on: true, # Boolean | Filter workflows by on value + order_by: 'order_by_example', # String | Field to order results by + order_direction: 'asc' # String | +} + +begin + # List workflows + result = api_instance.list_workflows(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->list_workflows: #{e}" +end +``` + +#### Using the list_workflows_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_workflows_with_http_info(opts) + +```ruby +begin + # List workflows + data, status_code, headers = api_instance.list_workflows_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->list_workflows_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **starting_after** | **String** | Cursor for pagination - return results after this ID | [optional] | +| **ending_before** | **String** | Cursor for pagination - return results before this ID | [optional] | +| **limit** | **Integer** | Number of items to return (max 100) | [optional] | +| **expand** | [**Array<String>**](String.md) | Expand related objects | [optional] | +| **user_key** | **String** | Unique user identifier | [optional] | +| **is_template** | **Boolean** | Filter workflows by is_template value | [optional] | +| **on** | **Boolean** | Filter workflows by on value | [optional] | +| **order_by** | **String** | Field to order results by | [optional] | +| **order_direction** | **String** | | [optional] | + +### Return type + +[**ListWorkflows200Response**](ListWorkflows200Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## publish_workflow + +> publish_workflow(id, opts) + +Publish workflow + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + publish_workflow_request: EmbedWorkflow::PublishWorkflowRequest.new # PublishWorkflowRequest | +} + +begin + # Publish workflow + result = api_instance.publish_workflow(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->publish_workflow: #{e}" +end +``` + +#### Using the publish_workflow_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> publish_workflow_with_http_info(id, opts) + +```ruby +begin + # Publish workflow + data, status_code, headers = api_instance.publish_workflow_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->publish_workflow_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **publish_workflow_request** | [**PublishWorkflowRequest**](PublishWorkflowRequest.md) | | [optional] | + +### Return type + +[**CreateWorkflow201Response**](CreateWorkflow201Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## retrieve_workflow + +> retrieve_workflow(id, opts) + +Retrieve workflow + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + id_type: 'id_type_example', # String | Type of identifier used in the URL + user_key: 'user_key_example', # String | Unique user identifier + expand: ['inner_example'] # Array | Expand related objects +} + +begin + # Retrieve workflow + result = api_instance.retrieve_workflow(id, opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->retrieve_workflow: #{e}" +end +``` + +#### Using the retrieve_workflow_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> retrieve_workflow_with_http_info(id, opts) + +```ruby +begin + # Retrieve workflow + data, status_code, headers = api_instance.retrieve_workflow_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->retrieve_workflow_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **id_type** | **String** | Type of identifier used in the URL | [optional] | +| **user_key** | **String** | Unique user identifier | [optional] | +| **expand** | [**Array<String>**](String.md) | Expand related objects | [optional] | + +### Return type + +[**CreateWorkflow201Response**](CreateWorkflow201Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## trigger_workflow + +> Object trigger_workflow(opts) + +Trigger workflow + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +opts = { + trigger_workflow_request: EmbedWorkflow::TriggerWorkflowRequest.new # TriggerWorkflowRequest | +} + +begin + # Trigger workflow + result = api_instance.trigger_workflow(opts) + p result +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->trigger_workflow: #{e}" +end +``` + +#### Using the trigger_workflow_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> trigger_workflow_with_http_info(opts) + +```ruby +begin + # Trigger workflow + data, status_code, headers = api_instance.trigger_workflow_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->trigger_workflow_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **trigger_workflow_request** | [**TriggerWorkflowRequest**](TriggerWorkflowRequest.md) | | [optional] | + +### Return type + +**Object** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_workflow + +> update_workflow(id, opts) + +Update workflow + +### Examples + +```ruby +require 'time' +require 'embed_workflow' +# setup authorization +EmbedWorkflow.configure do |config| + # Configure Bearer authorization (JWT): bearer + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = EmbedWorkflow::WorkflowsApi.new +id = 'id_example' # String | System-generated unique identifier +opts = { + update_workflow_request: EmbedWorkflow::UpdateWorkflowRequest.new({name: 'name_example'}) # UpdateWorkflowRequest | +} + +begin + # Update workflow + api_instance.update_workflow(id, opts) +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->update_workflow: #{e}" +end +``` + +#### Using the update_workflow_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_workflow_with_http_info(id, opts) + +```ruby +begin + # Update workflow + data, status_code, headers = api_instance.update_workflow_with_http_info(id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue EmbedWorkflow::ApiError => e + puts "Error when calling WorkflowsApi->update_workflow_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | System-generated unique identifier | | +| **update_workflow_request** | [**UpdateWorkflowRequest**](UpdateWorkflowRequest.md) | | [optional] | + +### Return type + +nil (empty response body) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/embed_workflow.gemspec b/embed_workflow.gemspec index 83acedb..be44013 100644 --- a/embed_workflow.gemspec +++ b/embed_workflow.gemspec @@ -1,30 +1,40 @@ -# frozen_string_literal: true +# -*- encoding: utf-8 -*- -lib = File.expand_path("lib", __dir__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +$:.push File.expand_path("../lib", __FILE__) require "embed_workflow/version" -Gem::Specification.new do |spec| - spec.name = "embed_workflow" - spec.version = EmbedWorkflow::VERSION - spec.authors = ["Embed Workflow"] - spec.email = ["devsupport@embedworkflow.com"] - spec.description = "API client for Embed Workflow" - spec.summary = "API client for Embed Workflow" - spec.homepage = "https://github.com/embedworkflow/embed-workflow-ruby" - spec.license = "MIT" - spec.metadata = { - "documentation_uri" => "https://docs.embedworkflow.com" - } - - spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) - spec.files = Dir["{config,lib}/**/*", "Rakefile"] - spec.require_paths = ["lib"] - - spec.add_development_dependency "bundler", ">= 2.0.1" - spec.add_development_dependency "rake" - spec.add_development_dependency "standard" - - spec.required_ruby_version = ">= 2.5" +Gem::Specification.new do |s| + s.name = "embed_workflow" + s.version = EmbedWorkflow::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["Embed Workflow"] + s.email = ["devsupport@embedworkflow.com"] + s.homepage = "https://github.com/embedworkflow/embed-workflow-ruby" + s.summary = "Ruby SDK for the EmbedWorkflow API" + s.description = "Ruby client library for the EmbedWorkflow workflow automation API" + s.license = "MIT" + s.required_ruby_version = ">= 2.5" + s.metadata = {} + + s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0' + s.add_runtime_dependency 'faraday-multipart' + + s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' + + s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } + s.test_files = `find spec/*`.split("\n") + s.executables = [] + s.require_paths = ["lib"] end diff --git a/lib/embed_workflow.rb b/lib/embed_workflow.rb index 0bb2718..94c5cef 100644 --- a/lib/embed_workflow.rb +++ b/lib/embed_workflow.rb @@ -1,41 +1,256 @@ -# frozen_string_literal: true +=begin +#API V1 -require "embed_workflow/version" -require "json" +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -module EmbedWorkflow - def self.skey=(value) - Base.skey = value - end +The version of the OpenAPI document: v1 - def self.skey - Base.skey - end +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 - def self.skey! - skey || raise("EmbedWorkflow.skey not set") - end +=end + +# Common files +require 'embed_workflow/api_client' +require 'embed_workflow/api_error' +require 'embed_workflow/version' +require 'embed_workflow/configuration' - autoload :Base, "embed_workflow/base" - autoload :Client, "embed_workflow/client" +# Models +require 'embed_workflow/models/catch_hook_request' +require 'embed_workflow/models/create_action_type422_response' +require 'embed_workflow/models/create_action_type_request' +require 'embed_workflow/models/create_action_type_request_form_draft_inner' +require 'embed_workflow/models/create_action_type_request_icon_draft' +require 'embed_workflow/models/create_app_connection_request' +require 'embed_workflow/models/create_user_token200_response' +require 'embed_workflow/models/create_user_token_request' +require 'embed_workflow/models/create_workflow201_response' +require 'embed_workflow/models/create_workflow_request' +require 'embed_workflow/models/create_workflow_request_template_draft' +require 'embed_workflow/models/create_workflow_request_template_draft_nodes_inner' +require 'embed_workflow/models/delete_action_type200_response' +require 'embed_workflow/models/delete_workflow200_response' +require 'embed_workflow/models/delete_workflow200_response_one_of' +require 'embed_workflow/models/delete_workflow200_response_one_of1' +require 'embed_workflow/models/discard_workflow_draft_request' +require 'embed_workflow/models/evaluate_expression200_response' +require 'embed_workflow/models/evaluate_expression_request' +require 'embed_workflow/models/execute_workflow201_response' +require 'embed_workflow/models/execute_workflow_request' +require 'embed_workflow/models/export_configuration200_response' +require 'embed_workflow/models/export_configuration200_response_configuration' +require 'embed_workflow/models/import_configuration201_response' +require 'embed_workflow/models/import_configuration_request' +require 'embed_workflow/models/import_configuration_request_schema' +require 'embed_workflow/models/install_app201_response' +require 'embed_workflow/models/install_app_request' +require 'embed_workflow/models/list_action_types200_response' +require 'embed_workflow/models/list_action_types200_response_collection_inner' +require 'embed_workflow/models/list_action_types200_response_meta' +require 'embed_workflow/models/list_actions200_response' +require 'embed_workflow/models/list_actions200_response_collection_inner' +require 'embed_workflow/models/list_app_connections200_response' +require 'embed_workflow/models/list_app_connections200_response_collection_inner' +require 'embed_workflow/models/list_available_apps200_response' +require 'embed_workflow/models/list_available_apps200_response_collection_inner' +require 'embed_workflow/models/list_data_fields200_response' +require 'embed_workflow/models/list_data_fields200_response_collection_inner' +require 'embed_workflow/models/list_data_fields_type_parameter' +require 'embed_workflow/models/list_events200_response' +require 'embed_workflow/models/list_events200_response_collection_inner' +require 'embed_workflow/models/list_installed_apps200_response' +require 'embed_workflow/models/list_installed_apps200_response_collection_inner' +require 'embed_workflow/models/list_triggers200_response' +require 'embed_workflow/models/list_triggers200_response_collection_inner' +require 'embed_workflow/models/list_users200_response' +require 'embed_workflow/models/list_users200_response_collection_inner' +require 'embed_workflow/models/list_workflow_executions200_response' +require 'embed_workflow/models/list_workflow_versions200_response' +require 'embed_workflow/models/list_workflow_versions200_response_collection_inner' +require 'embed_workflow/models/list_workflows200_response' +require 'embed_workflow/models/list_workflows200_response_collection_inner' +require 'embed_workflow/models/publish_workflow_request' +require 'embed_workflow/models/retrieve_account200_response' +require 'embed_workflow/models/retrieve_account_usage200_response' +require 'embed_workflow/models/retrieve_available_app200_response' +require 'embed_workflow/models/retrieve_execution200_response' +require 'embed_workflow/models/retry_action_request' +require 'embed_workflow/models/stop_executions_request' +require 'embed_workflow/models/trigger_workflow_request' +require 'embed_workflow/models/update_account_request' +require 'embed_workflow/models/update_account_request_action_type_categories_inner' +require 'embed_workflow/models/update_account_request_action_type_categories_inner_icon' +require 'embed_workflow/models/update_account_request_user_data_schema_inner' +require 'embed_workflow/models/update_action_type_request' +require 'embed_workflow/models/update_installed_app_request' +require 'embed_workflow/models/update_trigger_request' +require 'embed_workflow/models/update_workflow_request' +require 'embed_workflow/models/upsert_user_request' - autoload :Actions, "embed_workflow/actions" - autoload :AppConnections, "embed_workflow/app_connections" - autoload :Executions, "embed_workflow/executions" - autoload :Trigger, "embed_workflow/trigger" - autoload :CatchHook, "embed_workflow/catch_hook" - autoload :Users, "embed_workflow/users" - autoload :Workflows, "embed_workflow/workflows" +# APIs +require 'embed_workflow/api/accounts_api' +require 'embed_workflow/api/action_types_api' +require 'embed_workflow/api/actions_api' +require 'embed_workflow/api/app_connections_api' +require 'embed_workflow/api/available_apps_api' +require 'embed_workflow/api/data_fields_api' +require 'embed_workflow/api/events_api' +require 'embed_workflow/api/executions_api' +require 'embed_workflow/api/installed_apps_api' +require 'embed_workflow/api/payments_api' +require 'embed_workflow/api/triggers_api' +require 'embed_workflow/api/users_api' +require 'embed_workflow/api/workflows_api' - autoload :APIError, "embed_workflow/errors" - autoload :AuthenticationError, "embed_workflow/errors" - autoload :InvalidRequestError, "embed_workflow/errors" +module EmbedWorkflow + class << self + # Set your API key for the default client. + # + # @example + # EmbedWorkflow.skey = "sk-live-your-api-key" + # EmbedWorkflow.users.list_users + # + def skey=(api_key) + @skey = api_key + @client = Client.new(api_key) + end - def self.trigger(**args) - Trigger.create(**args) + # @return [String] the configured API key + attr_reader :skey + + # @return [Client] the default client (requires skey to be set first) + def client + raise "#{name}.skey must be set before using the default client" unless @client + @client + end + + # @return [EmbedWorkflow::AccountsApi] + def accounts + client.accounts + end + # @return [EmbedWorkflow::ActionTypesApi] + def action_types + client.action_types + end + # @return [EmbedWorkflow::ActionsApi] + def actions + client.actions + end + # @return [EmbedWorkflow::AppConnectionsApi] + def app_connections + client.app_connections + end + # @return [EmbedWorkflow::AvailableAppsApi] + def available_apps + client.available_apps + end + # @return [EmbedWorkflow::DataFieldsApi] + def data_fields + client.data_fields + end + # @return [EmbedWorkflow::EventsApi] + def events + client.events + end + # @return [EmbedWorkflow::ExecutionsApi] + def executions + client.executions + end + # @return [EmbedWorkflow::InstalledAppsApi] + def installed_apps + client.installed_apps + end + # @return [EmbedWorkflow::PaymentsApi] + def payments + client.payments + end + # @return [EmbedWorkflow::TriggersApi] + def triggers + client.triggers + end + # @return [EmbedWorkflow::UsersApi] + def users + client.users + end + # @return [EmbedWorkflow::WorkflowsApi] + def workflows + client.workflows + end + + # Customize default settings for the SDK using block. + # EmbedWorkflow.configure do |config| + # config.username = "xxx" + # config.password = "xxx" + # end + # If no block given, return the default Configuration object. + def configure + if block_given? + yield(Configuration.default) + else + Configuration.default + end + end end - def self.catch_hook(**args) - CatchHook.create(**args) + # Convenience client for the EmbedWorkflow API. + # + # @example + # client = EmbedWorkflow::Client.new("sk-live-your-api-key") + # workflows = client.workflows.list_workflows + # users = client.users.list_users + # + class Client + # @return [EmbedWorkflow::AccountsApi] + attr_reader :accounts + # @return [EmbedWorkflow::ActionTypesApi] + attr_reader :action_types + # @return [EmbedWorkflow::ActionsApi] + attr_reader :actions + # @return [EmbedWorkflow::AppConnectionsApi] + attr_reader :app_connections + # @return [EmbedWorkflow::AvailableAppsApi] + attr_reader :available_apps + # @return [EmbedWorkflow::DataFieldsApi] + attr_reader :data_fields + # @return [EmbedWorkflow::EventsApi] + attr_reader :events + # @return [EmbedWorkflow::ExecutionsApi] + attr_reader :executions + # @return [EmbedWorkflow::InstalledAppsApi] + attr_reader :installed_apps + # @return [EmbedWorkflow::PaymentsApi] + attr_reader :payments + # @return [EmbedWorkflow::TriggersApi] + attr_reader :triggers + # @return [EmbedWorkflow::UsersApi] + attr_reader :users + # @return [EmbedWorkflow::WorkflowsApi] + attr_reader :workflows + + # Create a new EmbedWorkflow client. + # + # @param api_key [String] Your EmbedWorkflow API key + # @param base_url [String] Optional custom base URL (defaults to https://embedworkflow.com) + def initialize(api_key, base_url: 'https://embedworkflow.com') + config = EmbedWorkflow::Configuration.default.clone + config.access_token = api_key + config.host = base_url.sub(%r{^https://}, '') + api_client = EmbedWorkflow::ApiClient.new(config) + + @accounts = EmbedWorkflow::AccountsApi.new(api_client) + @action_types = EmbedWorkflow::ActionTypesApi.new(api_client) + @actions = EmbedWorkflow::ActionsApi.new(api_client) + @app_connections = EmbedWorkflow::AppConnectionsApi.new(api_client) + @available_apps = EmbedWorkflow::AvailableAppsApi.new(api_client) + @data_fields = EmbedWorkflow::DataFieldsApi.new(api_client) + @events = EmbedWorkflow::EventsApi.new(api_client) + @executions = EmbedWorkflow::ExecutionsApi.new(api_client) + @installed_apps = EmbedWorkflow::InstalledAppsApi.new(api_client) + @payments = EmbedWorkflow::PaymentsApi.new(api_client) + @triggers = EmbedWorkflow::TriggersApi.new(api_client) + @users = EmbedWorkflow::UsersApi.new(api_client) + @workflows = EmbedWorkflow::WorkflowsApi.new(api_client) + end end end diff --git a/lib/embed_workflow/actions.rb b/lib/embed_workflow/actions.rb deleted file mode 100644 index 359d553..0000000 --- a/lib/embed_workflow/actions.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -require "net/http" -require "uri" - -module EmbedWorkflow - module Actions - class << self - include Base - include Client - - RESOURCE_BASE_PATH = "#{BASE_API_PATH}/actions".freeze - - def activities(hashid:) - get_request(path: "#{RESOURCE_BASE_PATH}/activities") - end - end - end -end diff --git a/lib/embed_workflow/api/accounts_api.rb b/lib/embed_workflow/api/accounts_api.rb new file mode 100644 index 0000000..09d9c91 --- /dev/null +++ b/lib/embed_workflow/api/accounts_api.rb @@ -0,0 +1,364 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class AccountsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Export configuration + # @param [Hash] opts the optional parameters + # @option opts [String] :schema_format (default to 'yaml') + # @option opts [Array] :sections + # @return [ExportConfiguration200Response] + def export_configuration(**opts) + data, _status_code, _headers = export_configuration_with_http_info(opts) + data + end + + # Export configuration + # @param [Hash] opts the optional parameters + # @option opts [String] :schema_format (default to 'yaml') + # @option opts [Array] :sections + # @return [Array<(ExportConfiguration200Response, Integer, Hash)>] ExportConfiguration200Response data, response status code and response headers + def export_configuration_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountsApi.export_configuration ...' + end + allowable_values = ["yaml", "json"] + if @api_client.config.client_side_validation && opts[:'schema_format'] && !allowable_values.include?(opts[:'schema_format']) + fail ArgumentError, "invalid value for \"schema_format\", must be one of #{allowable_values}" + end + allowable_values = ["action_types", "triggers", "workflows", "apps", "user_data_schema", "account_data_schema"] + if @api_client.config.client_side_validation && opts[:'sections'] && !opts[:'sections'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"sections\", must include one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v1/configurations/export' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'schema_format'] = opts[:'schema_format'] if !opts[:'schema_format'].nil? + query_params[:'sections'] = @api_client.build_collection_param(opts[:'sections'], :multi) if !opts[:'sections'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ExportConfiguration200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AccountsApi.export_configuration", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountsApi#export_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Import configuration + # @param [Hash] opts the optional parameters + # @option opts [ImportConfigurationRequestSchema] :schema + # @option opts [String] :schema_format Format for the configuration schema + # @param [Hash] **extra Additional properties to include in the request body + # @return [ImportConfiguration201Response] + def import_configuration(**opts) + opts[:'import_configuration_request'] = { + schema: opts.delete(:schema), + schema_format: opts.delete(:schema_format), + **opts.reject { |k, _| k.to_s.start_with?('debug_') } + } + data, _status_code, _headers = import_configuration_with_http_info(opts) + data + end + + # Import configuration + # @param [Hash] opts the optional parameters + # @option opts [ImportConfigurationRequest] :import_configuration_request + # @return [Array<(ImportConfiguration201Response, Integer, Hash)>] ImportConfiguration201Response data, response status code and response headers + def import_configuration_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountsApi.import_configuration ...' + end + # resource path + local_var_path = '/api/v1/configurations/import' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'import_configuration_request']) + + # return_type + return_type = opts[:debug_return_type] || 'ImportConfiguration201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AccountsApi.import_configuration", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountsApi#import_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve account + # @param [Hash] opts the optional parameters + # @return [RetrieveAccount200Response] + def retrieve_account(**opts) + data, _status_code, _headers = retrieve_account_with_http_info(opts) + data + end + + # Retrieve account + # @param [Hash] opts the optional parameters + # @return [Array<(RetrieveAccount200Response, Integer, Hash)>] RetrieveAccount200Response data, response status code and response headers + def retrieve_account_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountsApi.retrieve_account ...' + end + # resource path + local_var_path = '/api/v1/account' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RetrieveAccount200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AccountsApi.retrieve_account", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountsApi#retrieve_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve account usage + # @param [Hash] opts the optional parameters + # @option opts [Time] :start_time + # @option opts [Time] :end_time + # @option opts [String] :user_key User key to filter usage for a specific user + # @return [RetrieveAccountUsage200Response] + def retrieve_account_usage(**opts) + data, _status_code, _headers = retrieve_account_usage_with_http_info(opts) + data + end + + # Retrieve account usage + # @param [Hash] opts the optional parameters + # @option opts [Time] :start_time + # @option opts [Time] :end_time + # @option opts [String] :user_key User key to filter usage for a specific user + # @return [Array<(RetrieveAccountUsage200Response, Integer, Hash)>] RetrieveAccountUsage200Response data, response status code and response headers + def retrieve_account_usage_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountsApi.retrieve_account_usage ...' + end + # resource path + local_var_path = '/api/v1/account/usage' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'start_time'] = opts[:'start_time'] if !opts[:'start_time'].nil? + query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil? + query_params[:'user_key'] = opts[:'user_key'] if !opts[:'user_key'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RetrieveAccountUsage200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AccountsApi.retrieve_account_usage", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountsApi#retrieve_account_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update account + # @param [Hash] opts the optional parameters + # @option opts [String] :company_name Company name associated with the account + # @option opts [String] :user_name User name for the account + # @option opts [String] :theme Theme setting for the account + # @option opts [String] :time_zone Time zone setting for the account + # @option opts [String] :custom_domain Custom domain for the account + # @option opts [Array] :groups User permission groups. Only available to users with admin role. + # @option opts [Boolean] :action_type_categories_enabled Enable or disable action type categories display + # @option opts [Array] :action_type_categories Action type categories for the account. + # @option opts [Hash] :data Additional account data + # @option opts [Array] :user_data_schema Data schema configuration + # @option opts [Array] :data_schema Data schema configuration + # @return [RetrieveAccount200Response] + def update_account(**opts) + opts[:'update_account_request'] = UpdateAccountRequest.new( + company_name: opts.delete(:company_name), + user_name: opts.delete(:user_name), + theme: opts.delete(:theme), + time_zone: opts.delete(:time_zone), + custom_domain: opts.delete(:custom_domain), + groups: opts.delete(:groups), + action_type_categories_enabled: opts.delete(:action_type_categories_enabled), + action_type_categories: opts.delete(:action_type_categories), + data: opts.delete(:data), + user_data_schema: opts.delete(:user_data_schema), + data_schema: opts.delete(:data_schema), + ) + data, _status_code, _headers = update_account_with_http_info(opts) + data + end + + # Update account + # @param [Hash] opts the optional parameters + # @option opts [UpdateAccountRequest] :update_account_request + # @return [Array<(RetrieveAccount200Response, Integer, Hash)>] RetrieveAccount200Response data, response status code and response headers + def update_account_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountsApi.update_account ...' + end + # resource path + local_var_path = '/api/v1/account' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_account_request']) + + # return_type + return_type = opts[:debug_return_type] || 'RetrieveAccount200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AccountsApi.update_account", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountsApi#update_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/action_types_api.rb b/lib/embed_workflow/api/action_types_api.rb new file mode 100644 index 0000000..824af77 --- /dev/null +++ b/lib/embed_workflow/api/action_types_api.rb @@ -0,0 +1,531 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class ActionTypesApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create action type + # @param [Hash] opts the optional parameters + # @param name [String] Name of resource + # @option opts [String] :description Description of action type + # @param type [String] Type of action + # @option opts [Boolean] :on Enable or disable the resource. + # @option opts [String] :params_draft HTTP parameters as key:value pairs, one per line + # @option opts [String] :headers_draft HTTP headers as key:value pairs, one per line + # @option opts [String] :url_draft HTTP url + # @option opts [String] :http_method_draft HTTP method + # @option opts [String] :code_draft JavaScript code snippt + # @option opts [Boolean] :publish Whether or not you want to publish on create + # @option opts [Array] :form_draft Form field configuration + # @option opts [Array] :response_data_schema_draft Data schema configuration + # @option opts [Array] :groups User permission groups. Only available to users with admin role. + # @option opts [CreateActionTypeRequestIconDraft] :icon_draft + # @option opts [String] :primary_category Primary category for the action type + # @option opts [String] :secondary_category Secondary category for the action type + # @return [ListActionTypes200ResponseCollectionInner] + def create_action_type(name:, type:, **opts) + opts[:'create_action_type_request'] = CreateActionTypeRequest.new( + name: name, + description: opts.delete(:description), + type: type, + on: opts.delete(:on), + params_draft: opts.delete(:params_draft), + headers_draft: opts.delete(:headers_draft), + url_draft: opts.delete(:url_draft), + http_method_draft: opts.delete(:http_method_draft), + code_draft: opts.delete(:code_draft), + publish: opts.delete(:publish), + form_draft: opts.delete(:form_draft), + response_data_schema_draft: opts.delete(:response_data_schema_draft), + groups: opts.delete(:groups), + icon_draft: opts.delete(:icon_draft), + primary_category: opts.delete(:primary_category), + secondary_category: opts.delete(:secondary_category), + ) + data, _status_code, _headers = create_action_type_with_http_info(opts) + data + end + + # Create action type + # @param [Hash] opts the optional parameters + # @option opts [CreateActionTypeRequest] :create_action_type_request + # @return [Array<(ListActionTypes200ResponseCollectionInner, Integer, Hash)>] ListActionTypes200ResponseCollectionInner data, response status code and response headers + def create_action_type_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionTypesApi.create_action_type ...' + end + # resource path + local_var_path = '/api/v1/action_types' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_action_type_request']) + + # return_type + return_type = opts[:debug_return_type] || 'ListActionTypes200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionTypesApi.create_action_type", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionTypesApi#create_action_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete action type + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [DeleteActionType200Response] + def delete_action_type(id:, **opts) + data, _status_code, _headers = delete_action_type_with_http_info(id, opts) + data + end + + # Delete action type + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [Array<(DeleteActionType200Response, Integer, Hash)>] DeleteActionType200Response data, response status code and response headers + def delete_action_type_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionTypesApi.delete_action_type ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ActionTypesApi.delete_action_type" + end + # resource path + local_var_path = '/api/v1/action_types/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'DeleteActionType200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionTypesApi.delete_action_type", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionTypesApi#delete_action_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Discard action type draft + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [ListActionTypes200ResponseCollectionInner] + def discard_action_type_draft(id:, **opts) + data, _status_code, _headers = discard_action_type_draft_with_http_info(id, opts) + data + end + + # Discard action type draft + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [Array<(ListActionTypes200ResponseCollectionInner, Integer, Hash)>] ListActionTypes200ResponseCollectionInner data, response status code and response headers + def discard_action_type_draft_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionTypesApi.discard_action_type_draft ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ActionTypesApi.discard_action_type_draft" + end + # resource path + local_var_path = '/api/v1/action_types/{id}/discard_draft'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListActionTypes200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionTypesApi.discard_action_type_draft", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionTypesApi#discard_action_type_draft\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List action types + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :category Filter by category (matches primary or secondary) + # @return [ListActionTypes200Response] + def list_action_types(**opts) + data, _status_code, _headers = list_action_types_with_http_info(opts) + data + end + + # List action types + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :category Filter by category (matches primary or secondary) + # @return [Array<(ListActionTypes200Response, Integer, Hash)>] ListActionTypes200Response data, response status code and response headers + def list_action_types_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionTypesApi.list_action_types ...' + end + # resource path + local_var_path = '/api/v1/action_types' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'category'] = opts[:'category'] if !opts[:'category'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListActionTypes200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionTypesApi.list_action_types", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionTypesApi#list_action_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Publish action type + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [ListActionTypes200ResponseCollectionInner] + def publish_action_type(id:, **opts) + data, _status_code, _headers = publish_action_type_with_http_info(id, opts) + data + end + + # Publish action type + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [Array<(ListActionTypes200ResponseCollectionInner, Integer, Hash)>] ListActionTypes200ResponseCollectionInner data, response status code and response headers + def publish_action_type_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionTypesApi.publish_action_type ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ActionTypesApi.publish_action_type" + end + # resource path + local_var_path = '/api/v1/action_types/{id}/publish'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListActionTypes200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionTypesApi.publish_action_type", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionTypesApi#publish_action_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve action type + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [ListActionTypes200ResponseCollectionInner] + def retrieve_action_type(id:, **opts) + data, _status_code, _headers = retrieve_action_type_with_http_info(id, opts) + data + end + + # Retrieve action type + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [Array<(ListActionTypes200ResponseCollectionInner, Integer, Hash)>] ListActionTypes200ResponseCollectionInner data, response status code and response headers + def retrieve_action_type_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionTypesApi.retrieve_action_type ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ActionTypesApi.retrieve_action_type" + end + # resource path + local_var_path = '/api/v1/action_types/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListActionTypes200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionTypesApi.retrieve_action_type", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionTypesApi#retrieve_action_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update action type + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :name Name of resource + # @option opts [String] :description Description of action type + # @option opts [Boolean] :on Enable or disable the resource. + # @option opts [String] :params_draft HTTP parameters as key:value pairs, one per line + # @option opts [String] :headers_draft HTTP headers as key:value pairs, one per line + # @option opts [String] :url_draft HTTP url + # @option opts [String] :http_method_draft HTTP method + # @option opts [String] :code_draft JavaScript code snippt + # @option opts [Array] :form_draft Form field configuration + # @option opts [Array] :response_data_schema_draft Data schema configuration + # @option opts [Array] :groups User permission groups. Only available to users with admin role. + # @option opts [CreateActionTypeRequestIconDraft] :icon_draft + # @option opts [String] :primary_category Primary category for the action type + # @option opts [String] :secondary_category Secondary category for the action type + # @option opts [Boolean] :wait_for_callback When true, actions fire the webhook but wait for an external callback before completing + # @option opts [Integer] :callback_timeout_n Callback timeout duration value + # @option opts [String] :callback_timeout_unit Callback timeout duration unit (sec, min, hour, day, week, month, year) + # @return [ListActionTypes200ResponseCollectionInner] + def update_action_type(id:, **opts) + opts[:'update_action_type_request'] = UpdateActionTypeRequest.new( + name: opts.delete(:name), + description: opts.delete(:description), + on: opts.delete(:on), + params_draft: opts.delete(:params_draft), + headers_draft: opts.delete(:headers_draft), + url_draft: opts.delete(:url_draft), + http_method_draft: opts.delete(:http_method_draft), + code_draft: opts.delete(:code_draft), + form_draft: opts.delete(:form_draft), + response_data_schema_draft: opts.delete(:response_data_schema_draft), + groups: opts.delete(:groups), + icon_draft: opts.delete(:icon_draft), + primary_category: opts.delete(:primary_category), + secondary_category: opts.delete(:secondary_category), + wait_for_callback: opts.delete(:wait_for_callback), + callback_timeout_n: opts.delete(:callback_timeout_n), + callback_timeout_unit: opts.delete(:callback_timeout_unit), + ) + data, _status_code, _headers = update_action_type_with_http_info(id, opts) + data + end + + # Update action type + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [UpdateActionTypeRequest] :update_action_type_request + # @return [Array<(ListActionTypes200ResponseCollectionInner, Integer, Hash)>] ListActionTypes200ResponseCollectionInner data, response status code and response headers + def update_action_type_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionTypesApi.update_action_type ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ActionTypesApi.update_action_type" + end + # resource path + local_var_path = '/api/v1/action_types/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_action_type_request']) + + # return_type + return_type = opts[:debug_return_type] || 'ListActionTypes200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionTypesApi.update_action_type", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionTypesApi#update_action_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/actions_api.rb b/lib/embed_workflow/api/actions_api.rb new file mode 100644 index 0000000..bd8f0c4 --- /dev/null +++ b/lib/embed_workflow/api/actions_api.rb @@ -0,0 +1,468 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class ActionsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # List actions + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :status Filter results by status + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [ListActions200Response] + def list_actions(**opts) + data, _status_code, _headers = list_actions_with_http_info(opts) + data + end + + # List actions + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :status Filter results by status + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [Array<(ListActions200Response, Integer, Hash)>] ListActions200Response data, response status code and response headers + def list_actions_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionsApi.list_actions ...' + end + # resource path + local_var_path = '/api/v1/actions' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? + query_params[:'execution_id'] = opts[:'execution_id'] if !opts[:'execution_id'].nil? + query_params[:'workflow_id'] = opts[:'workflow_id'] if !opts[:'workflow_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListActions200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionsApi.list_actions", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionsApi#list_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List completed actions + # @param status [String] Filter results by status + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [ListActions200Response] + def list_completed_actions(status:, **opts) + data, _status_code, _headers = list_completed_actions_with_http_info(status, opts) + data + end + + # List completed actions + # @param status [String] Filter results by status + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [Array<(ListActions200Response, Integer, Hash)>] ListActions200Response data, response status code and response headers + def list_completed_actions_with_http_info(status, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionsApi.list_completed_actions ...' + end + # verify the required parameter 'status' is set + if @api_client.config.client_side_validation && status.nil? + fail ArgumentError, "Missing the required parameter 'status' when calling ActionsApi.list_completed_actions" + end + # resource path + local_var_path = '/api/v1/actions/completed'.sub('{' + 'status' + '}', CGI.escape(status.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'execution_id'] = opts[:'execution_id'] if !opts[:'execution_id'].nil? + query_params[:'workflow_id'] = opts[:'workflow_id'] if !opts[:'workflow_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListActions200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionsApi.list_completed_actions", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionsApi#list_completed_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List failed actions + # @param status [String] Filter results by status + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [ListActions200Response] + def list_failed_actions(status:, **opts) + data, _status_code, _headers = list_failed_actions_with_http_info(status, opts) + data + end + + # List failed actions + # @param status [String] Filter results by status + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [Array<(ListActions200Response, Integer, Hash)>] ListActions200Response data, response status code and response headers + def list_failed_actions_with_http_info(status, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionsApi.list_failed_actions ...' + end + # verify the required parameter 'status' is set + if @api_client.config.client_side_validation && status.nil? + fail ArgumentError, "Missing the required parameter 'status' when calling ActionsApi.list_failed_actions" + end + # resource path + local_var_path = '/api/v1/actions/failed'.sub('{' + 'status' + '}', CGI.escape(status.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'execution_id'] = opts[:'execution_id'] if !opts[:'execution_id'].nil? + query_params[:'workflow_id'] = opts[:'workflow_id'] if !opts[:'workflow_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListActions200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionsApi.list_failed_actions", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionsApi#list_failed_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List scheduled actions + # @param status [String] Filter results by status + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [ListActions200Response] + def list_scheduled_actions(status:, **opts) + data, _status_code, _headers = list_scheduled_actions_with_http_info(status, opts) + data + end + + # List scheduled actions + # @param status [String] Filter results by status + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [Array<(ListActions200Response, Integer, Hash)>] ListActions200Response data, response status code and response headers + def list_scheduled_actions_with_http_info(status, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionsApi.list_scheduled_actions ...' + end + # verify the required parameter 'status' is set + if @api_client.config.client_side_validation && status.nil? + fail ArgumentError, "Missing the required parameter 'status' when calling ActionsApi.list_scheduled_actions" + end + # resource path + local_var_path = '/api/v1/actions/scheduled'.sub('{' + 'status' + '}', CGI.escape(status.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'execution_id'] = opts[:'execution_id'] if !opts[:'execution_id'].nil? + query_params[:'workflow_id'] = opts[:'workflow_id'] if !opts[:'workflow_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListActions200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionsApi.list_scheduled_actions", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionsApi#list_scheduled_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List workflow actions + # @param workflow_id [String] Filter results by workflow id + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [ListActions200Response] + def list_workflow_actions(workflow_id:, **opts) + data, _status_code, _headers = list_workflow_actions_with_http_info(workflow_id, opts) + data + end + + # List workflow actions + # @param workflow_id [String] Filter results by workflow id + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [Array<(ListActions200Response, Integer, Hash)>] ListActions200Response data, response status code and response headers + def list_workflow_actions_with_http_info(workflow_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionsApi.list_workflow_actions ...' + end + # verify the required parameter 'workflow_id' is set + if @api_client.config.client_side_validation && workflow_id.nil? + fail ArgumentError, "Missing the required parameter 'workflow_id' when calling ActionsApi.list_workflow_actions" + end + # resource path + local_var_path = '/api/v1/workflows/{workflow_id}/actions'.sub('{' + 'workflow_id' + '}', CGI.escape(workflow_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListActions200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionsApi.list_workflow_actions", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionsApi#list_workflow_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retry action + # @param hashid [String] Action's hashid + # @param [Hash] opts the optional parameters + # @param user_key [String] User's key + # @param hook_id [String] The trigger's hook id used for third party webhooks. + # @param [Hash] **extra Additional properties to include in the request body + # @return [Object] + def retry_action(hashid:, user_key:, hook_id:, **opts) + opts[:'retry_action_request'] = { + user_key: user_key, + hook_id: hook_id, + **opts.reject { |k, _| k.to_s.start_with?('debug_') } + } + data, _status_code, _headers = retry_action_with_http_info(hashid, opts) + data + end + + # Retry action + # @param hashid [String] Action's hashid + # @param [Hash] opts the optional parameters + # @option opts [RetryActionRequest] :retry_action_request + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def retry_action_with_http_info(hashid, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionsApi.retry_action ...' + end + # verify the required parameter 'hashid' is set + if @api_client.config.client_side_validation && hashid.nil? + fail ArgumentError, "Missing the required parameter 'hashid' when calling ActionsApi.retry_action" + end + # resource path + local_var_path = '/api/v1/actions/{hashid}/retry'.sub('{' + 'hashid' + '}', CGI.escape(hashid.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'retry_action_request']) + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ActionsApi.retry_action", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionsApi#retry_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/app_connections_api.rb b/lib/embed_workflow/api/app_connections_api.rb new file mode 100644 index 0000000..8dd7c29 --- /dev/null +++ b/lib/embed_workflow/api/app_connections_api.rb @@ -0,0 +1,368 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class AppConnectionsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create app connection + # @param [Hash] opts the optional parameters + # @param name [String] Name of resource + # @param app_type [String] App Type + # @param user_key [String] User's key + # @param config [Object] App connection configuration + # @return [ListAppConnections200ResponseCollectionInner] + def create_app_connection(name:, app_type:, user_key:, config:, **opts) + opts[:'create_app_connection_request'] = CreateAppConnectionRequest.new( + name: name, + app_type: app_type, + user_key: user_key, + config: config, + ) + data, _status_code, _headers = create_app_connection_with_http_info(opts) + data + end + + # Create app connection + # @param [Hash] opts the optional parameters + # @option opts [CreateAppConnectionRequest] :create_app_connection_request + # @return [Array<(ListAppConnections200ResponseCollectionInner, Integer, Hash)>] ListAppConnections200ResponseCollectionInner data, response status code and response headers + def create_app_connection_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppConnectionsApi.create_app_connection ...' + end + # resource path + local_var_path = '/api/v1/app_connections' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_app_connection_request']) + + # return_type + return_type = opts[:debug_return_type] || 'ListAppConnections200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AppConnectionsApi.create_app_connection", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppConnectionsApi#create_app_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete app connection + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key Unique user identifier + # @return [DeleteActionType200Response] + def delete_app_connection(id:, **opts) + data, _status_code, _headers = delete_app_connection_with_http_info(id, opts) + data + end + + # Delete app connection + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key Unique user identifier + # @return [Array<(DeleteActionType200Response, Integer, Hash)>] DeleteActionType200Response data, response status code and response headers + def delete_app_connection_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppConnectionsApi.delete_app_connection ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling AppConnectionsApi.delete_app_connection" + end + # resource path + local_var_path = '/api/v1/app_connections/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'user_key'] = opts[:'user_key'] if !opts[:'user_key'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'DeleteActionType200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AppConnectionsApi.delete_app_connection", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppConnectionsApi#delete_app_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List app connections + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :user_key Unique user identifier + # @option opts [String] :app_type Filter results by app type + # @return [ListAppConnections200Response] + def list_app_connections(**opts) + data, _status_code, _headers = list_app_connections_with_http_info(opts) + data + end + + # List app connections + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :user_key Unique user identifier + # @option opts [String] :app_type Filter results by app type + # @return [Array<(ListAppConnections200Response, Integer, Hash)>] ListAppConnections200Response data, response status code and response headers + def list_app_connections_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppConnectionsApi.list_app_connections ...' + end + # resource path + local_var_path = '/api/v1/app_connections' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'user_key'] = opts[:'user_key'] if !opts[:'user_key'].nil? + query_params[:'app_type'] = opts[:'app_type'] if !opts[:'app_type'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListAppConnections200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AppConnectionsApi.list_app_connections", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppConnectionsApi#list_app_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve app connection + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key Unique user identifier + # @return [ListAppConnections200ResponseCollectionInner] + def retrieve_app_connection(id:, **opts) + data, _status_code, _headers = retrieve_app_connection_with_http_info(id, opts) + data + end + + # Retrieve app connection + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key Unique user identifier + # @return [Array<(ListAppConnections200ResponseCollectionInner, Integer, Hash)>] ListAppConnections200ResponseCollectionInner data, response status code and response headers + def retrieve_app_connection_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppConnectionsApi.retrieve_app_connection ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling AppConnectionsApi.retrieve_app_connection" + end + # resource path + local_var_path = '/api/v1/app_connections/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'user_key'] = opts[:'user_key'] if !opts[:'user_key'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListAppConnections200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AppConnectionsApi.retrieve_app_connection", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppConnectionsApi#retrieve_app_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update app connection + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @param name [String] Name of resource + # @param app_type [String] App Type + # @param user_key [String] User's key + # @param config [Object] App connection configuration + # @return [ListAppConnections200ResponseCollectionInner] + def update_app_connection(id:, name:, app_type:, user_key:, config:, **opts) + opts[:'create_app_connection_request'] = CreateAppConnectionRequest.new( + name: name, + app_type: app_type, + user_key: user_key, + config: config, + ) + data, _status_code, _headers = update_app_connection_with_http_info(id, opts) + data + end + + # Update app connection + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [CreateAppConnectionRequest] :create_app_connection_request + # @return [Array<(ListAppConnections200ResponseCollectionInner, Integer, Hash)>] ListAppConnections200ResponseCollectionInner data, response status code and response headers + def update_app_connection_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppConnectionsApi.update_app_connection ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling AppConnectionsApi.update_app_connection" + end + # resource path + local_var_path = '/api/v1/app_connections/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_app_connection_request']) + + # return_type + return_type = opts[:debug_return_type] || 'ListAppConnections200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AppConnectionsApi.update_app_connection", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppConnectionsApi#update_app_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/available_apps_api.rb b/lib/embed_workflow/api/available_apps_api.rb new file mode 100644 index 0000000..3b7561b --- /dev/null +++ b/lib/embed_workflow/api/available_apps_api.rb @@ -0,0 +1,141 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class AvailableAppsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # List available apps + # @param [Hash] opts the optional parameters + # @option opts [String] :exclude_installed Exclude already installed apps + # @return [ListAvailableApps200Response] + def list_available_apps(**opts) + data, _status_code, _headers = list_available_apps_with_http_info(opts) + data + end + + # List available apps + # @param [Hash] opts the optional parameters + # @option opts [String] :exclude_installed Exclude already installed apps + # @return [Array<(ListAvailableApps200Response, Integer, Hash)>] ListAvailableApps200Response data, response status code and response headers + def list_available_apps_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AvailableAppsApi.list_available_apps ...' + end + # resource path + local_var_path = '/api/v1/available_apps' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'exclude_installed'] = opts[:'exclude_installed'] if !opts[:'exclude_installed'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListAvailableApps200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AvailableAppsApi.list_available_apps", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AvailableAppsApi#list_available_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve available app + # @param app_identifier [String] App indentifier + # @param [Hash] opts the optional parameters + # @return [RetrieveAvailableApp200Response] + def retrieve_available_app(app_identifier:, **opts) + data, _status_code, _headers = retrieve_available_app_with_http_info(app_identifier, opts) + data + end + + # Retrieve available app + # @param app_identifier [String] App indentifier + # @param [Hash] opts the optional parameters + # @return [Array<(RetrieveAvailableApp200Response, Integer, Hash)>] RetrieveAvailableApp200Response data, response status code and response headers + def retrieve_available_app_with_http_info(app_identifier, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AvailableAppsApi.retrieve_available_app ...' + end + # verify the required parameter 'app_identifier' is set + if @api_client.config.client_side_validation && app_identifier.nil? + fail ArgumentError, "Missing the required parameter 'app_identifier' when calling AvailableAppsApi.retrieve_available_app" + end + # resource path + local_var_path = '/api/v1/available_apps/{app_identifier}'.sub('{' + 'app_identifier' + '}', CGI.escape(app_identifier.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RetrieveAvailableApp200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"AvailableAppsApi.retrieve_available_app", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AvailableAppsApi#retrieve_available_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/data_fields_api.rb b/lib/embed_workflow/api/data_fields_api.rb new file mode 100644 index 0000000..45198f0 --- /dev/null +++ b/lib/embed_workflow/api/data_fields_api.rb @@ -0,0 +1,232 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class DataFieldsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Evaluate expression + # @param [Hash] opts the optional parameters + # @param expression [String] Liquid template expression to evaluate against the provided data + # @param data [Hash] Data context for evaluating the expression + # @return [EvaluateExpression200Response] + def evaluate_expression(expression:, data:, **opts) + opts[:'evaluate_expression_request'] = EvaluateExpressionRequest.new( + expression: expression, + data: data, + ) + data, _status_code, _headers = evaluate_expression_with_http_info(opts) + data + end + + # Evaluate expression + # @param [Hash] opts the optional parameters + # @option opts [EvaluateExpressionRequest] :evaluate_expression_request + # @return [Array<(EvaluateExpression200Response, Integer, Hash)>] EvaluateExpression200Response data, response status code and response headers + def evaluate_expression_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DataFieldsApi.evaluate_expression ...' + end + # resource path + local_var_path = '/api/v1/data_fields/evaluate' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'evaluate_expression_request']) + + # return_type + return_type = opts[:debug_return_type] || 'EvaluateExpression200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"DataFieldsApi.evaluate_expression", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DataFieldsApi#evaluate_expression\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List data fields + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key Filter results by user key + # @option opts [String] :event_trigger Filter results by event trigger + # @option opts [ListDataFieldsTypeParameter] :type Data type filter - can be a single type or multiple types + # @return [ListDataFields200Response] + def list_data_fields(**opts) + data, _status_code, _headers = list_data_fields_with_http_info(opts) + data + end + + # List data fields + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key Filter results by user key + # @option opts [String] :event_trigger Filter results by event trigger + # @option opts [ListDataFieldsTypeParameter] :type Data type filter - can be a single type or multiple types + # @return [Array<(ListDataFields200Response, Integer, Hash)>] ListDataFields200Response data, response status code and response headers + def list_data_fields_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DataFieldsApi.list_data_fields ...' + end + # resource path + local_var_path = '/api/v1/data_fields' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'user_key'] = opts[:'user_key'] if !opts[:'user_key'].nil? + query_params[:'event_trigger'] = opts[:'event_trigger'] if !opts[:'event_trigger'].nil? + query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListDataFields200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"DataFieldsApi.list_data_fields", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DataFieldsApi#list_data_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List workflow data fields + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :node_id Node ID to determine current workflow position + # @option opts [String] :parent_node_id Parent node ID to determine workflow position + # @option opts [String] :user_key User context for determining available data fields + # @option opts [String] :event_trigger Event trigger context for determining available data fields + # @option opts [String] :action_event_trigger Action's event trigger context for determining available data fields + # @option opts [ListDataFieldsTypeParameter] :type Data type filter - can be a single type or multiple types + # @return [ListDataFields200Response] + def list_workflow_data_fields(id:, **opts) + data, _status_code, _headers = list_workflow_data_fields_with_http_info(id, opts) + data + end + + # List workflow data fields + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :node_id Node ID to determine current workflow position + # @option opts [String] :parent_node_id Parent node ID to determine workflow position + # @option opts [String] :user_key User context for determining available data fields + # @option opts [String] :event_trigger Event trigger context for determining available data fields + # @option opts [String] :action_event_trigger Action's event trigger context for determining available data fields + # @option opts [ListDataFieldsTypeParameter] :type Data type filter - can be a single type or multiple types + # @return [Array<(ListDataFields200Response, Integer, Hash)>] ListDataFields200Response data, response status code and response headers + def list_workflow_data_fields_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DataFieldsApi.list_workflow_data_fields ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DataFieldsApi.list_workflow_data_fields" + end + # resource path + local_var_path = '/api/v1/workflows/{id}/data_fields'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'node_id'] = opts[:'node_id'] if !opts[:'node_id'].nil? + query_params[:'parent_node_id'] = opts[:'parent_node_id'] if !opts[:'parent_node_id'].nil? + query_params[:'user_key'] = opts[:'user_key'] if !opts[:'user_key'].nil? + query_params[:'event_trigger'] = opts[:'event_trigger'] if !opts[:'event_trigger'].nil? + query_params[:'action_event_trigger'] = opts[:'action_event_trigger'] if !opts[:'action_event_trigger'].nil? + query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListDataFields200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"DataFieldsApi.list_workflow_data_fields", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DataFieldsApi#list_workflow_data_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/events_api.rb b/lib/embed_workflow/api/events_api.rb new file mode 100644 index 0000000..e7bbb89 --- /dev/null +++ b/lib/embed_workflow/api/events_api.rb @@ -0,0 +1,86 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class EventsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # List events + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [ListEvents200Response] + def list_events(**opts) + data, _status_code, _headers = list_events_with_http_info(opts) + data + end + + # List events + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [Array<(ListEvents200Response, Integer, Hash)>] ListEvents200Response data, response status code and response headers + def list_events_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EventsApi.list_events ...' + end + # resource path + local_var_path = '/api/v1/events' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListEvents200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"EventsApi.list_events", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EventsApi#list_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/executions_api.rb b/lib/embed_workflow/api/executions_api.rb new file mode 100644 index 0000000..d60b557 --- /dev/null +++ b/lib/embed_workflow/api/executions_api.rb @@ -0,0 +1,225 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class ExecutionsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # List workflow executions + # @param workflow_id [String] Filter results by workflow id + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [ListWorkflowExecutions200Response] + def list_workflow_executions(workflow_id:, **opts) + data, _status_code, _headers = list_workflow_executions_with_http_info(workflow_id, opts) + data + end + + # List workflow executions + # @param workflow_id [String] Filter results by workflow id + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [Array<(ListWorkflowExecutions200Response, Integer, Hash)>] ListWorkflowExecutions200Response data, response status code and response headers + def list_workflow_executions_with_http_info(workflow_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ExecutionsApi.list_workflow_executions ...' + end + # verify the required parameter 'workflow_id' is set + if @api_client.config.client_side_validation && workflow_id.nil? + fail ArgumentError, "Missing the required parameter 'workflow_id' when calling ExecutionsApi.list_workflow_executions" + end + # resource path + local_var_path = '/api/v1/workflows/{workflow_id}/executions'.sub('{' + 'workflow_id' + '}', CGI.escape(workflow_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListWorkflowExecutions200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ExecutionsApi.list_workflow_executions", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ExecutionsApi#list_workflow_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve execution + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :id_type Type of identifier used in the URL + # @return [RetrieveExecution200Response] + def retrieve_execution(id:, **opts) + data, _status_code, _headers = retrieve_execution_with_http_info(id, opts) + data + end + + # Retrieve execution + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :id_type Type of identifier used in the URL + # @return [Array<(RetrieveExecution200Response, Integer, Hash)>] RetrieveExecution200Response data, response status code and response headers + def retrieve_execution_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ExecutionsApi.retrieve_execution ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ExecutionsApi.retrieve_execution" + end + # resource path + local_var_path = '/api/v1/executions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'id_type'] = opts[:'id_type'] if !opts[:'id_type'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RetrieveExecution200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ExecutionsApi.retrieve_execution", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ExecutionsApi#retrieve_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Stop executions + # @param [Hash] opts the optional parameters + # @param user_key [String] User's key + # @option opts [String] :filters Data to filter + # @param [Hash] **extra Additional properties to include in the request body + # @return [Object] + def stop_executions(user_key:, **opts) + opts[:'stop_executions_request'] = { + user_key: user_key, + filters: opts.delete(:filters), + **opts.reject { |k, _| k.to_s.start_with?('debug_') } + } + data, _status_code, _headers = stop_executions_with_http_info(opts) + data + end + + # Stop executions + # @param [Hash] opts the optional parameters + # @option opts [StopExecutionsRequest] :stop_executions_request + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def stop_executions_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ExecutionsApi.stop_executions ...' + end + # resource path + local_var_path = '/api/v1/executions/stop' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'stop_executions_request']) + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"ExecutionsApi.stop_executions", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ExecutionsApi#stop_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/installed_apps_api.rb b/lib/embed_workflow/api/installed_apps_api.rb new file mode 100644 index 0000000..a7b8c94 --- /dev/null +++ b/lib/embed_workflow/api/installed_apps_api.rb @@ -0,0 +1,276 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class InstalledAppsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Install app + # @param [Hash] opts the optional parameters + # @param app_identifier [String] App indentifier + # @option opts [Array] :groups User permission groups. Only available to users with admin role. + # @return [InstallApp201Response] + def install_app(app_identifier:, **opts) + opts[:'install_app_request'] = InstallAppRequest.new( + app_identifier: app_identifier, + groups: opts.delete(:groups), + ) + data, _status_code, _headers = install_app_with_http_info(opts) + data + end + + # Install app + # @param [Hash] opts the optional parameters + # @option opts [InstallAppRequest] :install_app_request + # @return [Array<(InstallApp201Response, Integer, Hash)>] InstallApp201Response data, response status code and response headers + def install_app_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: InstalledAppsApi.install_app ...' + end + # resource path + local_var_path = '/api/v1/installed_apps' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'install_app_request']) + + # return_type + return_type = opts[:debug_return_type] || 'InstallApp201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"InstalledAppsApi.install_app", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: InstalledAppsApi#install_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List installed apps + # @param [Hash] opts the optional parameters + # @return [ListInstalledApps200Response] + def list_installed_apps(**opts) + data, _status_code, _headers = list_installed_apps_with_http_info(opts) + data + end + + # List installed apps + # @param [Hash] opts the optional parameters + # @return [Array<(ListInstalledApps200Response, Integer, Hash)>] ListInstalledApps200Response data, response status code and response headers + def list_installed_apps_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: InstalledAppsApi.list_installed_apps ...' + end + # resource path + local_var_path = '/api/v1/installed_apps' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListInstalledApps200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"InstalledAppsApi.list_installed_apps", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: InstalledAppsApi#list_installed_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve installed app + # @param app_identifier [String] App indentifier + # @param [Hash] opts the optional parameters + # @return [InstallApp201Response] + def retrieve_installed_app(app_identifier:, **opts) + data, _status_code, _headers = retrieve_installed_app_with_http_info(app_identifier, opts) + data + end + + # Retrieve installed app + # @param app_identifier [String] App indentifier + # @param [Hash] opts the optional parameters + # @return [Array<(InstallApp201Response, Integer, Hash)>] InstallApp201Response data, response status code and response headers + def retrieve_installed_app_with_http_info(app_identifier, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: InstalledAppsApi.retrieve_installed_app ...' + end + # verify the required parameter 'app_identifier' is set + if @api_client.config.client_side_validation && app_identifier.nil? + fail ArgumentError, "Missing the required parameter 'app_identifier' when calling InstalledAppsApi.retrieve_installed_app" + end + # resource path + local_var_path = '/api/v1/installed_apps/{app_identifier}'.sub('{' + 'app_identifier' + '}', CGI.escape(app_identifier.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'InstallApp201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"InstalledAppsApi.retrieve_installed_app", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: InstalledAppsApi#retrieve_installed_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update installed app + # @param app_identifier [String] App indentifier + # @param [Hash] opts the optional parameters + # @option opts [Array] :groups User permission groups. Only available to users with admin role. + # @return [InstallApp201Response] + def update_installed_app(app_identifier:, **opts) + opts[:'update_installed_app_request'] = UpdateInstalledAppRequest.new( + groups: opts.delete(:groups), + ) + data, _status_code, _headers = update_installed_app_with_http_info(app_identifier, opts) + data + end + + # Update installed app + # @param app_identifier [String] App indentifier + # @param [Hash] opts the optional parameters + # @option opts [UpdateInstalledAppRequest] :update_installed_app_request + # @return [Array<(InstallApp201Response, Integer, Hash)>] InstallApp201Response data, response status code and response headers + def update_installed_app_with_http_info(app_identifier, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: InstalledAppsApi.update_installed_app ...' + end + # verify the required parameter 'app_identifier' is set + if @api_client.config.client_side_validation && app_identifier.nil? + fail ArgumentError, "Missing the required parameter 'app_identifier' when calling InstalledAppsApi.update_installed_app" + end + # resource path + local_var_path = '/api/v1/installed_apps/{app_identifier}'.sub('{' + 'app_identifier' + '}', CGI.escape(app_identifier.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_installed_app_request']) + + # return_type + return_type = opts[:debug_return_type] || 'InstallApp201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"InstalledAppsApi.update_installed_app", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: InstalledAppsApi#update_installed_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/payments_api.rb b/lib/embed_workflow/api/payments_api.rb new file mode 100644 index 0000000..50885fa --- /dev/null +++ b/lib/embed_workflow/api/payments_api.rb @@ -0,0 +1,86 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class PaymentsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # List payments + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [ListEvents200Response] + def list_payments(**opts) + data, _status_code, _headers = list_payments_with_http_info(opts) + data + end + + # List payments + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [Array<(ListEvents200Response, Integer, Hash)>] ListEvents200Response data, response status code and response headers + def list_payments_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PaymentsApi.list_payments ...' + end + # resource path + local_var_path = '/api/v1/payments' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListEvents200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"PaymentsApi.list_payments", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PaymentsApi#list_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/triggers_api.rb b/lib/embed_workflow/api/triggers_api.rb new file mode 100644 index 0000000..4fb9c18 --- /dev/null +++ b/lib/embed_workflow/api/triggers_api.rb @@ -0,0 +1,281 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class TriggersApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Delete trigger + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [DeleteActionType200Response] + def delete_trigger(id:, **opts) + data, _status_code, _headers = delete_trigger_with_http_info(id, opts) + data + end + + # Delete trigger + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [Array<(DeleteActionType200Response, Integer, Hash)>] DeleteActionType200Response data, response status code and response headers + def delete_trigger_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TriggersApi.delete_trigger ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TriggersApi.delete_trigger" + end + # resource path + local_var_path = '/api/v1/triggers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'DeleteActionType200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"TriggersApi.delete_trigger", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TriggersApi#delete_trigger\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List triggers + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [ListTriggers200Response] + def list_triggers(**opts) + data, _status_code, _headers = list_triggers_with_http_info(opts) + data + end + + # List triggers + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [Array<(ListTriggers200Response, Integer, Hash)>] ListTriggers200Response data, response status code and response headers + def list_triggers_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TriggersApi.list_triggers ...' + end + # resource path + local_var_path = '/api/v1/triggers' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListTriggers200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"TriggersApi.list_triggers", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TriggersApi#list_triggers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve trigger + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [ListTriggers200ResponseCollectionInner] + def retrieve_trigger(id:, **opts) + data, _status_code, _headers = retrieve_trigger_with_http_info(id, opts) + data + end + + # Retrieve trigger + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [Array<(ListTriggers200ResponseCollectionInner, Integer, Hash)>] ListTriggers200ResponseCollectionInner data, response status code and response headers + def retrieve_trigger_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TriggersApi.retrieve_trigger ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TriggersApi.retrieve_trigger" + end + # resource path + local_var_path = '/api/v1/triggers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListTriggers200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"TriggersApi.retrieve_trigger", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TriggersApi#retrieve_trigger\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update trigger + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :event The trigger's key + # @option opts [String] :title Title + # @return [ListTriggers200ResponseCollectionInner] + def update_trigger(id:, **opts) + opts[:'update_trigger_request'] = UpdateTriggerRequest.new( + event: opts.delete(:event), + title: opts.delete(:title), + ) + data, _status_code, _headers = update_trigger_with_http_info(id, opts) + data + end + + # Update trigger + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [UpdateTriggerRequest] :update_trigger_request + # @return [Array<(ListTriggers200ResponseCollectionInner, Integer, Hash)>] ListTriggers200ResponseCollectionInner data, response status code and response headers + def update_trigger_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TriggersApi.update_trigger ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TriggersApi.update_trigger" + end + # resource path + local_var_path = '/api/v1/triggers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_trigger_request']) + + # return_type + return_type = opts[:debug_return_type] || 'ListTriggers200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"TriggersApi.update_trigger", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TriggersApi#update_trigger\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/users_api.rb b/lib/embed_workflow/api/users_api.rb new file mode 100644 index 0000000..721535b --- /dev/null +++ b/lib/embed_workflow/api/users_api.rb @@ -0,0 +1,359 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class UsersApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create user token + # @param [Hash] opts the optional parameters + # @option opts [String] :key User's key + # @option opts [String] :id System-generated unique identifier + # @param [Hash] **extra Additional properties to include in the request body + # @return [CreateUserToken200Response] + def create_user_token(**opts) + opts[:'create_user_token_request'] = { + key: opts.delete(:key), + id: opts.delete(:id), + **opts.reject { |k, _| k.to_s.start_with?('debug_') } + } + data, _status_code, _headers = create_user_token_with_http_info(opts) + data + end + + # Create user token + # @param [Hash] opts the optional parameters + # @option opts [CreateUserTokenRequest] :create_user_token_request + # @return [Array<(CreateUserToken200Response, Integer, Hash)>] CreateUserToken200Response data, response status code and response headers + def create_user_token_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsersApi.create_user_token ...' + end + # resource path + local_var_path = '/api/v1/user_token' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_user_token_request']) + + # return_type + return_type = opts[:debug_return_type] || 'CreateUserToken200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"UsersApi.create_user_token", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UsersApi#create_user_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete user + # @param key [String] Client-provided unique identifier + # @param [Hash] opts the optional parameters + # @return [ListUsers200ResponseCollectionInner] + def delete_user(key:, **opts) + data, _status_code, _headers = delete_user_with_http_info(key, opts) + data + end + + # Delete user + # @param key [String] Client-provided unique identifier + # @param [Hash] opts the optional parameters + # @return [Array<(ListUsers200ResponseCollectionInner, Integer, Hash)>] ListUsers200ResponseCollectionInner data, response status code and response headers + def delete_user_with_http_info(key, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsersApi.delete_user ...' + end + # verify the required parameter 'key' is set + if @api_client.config.client_side_validation && key.nil? + fail ArgumentError, "Missing the required parameter 'key' when calling UsersApi.delete_user" + end + # resource path + local_var_path = '/api/v1/users/{key}'.sub('{' + 'key' + '}', CGI.escape(key.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListUsers200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"UsersApi.delete_user", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UsersApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List users + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :search Search users by key + # @return [ListUsers200Response] + def list_users(**opts) + data, _status_code, _headers = list_users_with_http_info(opts) + data + end + + # List users + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :search Search users by key + # @return [Array<(ListUsers200Response, Integer, Hash)>] ListUsers200Response data, response status code and response headers + def list_users_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsersApi.list_users ...' + end + # resource path + local_var_path = '/api/v1/users' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListUsers200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"UsersApi.list_users", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UsersApi#list_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve user + # @param key [String] Client-provided unique identifier + # @param [Hash] opts the optional parameters + # @return [ListUsers200ResponseCollectionInner] + def retrieve_user(key:, **opts) + data, _status_code, _headers = retrieve_user_with_http_info(key, opts) + data + end + + # Retrieve user + # @param key [String] Client-provided unique identifier + # @param [Hash] opts the optional parameters + # @return [Array<(ListUsers200ResponseCollectionInner, Integer, Hash)>] ListUsers200ResponseCollectionInner data, response status code and response headers + def retrieve_user_with_http_info(key, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsersApi.retrieve_user ...' + end + # verify the required parameter 'key' is set + if @api_client.config.client_side_validation && key.nil? + fail ArgumentError, "Missing the required parameter 'key' when calling UsersApi.retrieve_user" + end + # resource path + local_var_path = '/api/v1/users/{key}'.sub('{' + 'key' + '}', CGI.escape(key.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListUsers200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"UsersApi.retrieve_user", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UsersApi#retrieve_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Upsert user + # @param key [String] Client-provided unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :name Name of resource + # @option opts [String] :email Email address + # @option opts [Hash] :data Additional user data + # @option opts [Array] :groups User permission groups. Only available to users with admin role. + # @option opts [String] :time_zone Time zone + # @return [ListUsers200ResponseCollectionInner] + def upsert_user(key:, **opts) + opts[:'upsert_user_request'] = UpsertUserRequest.new( + name: opts.delete(:name), + email: opts.delete(:email), + data: opts.delete(:data), + groups: opts.delete(:groups), + time_zone: opts.delete(:time_zone), + ) + data, _status_code, _headers = upsert_user_with_http_info(key, opts) + data + end + + # Upsert user + # @param key [String] Client-provided unique identifier + # @param [Hash] opts the optional parameters + # @option opts [UpsertUserRequest] :upsert_user_request + # @return [Array<(ListUsers200ResponseCollectionInner, Integer, Hash)>] ListUsers200ResponseCollectionInner data, response status code and response headers + def upsert_user_with_http_info(key, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsersApi.upsert_user ...' + end + # verify the required parameter 'key' is set + if @api_client.config.client_side_validation && key.nil? + fail ArgumentError, "Missing the required parameter 'key' when calling UsersApi.upsert_user" + end + # resource path + local_var_path = '/api/v1/users/{key}'.sub('{' + 'key' + '}', CGI.escape(key.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'upsert_user_request']) + + # return_type + return_type = opts[:debug_return_type] || 'ListUsers200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"UsersApi.upsert_user", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UsersApi#upsert_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api/workflows_api.rb b/lib/embed_workflow/api/workflows_api.rb new file mode 100644 index 0000000..7d9ed5a --- /dev/null +++ b/lib/embed_workflow/api/workflows_api.rb @@ -0,0 +1,926 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'cgi' + +module EmbedWorkflow + class WorkflowsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Catch hook + # @param hook_id [String] The trigger's hook id used for third party webhooks + # @param [Hash] opts the optional parameters + # @param user_key [String] User's key + # @param [Hash] **extra Additional properties to include in the request body + # @return [Object] + def catch_hook(hook_id:, user_key:, **opts) + opts[:'catch_hook_request'] = { + user_key: user_key, + **opts.reject { |k, _| k.to_s.start_with?('debug_') } + } + data, _status_code, _headers = catch_hook_with_http_info(hook_id, opts) + data + end + + # Catch hook + # @param hook_id [String] The trigger's hook id used for third party webhooks + # @param [Hash] opts the optional parameters + # @option opts [CatchHookRequest] :catch_hook_request + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def catch_hook_with_http_info(hook_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.catch_hook ...' + end + # verify the required parameter 'hook_id' is set + if @api_client.config.client_side_validation && hook_id.nil? + fail ArgumentError, "Missing the required parameter 'hook_id' when calling WorkflowsApi.catch_hook" + end + # resource path + local_var_path = '/api/v1/hooks/{hook_id}/catch'.sub('{' + 'hook_id' + '}', CGI.escape(hook_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'catch_hook_request']) + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.catch_hook", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#catch_hook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Clone workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key User's key + # @option opts [Array] :expand Expand related objects + # @return [ListWorkflows200ResponseCollectionInner] + def clone_workflow(id:, **opts) + opts[:'discard_workflow_draft_request'] = DiscardWorkflowDraftRequest.new( + user_key: opts.delete(:user_key), + expand: opts.delete(:expand), + ) + data, _status_code, _headers = clone_workflow_with_http_info(id, opts) + data + end + + # Clone workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [DiscardWorkflowDraftRequest] :discard_workflow_draft_request + # @return [Array<(ListWorkflows200ResponseCollectionInner, Integer, Hash)>] ListWorkflows200ResponseCollectionInner data, response status code and response headers + def clone_workflow_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.clone_workflow ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling WorkflowsApi.clone_workflow" + end + # resource path + local_var_path = '/api/v1/workflows/{id}/clone'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'discard_workflow_draft_request']) + + # return_type + return_type = opts[:debug_return_type] || 'ListWorkflows200ResponseCollectionInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.clone_workflow", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#clone_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create workflow + # @param [Hash] opts the optional parameters + # @param name [String] Name of resource + # @option opts [String] :user_key User's key + # @option opts [String] :details Description of the resource + # @option opts [CreateWorkflowRequestTemplateDraft] :template_draft + # @option opts [Object] :trigger_conditions_draft The trigger's conditions + # @option opts [String] :event_trigger_draft The trigger's key + # @option opts [String] :match_conditions_draft Whether all or any of the trigger conditions must match + # @option opts [Array] :groups User permission groups. Only available to users with admin role. + # @return [CreateWorkflow201Response] + def create_workflow(name:, **opts) + opts[:'create_workflow_request'] = CreateWorkflowRequest.new( + name: name, + user_key: opts.delete(:user_key), + details: opts.delete(:details), + template_draft: opts.delete(:template_draft), + trigger_conditions_draft: opts.delete(:trigger_conditions_draft), + event_trigger_draft: opts.delete(:event_trigger_draft), + match_conditions_draft: opts.delete(:match_conditions_draft), + groups: opts.delete(:groups), + ) + data, _status_code, _headers = create_workflow_with_http_info(opts) + data + end + + # Create workflow + # @param [Hash] opts the optional parameters + # @option opts [CreateWorkflowRequest] :create_workflow_request + # @return [Array<(CreateWorkflow201Response, Integer, Hash)>] CreateWorkflow201Response data, response status code and response headers + def create_workflow_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.create_workflow ...' + end + # resource path + local_var_path = '/api/v1/workflows' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_workflow_request']) + + # return_type + return_type = opts[:debug_return_type] || 'CreateWorkflow201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.create_workflow", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#create_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :id_type Type of identifier used in the URL + # @option opts [String] :user_key Unique user identifier + # @return [DeleteWorkflow200Response] + def delete_workflow(id:, **opts) + data, _status_code, _headers = delete_workflow_with_http_info(id, opts) + data + end + + # Delete workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :id_type Type of identifier used in the URL + # @option opts [String] :user_key Unique user identifier + # @return [Array<(DeleteWorkflow200Response, Integer, Hash)>] DeleteWorkflow200Response data, response status code and response headers + def delete_workflow_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.delete_workflow ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling WorkflowsApi.delete_workflow" + end + # resource path + local_var_path = '/api/v1/workflows/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'id_type'] = opts[:'id_type'] if !opts[:'id_type'].nil? + query_params[:'user_key'] = opts[:'user_key'] if !opts[:'user_key'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'DeleteWorkflow200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.delete_workflow", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#delete_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Discard workflow draft + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key User's key + # @option opts [Array] :expand Expand related objects + # @return [CreateWorkflow201Response] + def discard_workflow_draft(id:, **opts) + opts[:'discard_workflow_draft_request'] = DiscardWorkflowDraftRequest.new( + user_key: opts.delete(:user_key), + expand: opts.delete(:expand), + ) + data, _status_code, _headers = discard_workflow_draft_with_http_info(id, opts) + data + end + + # Discard workflow draft + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [DiscardWorkflowDraftRequest] :discard_workflow_draft_request + # @return [Array<(CreateWorkflow201Response, Integer, Hash)>] CreateWorkflow201Response data, response status code and response headers + def discard_workflow_draft_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.discard_workflow_draft ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling WorkflowsApi.discard_workflow_draft" + end + # resource path + local_var_path = '/api/v1/workflows/{id}/discard_draft'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'discard_workflow_draft_request']) + + # return_type + return_type = opts[:debug_return_type] || 'CreateWorkflow201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.discard_workflow_draft", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#discard_workflow_draft\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Execute workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :id_type Type of identifier used in the URL + # @option opts [String] :user_key User's key + # @option opts [Hash] :execution_data Data required to execute the workflow. Key-value pairs that provide context and variables needed during workflow execution. + # @return [ExecuteWorkflow201Response] + def execute_workflow(id:, **opts) + opts[:'execute_workflow_request'] = ExecuteWorkflowRequest.new( + id_type: opts.delete(:id_type), + user_key: opts.delete(:user_key), + execution_data: opts.delete(:execution_data), + ) + data, _status_code, _headers = execute_workflow_with_http_info(id, opts) + data + end + + # Execute workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [ExecuteWorkflowRequest] :execute_workflow_request + # @return [Array<(ExecuteWorkflow201Response, Integer, Hash)>] ExecuteWorkflow201Response data, response status code and response headers + def execute_workflow_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.execute_workflow ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling WorkflowsApi.execute_workflow" + end + # resource path + local_var_path = '/api/v1/workflows/{id}/execute'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'execute_workflow_request']) + + # return_type + return_type = opts[:debug_return_type] || 'ExecuteWorkflow201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.execute_workflow", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#execute_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List workflow versions + # @param workflow_id [String] Filter results by workflow id + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :user_key Unique user identifier + # @return [ListWorkflowVersions200Response] + def list_workflow_versions(workflow_id:, **opts) + data, _status_code, _headers = list_workflow_versions_with_http_info(workflow_id, opts) + data + end + + # List workflow versions + # @param workflow_id [String] Filter results by workflow id + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :user_key Unique user identifier + # @return [Array<(ListWorkflowVersions200Response, Integer, Hash)>] ListWorkflowVersions200Response data, response status code and response headers + def list_workflow_versions_with_http_info(workflow_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.list_workflow_versions ...' + end + # verify the required parameter 'workflow_id' is set + if @api_client.config.client_side_validation && workflow_id.nil? + fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowsApi.list_workflow_versions" + end + # resource path + local_var_path = '/api/v1/workflows/{workflow_id}/versions'.sub('{' + 'workflow_id' + '}', CGI.escape(workflow_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'user_key'] = opts[:'user_key'] if !opts[:'user_key'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListWorkflowVersions200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.list_workflow_versions", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#list_workflow_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List workflows + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [Array] :expand Expand related objects + # @option opts [String] :user_key Unique user identifier + # @option opts [Boolean] :is_template Filter workflows by is_template value + # @option opts [Boolean] :on Filter workflows by on value + # @option opts [String] :order_by Field to order results by + # @option opts [String] :order_direction + # @return [ListWorkflows200Response] + def list_workflows(**opts) + data, _status_code, _headers = list_workflows_with_http_info(opts) + data + end + + # List workflows + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [Array] :expand Expand related objects + # @option opts [String] :user_key Unique user identifier + # @option opts [Boolean] :is_template Filter workflows by is_template value + # @option opts [Boolean] :on Filter workflows by on value + # @option opts [String] :order_by Field to order results by + # @option opts [String] :order_direction + # @return [Array<(ListWorkflows200Response, Integer, Hash)>] ListWorkflows200Response data, response status code and response headers + def list_workflows_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.list_workflows ...' + end + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'order_direction'] && !allowable_values.include?(opts[:'order_direction']) + fail ArgumentError, "invalid value for \"order_direction\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v1/workflows' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? + query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? + query_params[:'user_key'] = opts[:'user_key'] if !opts[:'user_key'].nil? + query_params[:'is_template'] = opts[:'is_template'] if !opts[:'is_template'].nil? + query_params[:'on'] = opts[:'on'] if !opts[:'on'].nil? + query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil? + query_params[:'order_direction'] = opts[:'order_direction'] if !opts[:'order_direction'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListWorkflows200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.list_workflows", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#list_workflows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Publish workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key User's key + # @return [CreateWorkflow201Response] + def publish_workflow(id:, **opts) + opts[:'publish_workflow_request'] = PublishWorkflowRequest.new( + user_key: opts.delete(:user_key), + ) + data, _status_code, _headers = publish_workflow_with_http_info(id, opts) + data + end + + # Publish workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [PublishWorkflowRequest] :publish_workflow_request + # @return [Array<(CreateWorkflow201Response, Integer, Hash)>] CreateWorkflow201Response data, response status code and response headers + def publish_workflow_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.publish_workflow ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling WorkflowsApi.publish_workflow" + end + # resource path + local_var_path = '/api/v1/workflows/{id}/publish'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'publish_workflow_request']) + + # return_type + return_type = opts[:debug_return_type] || 'CreateWorkflow201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.publish_workflow", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#publish_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :id_type Type of identifier used in the URL + # @option opts [String] :user_key Unique user identifier + # @option opts [Array] :expand Expand related objects + # @return [CreateWorkflow201Response] + def retrieve_workflow(id:, **opts) + data, _status_code, _headers = retrieve_workflow_with_http_info(id, opts) + data + end + + # Retrieve workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :id_type Type of identifier used in the URL + # @option opts [String] :user_key Unique user identifier + # @option opts [Array] :expand Expand related objects + # @return [Array<(CreateWorkflow201Response, Integer, Hash)>] CreateWorkflow201Response data, response status code and response headers + def retrieve_workflow_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.retrieve_workflow ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling WorkflowsApi.retrieve_workflow" + end + # resource path + local_var_path = '/api/v1/workflows/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'id_type'] = opts[:'id_type'] if !opts[:'id_type'].nil? + query_params[:'user_key'] = opts[:'user_key'] if !opts[:'user_key'].nil? + query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CreateWorkflow201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.retrieve_workflow", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#retrieve_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Trigger workflow + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key User's key + # @option opts [Hash] :execution_data Data required to execute the workflow. Key-value pairs that provide context and variables needed during workflow execution. + # @option opts [String] :event The trigger's key + # @option opts [Array] :workflow_ids Array of workflow ids. + # @option opts [Array] :workflow_keys Array of workflow keys. + # @return [Object] + def trigger_workflow(**opts) + opts[:'trigger_workflow_request'] = TriggerWorkflowRequest.new( + user_key: opts.delete(:user_key), + execution_data: opts.delete(:execution_data), + event: opts.delete(:event), + workflow_ids: opts.delete(:workflow_ids), + workflow_keys: opts.delete(:workflow_keys), + ) + data, _status_code, _headers = trigger_workflow_with_http_info(opts) + data + end + + # Trigger workflow + # @param [Hash] opts the optional parameters + # @option opts [TriggerWorkflowRequest] :trigger_workflow_request + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def trigger_workflow_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.trigger_workflow ...' + end + # resource path + local_var_path = '/api/v1/trigger' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'trigger_workflow_request']) + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.trigger_workflow", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#trigger_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @param name [String] Name of resource + # @option opts [String] :key Client-provided unique identifier + # @option opts [Boolean] :auto_clone_for_new_users Mark workflow as default template. When true, new users will automatically receive a clone of this workflow (Admin only) + # @option opts [Boolean] :is_template Mark workflow as a template. When true, new users will see this in a library of templates (Admin only) + # @option opts [Boolean] :on Enable or disable the resource. + # @option opts [String] :details Description of the resource + # @option opts [CreateWorkflowRequestTemplateDraft] :template_draft + # @option opts [Object] :trigger_conditions_draft The trigger's conditions + # @option opts [String] :event_trigger_draft The trigger's key + # @option opts [String] :match_conditions_draft Whether all or any of the trigger conditions must match + # @option opts [Array] :groups User permission groups. Only available to users with admin role. + # @return [nil] + def update_workflow(id:, name:, **opts) + opts[:'update_workflow_request'] = UpdateWorkflowRequest.new( + name: name, + key: opts.delete(:key), + auto_clone_for_new_users: opts.delete(:auto_clone_for_new_users), + is_template: opts.delete(:is_template), + on: opts.delete(:on), + details: opts.delete(:details), + template_draft: opts.delete(:template_draft), + trigger_conditions_draft: opts.delete(:trigger_conditions_draft), + event_trigger_draft: opts.delete(:event_trigger_draft), + match_conditions_draft: opts.delete(:match_conditions_draft), + groups: opts.delete(:groups), + ) + update_workflow_with_http_info(id, opts) + nil + end + + # Update workflow + # @param id [String] System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [UpdateWorkflowRequest] :update_workflow_request + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_workflow_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowsApi.update_workflow ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling WorkflowsApi.update_workflow" + end + # resource path + local_var_path = '/api/v1/workflows/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_workflow_request']) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearer'] + + new_options = opts.merge( + :operation => :"WorkflowsApi.update_workflow", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowsApi#update_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/embed_workflow/api_client.rb b/lib/embed_workflow/api_client.rb new file mode 100644 index 0000000..344b136 --- /dev/null +++ b/lib/embed_workflow/api_client.rb @@ -0,0 +1,431 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'json' +require 'logger' +require 'tempfile' +require 'time' +require 'faraday' +require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0') + + +module EmbedWorkflow + class ApiClient + # The Configuration object holding settings to be used in the API client. + attr_accessor :config + + # Defines the headers to be used in HTTP requests of all API calls by default. + # + # @return [Hash] + attr_accessor :default_headers + + # Initializes the ApiClient + # @option config [Configuration] Configuration for initializing the object, default to Configuration.default + def initialize(config = Configuration.default) + @config = config + @user_agent = "embed-workflow-ruby/#{VERSION}" + @default_headers = { + 'Content-Type' => 'application/json', + 'User-Agent' => @user_agent + } + end + + def self.default + @@default ||= ApiClient.new + end + + # Call an API with given options. + # + # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: + # the data deserialized from response body (could be nil), response status code and response headers. + def call_api(http_method, path, opts = {}) + stream = nil + begin + response = connection(opts).public_send(http_method.to_sym.downcase) do |req| + request = build_request(http_method, path, req, opts) + stream = download_file(request) if opts[:return_type] == 'File' || opts[:return_type] == 'Binary' + end + + if config.debugging + config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end + + unless response.success? + if response.status == 0 && response.respond_to?(:return_message) + # Errors from libcurl will be made visible here + fail ApiError.new(code: 0, + message: response.return_message) + else + fail ApiError.new(code: response.status, + response_headers: response.headers, + response_body: response.body), + response.reason_phrase + end + end + rescue Faraday::TimeoutError + fail ApiError.new('Connection timed out') + rescue Faraday::ConnectionFailed + fail ApiError.new('Connection failed') + end + + if opts[:return_type] == 'File' || opts[:return_type] == 'Binary' + data = deserialize_file(response, stream) + elsif opts[:return_type] + data = deserialize(response, opts[:return_type]) + else + data = nil + end + return data, response.status, response.headers + end + + # Builds the HTTP request + # + # @param [String] http_method HTTP method/verb (e.g. POST) + # @param [String] path URL path (e.g. /account/new) + # @option opts [Hash] :header_params Header parameters + # @option opts [Hash] :query_params Query parameters + # @option opts [Hash] :form_params Query parameters + # @option opts [Object] :body HTTP body (JSON/XML) + # @return [Faraday::Request] A Faraday Request + def build_request(http_method, path, request, opts = {}) + url = build_request_url(path, opts) + http_method = http_method.to_sym.downcase + + header_params = @default_headers.merge(opts[:header_params] || {}) + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + + update_params_for_auth! header_params, query_params, opts[:auth_names] + + if [:post, :patch, :put, :delete].include?(http_method) + req_body = build_request_body(header_params, form_params, opts[:body]) + if config.debugging + config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" + end + end + request.headers = header_params + request.body = req_body + + # Overload default options only if provided + request.options.params_encoder = config.params_encoder if config.params_encoder + request.options.timeout = config.timeout if config.timeout + + request.url url + request.params = query_params + request + end + + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' + data = URI.encode_www_form(form_params) + elsif header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Tempfile + # TODO hardcode to application/octet-stream, need better way to detect content type + data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path) + when ::Array, nil + # let Faraday handle Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + + def download_file(request) + stream = [] + + # handle streaming Responses + request.options.on_data = Proc.new do |chunk, overall_received_bytes| + stream << chunk + end + stream + end + + def deserialize_file(response, stream) + body = response.body + if @config.return_binary_data == true + # return byte stream + encoding = body.encoding + stream.join.force_encoding(encoding) + else + # return file instead of binary data + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = body.encoding + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + tempfile.write(stream.join.force_encoding(encoding)) + tempfile.close + config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + tempfile + end + end + + def connection(opts) + opts[:header_params]['Content-Type'] == 'multipart/form-data' ? connection_multipart : connection_regular + end + + def connection_multipart + @connection_multipart ||= build_connection do |conn| + conn.request :multipart + conn.request :url_encoded + end + end + + def connection_regular + @connection_regular ||= build_connection + end + + def build_connection + Faraday.new(url: config.base_url, ssl: ssl_options, proxy: config.proxy) do |conn| + basic_auth(conn) + config.configure_middleware(conn) + yield(conn) if block_given? + conn.adapter(Faraday.default_adapter) + config.configure_connection(conn) + end + end + + def ssl_options + { + ca_file: config.ssl_ca_file, + verify: config.ssl_verify, + verify_mode: config.ssl_verify_mode, + client_cert: config.ssl_client_cert, + client_key: config.ssl_client_key + } + end + + def basic_auth(conn) + if config.username && config.password + if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0') + conn.request(:authorization, :basic, config.username, config.password) + else + conn.request(:basic_auth, config.username, config.password) + end + end + end + + # Check if the given MIME is a JSON MIME. + # JSON MIME examples: + # application/json + # application/json; charset=UTF8 + # APPLICATION/JSON + # */* + # @param [String] mime MIME + # @return [Boolean] True if the MIME is application/json + def json_mime?(mime) + (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + end + + # Deserialize the response to the given return type. + # + # @param [Response] response HTTP response + # @param [String] return_type some examples: "User", "Array", "Hash" + def deserialize(response, return_type) + body = response.body + return nil if body.nil? || body.empty? + + # return response body directly for String return type + return body.to_s if return_type == 'String' + + # ensuring a default content type + content_type = response.headers['Content-Type'] || 'application/json' + + fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) + + begin + data = JSON.parse("[#{body}]", :symbolize_names => true)[0] + rescue JSON::ParserError => e + if %w(String Date Time).include?(return_type) + data = body + else + raise e + end + end + + convert_to_type data, return_type + end + + # Convert data to the given return type. + # @param [Object] data Data to be converted + # @param [String] return_type Return type + # @return [Mixed] Data in a particular type + def convert_to_type(data, return_type) + return nil if data.nil? + case return_type + when 'String' + data.to_s + when 'Integer' + data.to_i + when 'Float' + data.to_f + when 'Boolean' + data == true + when 'Time' + # parse date time (expecting ISO 8601 format) + Time.parse data + when 'Date' + # parse date time (expecting ISO 8601 format) + Date.parse data + when 'Object' + # generic object (usually a Hash), return directly + data + when /\AArray<(.+)>\z/ + # e.g. Array + sub_type = $1 + data.map { |item| convert_to_type(item, sub_type) } + when /\AHash\\z/ + # e.g. Hash + sub_type = $1 + {}.tap do |hash| + data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } + end + else + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(return_type) + klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data) + end + end + + # Sanitize filename by removing path. + # e.g. ../../sun.gif becomes sun.gif + # + # @param [String] filename the filename to be sanitized + # @return [String] the sanitized filename + def sanitize_filename(filename) + filename.gsub(/.*[\/\\]/, '') + end + + def build_request_url(path, opts = {}) + # Add leading and trailing slashes to path + path = "/#{path}".gsub(/\/+/, '/') + @config.base_url(opts[:operation]) + path + end + + # Update header and query params based on authentication settings. + # + # @param [Hash] header_params Header parameters + # @param [Hash] query_params Query parameters + # @param [String] auth_names Authentication scheme name + def update_params_for_auth!(header_params, query_params, auth_names) + Array(auth_names).each do |auth_name| + auth_setting = @config.auth_settings[auth_name] + next unless auth_setting + case auth_setting[:in] + when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] + when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] + else fail ArgumentError, 'Authentication token must be in `query` or `header`' + end + end + end + + # Sets user agent in HTTP header + # + # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) + def user_agent=(user_agent) + @user_agent = user_agent + @default_headers['User-Agent'] = @user_agent + end + + # Return Accept header based on an array of accepts provided. + # @param [Array] accepts array for Accept + # @return [String] the Accept header (e.g. application/json) + def select_header_accept(accepts) + return nil if accepts.nil? || accepts.empty? + # use JSON when present, otherwise use all of the provided + json_accept = accepts.find { |s| json_mime?(s) } + json_accept || accepts.join(',') + end + + # Return Content-Type header based on an array of content types provided. + # @param [Array] content_types array for Content-Type + # @return [String] the Content-Type header (e.g. application/json) + def select_header_content_type(content_types) + # return nil by default + return if content_types.nil? || content_types.empty? + # use JSON when present, otherwise use the first one + json_content_type = content_types.find { |s| json_mime?(s) } + json_content_type || content_types.first + end + + # Convert object (array, hash, object, etc) to JSON string. + # @param [Object] model object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_http_body(model) + return model if model.nil? || model.is_a?(String) + local_body = nil + if model.is_a?(Array) + local_body = model.map { |m| object_to_hash(m) } + else + local_body = object_to_hash(model) + end + local_body.to_json + end + + # Convert object(non-array) to hash. + # @param [Object] obj object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_hash(obj) + if obj.respond_to?(:to_hash) + obj.to_hash + else + obj + end + end + + # Build parameter value according to the given collection format. + # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi + def build_collection_param(param, collection_format) + case collection_format + when :csv + param.join(',') + when :ssv + param.join(' ') + when :tsv + param.join("\t") + when :pipes + param.join('|') + when :multi + # return the array directly as typhoeus will handle it as expected + param + else + fail "unknown collection format: #{collection_format.inspect}" + end + end + end +end diff --git a/lib/embed_workflow/api_error.rb b/lib/embed_workflow/api_error.rb new file mode 100644 index 0000000..c5b51d2 --- /dev/null +++ b/lib/embed_workflow/api_error.rb @@ -0,0 +1,58 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +module EmbedWorkflow + class ApiError < StandardError + attr_reader :code, :response_headers, :response_body + + # Usage examples: + # ApiError.new + # ApiError.new("message") + # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") + # ApiError.new(:code => 404, :message => "Not Found") + def initialize(arg = nil) + if arg.is_a? Hash + if arg.key?(:message) || arg.key?('message') + super(arg[:message] || arg['message']) + else + super arg + end + + arg.each do |k, v| + instance_variable_set "@#{k}", v + end + else + super arg + @message = arg + end + end + + # Override to_s to display a friendly error message + def to_s + message + end + + def message + if @message.nil? + msg = "Error message: the server returns an error" + else + msg = @message + end + + msg += "\nHTTP status code: #{code}" if code + msg += "\nResponse headers: #{response_headers}" if response_headers + msg += "\nResponse body: #{response_body}" if response_body + + msg + end + end +end diff --git a/lib/embed_workflow/app_connections.rb b/lib/embed_workflow/app_connections.rb deleted file mode 100644 index 04bf3c2..0000000 --- a/lib/embed_workflow/app_connections.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -require "net/http" -require "uri" - -module EmbedWorkflow - module AppConnections - class << self - include Base - include Client - - RESOURCE_BASE_PATH = "#{BASE_API_PATH}/app_connections".freeze - - def list(user_key: nil, starting_after: nil, ending_before: nil, limit: nil) - params = { - user_key: user_key, - starting_after: starting_after, - ending_before: ending_before, - limit: limit - }.compact - - get_request( - path: RESOURCE_BASE_PATH, - params: params - ) - end - - def fetch(id:, user_key: nil) - params = { user_key: user_key }.compact - - get_request( - path: "#{RESOURCE_BASE_PATH}/#{id}", - params: params - ) - end - - def create(name:, app_type:, config:, user_key: nil) - attrs = { - name: name, - app_type: app_type, - config: config, - user_key: user_key - }.compact - - post_request( - path: RESOURCE_BASE_PATH, - body: attrs - ) - end - - def update(id:, name: nil, app_type: nil, config: nil, user_key: nil) - attrs = { - name: name, - app_type: app_type, - config: config, - user_key: user_key - }.compact - - put_request( - path: "#{RESOURCE_BASE_PATH}/#{id}", - body: attrs - ) - end - - def delete(id:, user_key: nil) - params = { user_key: user_key }.compact - - delete_request( - path: "#{RESOURCE_BASE_PATH}/#{id}", - params: params - ) - end - end - end -end diff --git a/lib/embed_workflow/base.rb b/lib/embed_workflow/base.rb deleted file mode 100644 index e18d2ba..0000000 --- a/lib/embed_workflow/base.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -module EmbedWorkflow - module Base - UNSET = Object.new.freeze - - attr_accessor :skey - - class << self - attr_accessor :skey - end - - private - - def prepare_params(hash) - hash.reject { |_, v| v == UNSET } - end - end -end diff --git a/lib/embed_workflow/catch_hook.rb b/lib/embed_workflow/catch_hook.rb deleted file mode 100644 index fd154dc..0000000 --- a/lib/embed_workflow/catch_hook.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -require "net/http" -require "uri" - -module EmbedWorkflow - module CatchHook - class << self - include Base - include Client - - RESOURCE_BASE_PATH = "#{BASE_API_PATH}/hooks".freeze - - def create(hook_id:, user_key:, **rest) - attrs = { user_key: user_key }.merge(rest).compact - - post_request( - path: "#{RESOURCE_BASE_PATH}/#{hook_id}/catch", - body: attrs - ) - end - end - end -end diff --git a/lib/embed_workflow/client.rb b/lib/embed_workflow/client.rb deleted file mode 100644 index 7f0ed60..0000000 --- a/lib/embed_workflow/client.rb +++ /dev/null @@ -1,128 +0,0 @@ -# frozen_string_literal: true - -module EmbedWorkflow - module Client - include Kernel - BASE_API_PATH = "/api/v1".freeze - BASE_API_URL = "https://embedworkflow.com/".freeze - - def client - create_connection(URI.parse(BASE_API_URL)).tap do |client| - client.use_ssl = true - end - end - - def get_request(path:, auth: true, params: {}) - request = build_get_request(path: path, auth: auth, params: params) - execute_request(request) - end - - def post_request(path:, auth: true, body: nil) - request = build_post_request(path: path, auth: auth, body: body) - execute_request(request) - end - - def delete_request(path:, auth: true, params: {}) - request = build_delete_request(path: path, auth: auth, params: params) - execute_request(request) - end - - def put_request(path:, auth: true, body: nil) - request = build_put_request(path: path, auth: auth, body: body) - execute_request(request) - end - - private - - def execute_request(request) - response = client.request(request) - check_errors!(response) - - JSON.parse(response.body) if response.body && (response.body != "") - end - - def check_errors!(response) - case response.code.to_i - when 400 - raise InvalidRequestError.new( - http_status: 400, - request_id: response["x-request-id"] - ) - when 401 - raise AuthenticationError.new( - http_status: 401, - request_id: response["x-request-id"] - ) - when 404 - raise APIError.new( - http_status: 404, - request_id: response["x-request-id"] - ) - when 422 - raise InvalidRequestError.new( - http_status: 422, - request_id: response["x-request-id"] - ) - end - end - - def create_connection(uri) - Net::HTTP.new(uri.host, uri.port) - end - - def build_get_request(path:, auth: false, params: {}) - uri = URI(path) - uri.query = URI.encode_www_form(params) if params - - request = Net::HTTP::Get.new( - uri.to_s, - "Content-Type" => "application/json" - ) - - add_request_auth_headers(request) if auth - add_request_headers(request) - request - end - - def build_post_request(path:, auth: false, body: nil) - request = Net::HTTP::Post.new(path, "Content-Type" => "application/json") - request.body = body.to_json if body - - add_request_auth_headers(request) if auth - add_request_headers(request) - request - end - - def build_delete_request(path:, auth: false, params: {}) - uri = URI(path) - uri.query = URI.encode_www_form(params) if params - - request = Net::HTTP::Delete.new( - uri.to_s, - "Content-Type" => "application/json" - ) - - add_request_auth_headers(request) if auth - add_request_headers(request) - request - end - - def build_put_request(path:, auth: false, body: nil) - request = Net::HTTP::Put.new(path, "Content-Type" => "application/json") - request.body = body.to_json if body - add_request_auth_headers(request) if auth - add_request_headers(request) - request - end - - def add_request_auth_headers(request) - request["Authorization"] = "Bearer #{EmbedWorkflow.skey!}" - request - end - - def add_request_headers(request) - request["User-Agent"] = "Embed Workflow Ruby - v#{EmbedWorkflow::VERSION}" - request - end - end -end diff --git a/lib/embed_workflow/configuration.rb b/lib/embed_workflow/configuration.rb new file mode 100644 index 0000000..5cd68ca --- /dev/null +++ b/lib/embed_workflow/configuration.rb @@ -0,0 +1,389 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +module EmbedWorkflow + class Configuration + # Defines url scheme + attr_accessor :scheme + + # Defines url host + attr_accessor :host + + # Defines url base path + attr_accessor :base_path + + # Define server configuration index + attr_accessor :server_index + + # Define server operation configuration index + attr_accessor :server_operation_index + + # Default server variables + attr_accessor :server_variables + + # Default server operation variables + attr_accessor :server_operation_variables + + # Defines API keys used with API Key authentications. + # + # @return [Hash] key: parameter name, value: parameter value (API key) + # + # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) + # config.api_key['api_key'] = 'xxx' + attr_accessor :api_key + + # Defines API key prefixes used with API Key authentications. + # + # @return [Hash] key: parameter name, value: API key prefix + # + # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) + # config.api_key_prefix['api_key'] = 'Token' + attr_accessor :api_key_prefix + + # Defines the username used with HTTP basic authentication. + # + # @return [String] + attr_accessor :username + + # Defines the password used with HTTP basic authentication. + # + # @return [String] + attr_accessor :password + + # Defines the access token (Bearer) used with OAuth2. + attr_accessor :access_token + + # Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2. + # Overrides the access_token if set + # @return [Proc] + attr_accessor :access_token_getter + + # Set this to return data as binary instead of downloading a temp file. When enabled (set to true) + # HTTP responses with return type `File` will be returned as a stream of binary data. + # Default to false. + attr_accessor :return_binary_data + + # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response + # details will be logged with `logger.debug` (see the `logger` attribute). + # Default to false. + # + # @return [true, false] + attr_accessor :debugging + + # Defines the logger used for debugging. + # Default to `Rails.logger` (when in Rails) or logging to STDOUT. + # + # @return [#debug] + attr_accessor :logger + + # Defines the temporary folder to store downloaded files + # (for API endpoints that have file response). + # Default to use `Tempfile`. + # + # @return [String] + attr_accessor :temp_folder_path + + # The time limit for HTTP request in seconds. + # Default to 0 (never times out). + attr_accessor :timeout + + # Set this to false to skip client side validation in the operation. + # Default to true. + # @return [true, false] + attr_accessor :client_side_validation + + ### TLS/SSL setting + # Set this to false to skip verifying SSL certificate when calling API from https server. + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :ssl_verify + + ### TLS/SSL setting + # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + attr_accessor :ssl_verify_mode + + ### TLS/SSL setting + # Set this to customize the certificate file to verify the peer. + # + # @return [String] the path to the certificate file + attr_accessor :ssl_ca_file + + ### TLS/SSL setting + # Client certificate file (for client certificate) + attr_accessor :ssl_client_cert + + ### TLS/SSL setting + # Client private key file (for client certificate) + attr_accessor :ssl_client_key + + ### Proxy setting + # HTTP Proxy settings + attr_accessor :proxy + + # Set this to customize parameters encoder of array parameter. + # Default to nil. Faraday uses NestedParamsEncoder when nil. + # + # @see The params_encoder option of Faraday. Related source code: + # https://github.com/lostisland/faraday/tree/main/lib/faraday/encoders + attr_accessor :params_encoder + + + attr_accessor :inject_format + + attr_accessor :force_ending_format + + def initialize + @scheme = 'https' + @host = 'embedworkflow.com' + @base_path = '' + @server_index = nil + @server_operation_index = {} + @server_variables = {} + @server_operation_variables = {} + @api_key = {} + @api_key_prefix = {} + @client_side_validation = true + @ssl_verify = true + @ssl_verify_mode = nil + @ssl_ca_file = nil + @ssl_client_cert = nil + @ssl_client_key = nil + @middlewares = Hash.new { |h, k| h[k] = [] } + @configure_connection_blocks = [] + @timeout = 60 + # return data as binary instead of file + @return_binary_data = false + @params_encoder = nil + @debugging = false + @inject_format = false + @force_ending_format = false + @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) + + yield(self) if block_given? + end + + # The default Configuration object. + def self.default + @@default ||= Configuration.new + end + + def configure + yield(self) if block_given? + end + + def scheme=(scheme) + # remove :// from scheme + @scheme = scheme.sub(/:\/\//, '') + end + + def host=(host) + # remove http(s):// and anything after a slash + @host = host.sub(/https?:\/\//, '').split('/').first + end + + def base_path=(base_path) + # Add leading and trailing slashes to base_path + @base_path = "/#{base_path}".gsub(/\/+/, '/') + @base_path = '' if @base_path == '/' + end + + # Returns base URL for specified operation based on server settings + def base_url(operation = nil) + if operation_server_settings.key?(operation) then + index = server_operation_index.fetch(operation, server_index) + server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) + else + server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil) + end + end + + # Gets API key (with prefix if set). + # @param [String] param_name the parameter name of API key auth + def api_key_with_prefix(param_name, param_alias = nil) + key = @api_key[param_name] + key = @api_key.fetch(param_alias, key) unless param_alias.nil? + if @api_key_prefix[param_name] + "#{@api_key_prefix[param_name]} #{key}" + else + key + end + end + + # Gets access_token using access_token_getter or uses the static access_token + def access_token_with_refresh + return access_token if access_token_getter.nil? + access_token_getter.call + end + + # Gets Basic Auth token string + def basic_auth_token + 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") + end + + # Returns Auth Settings hash for api client. + def auth_settings + { + 'bearer' => + { + type: 'bearer', + in: 'header', + format: 'JWT', + key: 'Authorization', + value: "Bearer #{access_token_with_refresh}" + }, + } + end + + # Returns an array of Server setting + def server_settings + [ + { + url: "https://{defaultHost}", + description: "No description provided", + variables: { + defaultHost: { + description: "No description provided", + default_value: "www.embedworkflow.com", + } + } + } + ] + end + + def operation_server_settings + { + } + end + + # Returns URL based on server settings + # + # @param index array index of the server settings + # @param variables hash of variable and the corresponding value + def server_url(index, variables = {}, servers = nil) + servers = server_settings if servers == nil + + # check array index out of bound + if (index.nil? || index < 0 || index >= servers.size) + fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}" + end + + server = servers[index] + url = server[:url] + + return url unless server.key? :variables + + # go through variable and assign a value + server[:variables].each do |name, variable| + if variables.key?(name) + if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name])) + url.gsub! "{" + name.to_s + "}", variables[name] + else + fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." + end + else + # use default value + url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] + end + end + + url + end + + # Configure Faraday connection directly. + # + # ``` + # c.configure_faraday_connection do |conn| + # conn.use Faraday::HttpCache, shared_cache: false, logger: logger + # conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger| + # logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]') + # end + # end + # + # c.configure_faraday_connection do |conn| + # conn.adapter :typhoeus + # end + # ``` + # + # @param block [Proc] `#call`able object that takes one arg, the connection + def configure_faraday_connection(&block) + @configure_connection_blocks << block + end + + def configure_connection(conn) + @configure_connection_blocks.each do |block| + block.call(conn) + end + end + + # Adds middleware to the stack + def use(*middleware) + set_faraday_middleware(:use, *middleware) + end + + # Adds request middleware to the stack + def request(*middleware) + set_faraday_middleware(:request, *middleware) + end + + # Adds response middleware to the stack + def response(*middleware) + set_faraday_middleware(:response, *middleware) + end + + # Adds Faraday middleware setting information to the stack + # + # @example Use the `set_faraday_middleware` method to set middleware information + # config.set_faraday_middleware(:request, :retry, max: 3, methods: [:get, :post], retry_statuses: [503]) + # config.set_faraday_middleware(:response, :logger, nil, { bodies: true, log_level: :debug }) + # config.set_faraday_middleware(:use, Faraday::HttpCache, store: Rails.cache, shared_cache: false) + # config.set_faraday_middleware(:insert, 0, FaradayMiddleware::FollowRedirects, { standards_compliant: true, limit: 1 }) + # config.set_faraday_middleware(:swap, 0, Faraday::Response::Logger) + # config.set_faraday_middleware(:delete, Faraday::Multipart::Middleware) + # + # @see https://github.com/lostisland/faraday/blob/v2.3.0/lib/faraday/rack_builder.rb#L92-L143 + def set_faraday_middleware(operation, key, *args, &block) + unless [:request, :response, :use, :insert, :insert_before, :insert_after, :swap, :delete].include?(operation) + fail ArgumentError, "Invalid faraday middleware operation #{operation}. Must be" \ + " :request, :response, :use, :insert, :insert_before, :insert_after, :swap or :delete." + end + + @middlewares[operation] << [key, args, block] + end + ruby2_keywords(:set_faraday_middleware) if respond_to?(:ruby2_keywords, true) + + # Set up middleware on the connection + def configure_middleware(connection) + return if @middlewares.empty? + + [:request, :response, :use, :insert, :insert_before, :insert_after, :swap].each do |operation| + next unless @middlewares.key?(operation) + + @middlewares[operation].each do |key, args, block| + connection.builder.send(operation, key, *args, &block) + end + end + + if @middlewares.key?(:delete) + @middlewares[:delete].each do |key, _args, _block| + connection.builder.delete(key) + end + end + end + + end +end diff --git a/lib/embed_workflow/errors.rb b/lib/embed_workflow/errors.rb deleted file mode 100644 index 4cdd8ea..0000000 --- a/lib/embed_workflow/errors.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module EmbedWorkflow - class BaseError < StandardError - attr_reader :http_status, :request_id - - def initialize(http_status: nil, request_id: nil) - super - @http_status = http_status - @request_id = request_id - end - end - - class APIError < BaseError; end - class AuthenticationError < BaseError; end - class InvalidRequestError < BaseError; end -end diff --git a/lib/embed_workflow/executions.rb b/lib/embed_workflow/executions.rb deleted file mode 100644 index 9fead6d..0000000 --- a/lib/embed_workflow/executions.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -require "net/http" -require "uri" - -module EmbedWorkflow - module Executions - class << self - include Base - include Client - - RESOURCE_BASE_PATH = "#{BASE_API_PATH}/executions".freeze - - def stop(stop_event:, user_key: nil, filters: nil) - attrs = { - stop_event: stop_event, - user_key: user_key, - filters: filters - } - - post_request( - path: "#{RESOURCE_BASE_PATH}/stop", - body: attrs - ) - end - end - end -end diff --git a/lib/embed_workflow/models/catch_hook_request.rb b/lib/embed_workflow/models/catch_hook_request.rb new file mode 100644 index 0000000..c013df6 --- /dev/null +++ b/lib/embed_workflow/models/catch_hook_request.rb @@ -0,0 +1,222 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class CatchHookRequest + # User's key + attr_accessor :user_key + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_key' => :'user_key' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_key' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CatchHookRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CatchHookRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_key') + self.user_key = attributes[:'user_key'] + else + self.user_key = 'main' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_key.nil? + invalid_properties.push('invalid value for "user_key", user_key cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_key.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_key == o.user_key + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_key].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/create_action_type422_response.rb b/lib/embed_workflow/models/create_action_type422_response.rb new file mode 100644 index 0000000..beb89f1 --- /dev/null +++ b/lib/embed_workflow/models/create_action_type422_response.rb @@ -0,0 +1,256 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class CreateActionType422Response + # Type of error + attr_accessor :type + + # Specific error code + attr_accessor :code + + # Human-readable message providing more details about the error + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'code' => :'code', + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'code' => :'String', + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CreateActionType422Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CreateActionType422Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + else + self.code = nil + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + else + self.message = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @code.nil? + invalid_properties.push('invalid value for "code", code cannot be nil.') + end + + if @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @type.nil? + return false if @code.nil? + return false if @message.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + code == o.code && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, code, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/create_action_type_request.rb b/lib/embed_workflow/models/create_action_type_request.rb new file mode 100644 index 0000000..f16417a --- /dev/null +++ b/lib/embed_workflow/models/create_action_type_request.rb @@ -0,0 +1,388 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class CreateActionTypeRequest + # Name of resource + attr_accessor :name + + # Description of action type + attr_accessor :description + + # Type of action + attr_accessor :type + + # Enable or disable the resource. + attr_accessor :on + + # HTTP parameters as key:value pairs, one per line + attr_accessor :params_draft + + # HTTP headers as key:value pairs, one per line + attr_accessor :headers_draft + + # HTTP url + attr_accessor :url_draft + + # HTTP method + attr_accessor :http_method_draft + + # JavaScript code snippt + attr_accessor :code_draft + + # Whether or not you want to publish on create + attr_accessor :publish + + # Form field configuration + attr_accessor :form_draft + + # Data schema configuration + attr_accessor :response_data_schema_draft + + # User permission groups. Only available to users with admin role. + attr_accessor :groups + + attr_accessor :icon_draft + + # Primary category for the action type + attr_accessor :primary_category + + # Secondary category for the action type + attr_accessor :secondary_category + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'description' => :'description', + :'type' => :'type', + :'on' => :'on', + :'params_draft' => :'params_draft', + :'headers_draft' => :'headers_draft', + :'url_draft' => :'url_draft', + :'http_method_draft' => :'http_method_draft', + :'code_draft' => :'code_draft', + :'publish' => :'publish', + :'form_draft' => :'form_draft', + :'response_data_schema_draft' => :'response_data_schema_draft', + :'groups' => :'groups', + :'icon_draft' => :'icon_draft', + :'primary_category' => :'primary_category', + :'secondary_category' => :'secondary_category' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'description' => :'String', + :'type' => :'String', + :'on' => :'Boolean', + :'params_draft' => :'String', + :'headers_draft' => :'String', + :'url_draft' => :'String', + :'http_method_draft' => :'String', + :'code_draft' => :'String', + :'publish' => :'Boolean', + :'form_draft' => :'Array', + :'response_data_schema_draft' => :'Array', + :'groups' => :'Array', + :'icon_draft' => :'CreateActionTypeRequestIconDraft', + :'primary_category' => :'String', + :'secondary_category' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CreateActionTypeRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CreateActionTypeRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'on') + self.on = attributes[:'on'] + else + self.on = true + end + + if attributes.key?(:'params_draft') + self.params_draft = attributes[:'params_draft'] + end + + if attributes.key?(:'headers_draft') + self.headers_draft = attributes[:'headers_draft'] + end + + if attributes.key?(:'url_draft') + self.url_draft = attributes[:'url_draft'] + end + + if attributes.key?(:'http_method_draft') + self.http_method_draft = attributes[:'http_method_draft'] + end + + if attributes.key?(:'code_draft') + self.code_draft = attributes[:'code_draft'] + end + + if attributes.key?(:'publish') + self.publish = attributes[:'publish'] + else + self.publish = false + end + + if attributes.key?(:'form_draft') + if (value = attributes[:'form_draft']).is_a?(Array) + self.form_draft = value + end + end + + if attributes.key?(:'response_data_schema_draft') + if (value = attributes[:'response_data_schema_draft']).is_a?(Array) + self.response_data_schema_draft = value + end + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'icon_draft') + self.icon_draft = attributes[:'icon_draft'] + end + + if attributes.key?(:'primary_category') + self.primary_category = attributes[:'primary_category'] + end + + if attributes.key?(:'secondary_category') + self.secondary_category = attributes[:'secondary_category'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name.nil? + return false if @type.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + description == o.description && + type == o.type && + on == o.on && + params_draft == o.params_draft && + headers_draft == o.headers_draft && + url_draft == o.url_draft && + http_method_draft == o.http_method_draft && + code_draft == o.code_draft && + publish == o.publish && + form_draft == o.form_draft && + response_data_schema_draft == o.response_data_schema_draft && + groups == o.groups && + icon_draft == o.icon_draft && + primary_category == o.primary_category && + secondary_category == o.secondary_category + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, description, type, on, params_draft, headers_draft, url_draft, http_method_draft, code_draft, publish, form_draft, response_data_schema_draft, groups, icon_draft, primary_category, secondary_category].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/create_action_type_request_form_draft_inner.rb b/lib/embed_workflow/models/create_action_type_request_form_draft_inner.rb new file mode 100644 index 0000000..a5ccca9 --- /dev/null +++ b/lib/embed_workflow/models/create_action_type_request_form_draft_inner.rb @@ -0,0 +1,342 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class CreateActionTypeRequestFormDraftInner + # Unique identifier for the form field + attr_accessor :id + + # Field name for form submission + attr_accessor :name + + # Whether this field is required + attr_accessor :required + + # Whether this field is for advanced configuration + attr_accessor :advanced + + # Display label for the form field + attr_accessor :label + + # Help text or description for the field + attr_accessor :description + + # Form field type + attr_accessor :type + + # Additional field configuration (options, validation, etc.) + attr_accessor :data + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'required' => :'required', + :'advanced' => :'advanced', + :'label' => :'label', + :'description' => :'description', + :'type' => :'type', + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'required' => :'Boolean', + :'advanced' => :'Boolean', + :'label' => :'String', + :'description' => :'String', + :'type' => :'String', + :'data' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CreateActionTypeRequestFormDraftInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CreateActionTypeRequestFormDraftInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'required') + self.required = attributes[:'required'] + end + + if attributes.key?(:'advanced') + self.advanced = attributes[:'advanced'] + end + + if attributes.key?(:'label') + self.label = attributes[:'label'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Hash) + self.data = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @name.nil? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('String', ["text", "email", "password", "textarea", "select", "checkbox", "radio", "number", "date", "file"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["text", "email", "password", "textarea", "select", "checkbox", "radio", "number", "date", "file"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + required == o.required && + advanced == o.advanced && + label == o.label && + description == o.description && + type == o.type && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name, required, advanced, label, description, type, data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/create_action_type_request_icon_draft.rb b/lib/embed_workflow/models/create_action_type_request_icon_draft.rb new file mode 100644 index 0000000..55f2899 --- /dev/null +++ b/lib/embed_workflow/models/create_action_type_request_icon_draft.rb @@ -0,0 +1,245 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + # Icon configuration + class CreateActionTypeRequestIconDraft + # Icon type identifier + attr_accessor :type + + # Background color for the icon + attr_accessor :background_color + + # Custom icon URL (optional) + attr_accessor :url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'background_color' => :'background_color', + :'url' => :'url' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'background_color' => :'String', + :'url' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CreateActionTypeRequestIconDraft` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CreateActionTypeRequestIconDraft`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'background_color') + self.background_color = attributes[:'background_color'] + else + self.background_color = 'gray:500' + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @type.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + background_color == o.background_color && + url == o.url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, background_color, url].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/create_app_connection_request.rb b/lib/embed_workflow/models/create_app_connection_request.rb new file mode 100644 index 0000000..e3982c0 --- /dev/null +++ b/lib/embed_workflow/models/create_app_connection_request.rb @@ -0,0 +1,273 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class CreateAppConnectionRequest + # Name of resource + attr_accessor :name + + # App Type + attr_accessor :app_type + + # User's key + attr_accessor :user_key + + # App connection configuration + attr_accessor :config + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'app_type' => :'app_type', + :'user_key' => :'user_key', + :'config' => :'config' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'app_type' => :'String', + :'user_key' => :'String', + :'config' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CreateAppConnectionRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CreateAppConnectionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'app_type') + self.app_type = attributes[:'app_type'] + else + self.app_type = nil + end + + if attributes.key?(:'user_key') + self.user_key = attributes[:'user_key'] + else + self.user_key = 'main' + end + + if attributes.key?(:'config') + self.config = attributes[:'config'] + else + self.config = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @app_type.nil? + invalid_properties.push('invalid value for "app_type", app_type cannot be nil.') + end + + if @user_key.nil? + invalid_properties.push('invalid value for "user_key", user_key cannot be nil.') + end + + if @config.nil? + invalid_properties.push('invalid value for "config", config cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name.nil? + return false if @app_type.nil? + return false if @user_key.nil? + return false if @config.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + app_type == o.app_type && + user_key == o.user_key && + config == o.config + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, app_type, user_key, config].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/create_user_token200_response.rb b/lib/embed_workflow/models/create_user_token200_response.rb new file mode 100644 index 0000000..e4f8770 --- /dev/null +++ b/lib/embed_workflow/models/create_user_token200_response.rb @@ -0,0 +1,222 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class CreateUserToken200Response + # Authentication token for the user + attr_accessor :user_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_token' => :'user_token' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_token' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CreateUserToken200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CreateUserToken200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_token') + self.user_token = attributes[:'user_token'] + else + self.user_token = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_token.nil? + invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_token.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_token == o.user_token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_token].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/create_user_token_request.rb b/lib/embed_workflow/models/create_user_token_request.rb new file mode 100644 index 0000000..16ff78b --- /dev/null +++ b/lib/embed_workflow/models/create_user_token_request.rb @@ -0,0 +1,227 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class CreateUserTokenRequest + # User's key + attr_accessor :key + + # System-generated unique identifier + attr_accessor :id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'key' => :'key', + :'id' => :'id' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'key' => :'String', + :'id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CreateUserTokenRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CreateUserTokenRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'key') + self.key = attributes[:'key'] + else + self.key = 'main' + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key == o.key && + id == o.id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [key, id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/create_workflow201_response.rb b/lib/embed_workflow/models/create_workflow201_response.rb new file mode 100644 index 0000000..380ff1b --- /dev/null +++ b/lib/embed_workflow/models/create_workflow201_response.rb @@ -0,0 +1,660 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class CreateWorkflow201Response + # Unique identifier + attr_accessor :id + + # ID of the account template this workflow was cloned from + attr_accessor :account_template_id + + # Action type IDs used in this workflow's template + attr_accessor :action_type_ids + + # Number of actions in the workflow + attr_accessor :actions_count + + # Auto-clone this template for new users (Admin only) + attr_accessor :auto_clone_for_new_users + + # Created at in specified timezone + attr_accessor :created_at + + # Created at formatted as human-readable string + attr_accessor :created_at_string + + # Created at in UTC + attr_accessor :created_at_utc + + # Description of the workflow + attr_accessor :description + + # Event trigger configuration + attr_accessor :event_trigger + + # Draft event trigger configuration + attr_accessor :event_trigger_draft + + # Number of times workflow has been executed + attr_accessor :executions_count + + # Permission groups (Admin only) + attr_accessor :groups + + # Whether the workflow has unsaved draft changes + attr_accessor :has_draft + + # Whether this workflow is managed by the account and read-only + attr_accessor :is_managed + + # Mark as template visible in library (Admin only) + attr_accessor :is_template + + # Unique key for the workflow + attr_accessor :key + + # Last executed at in specified timezone + attr_accessor :last_executed_at + + # Last executed at formatted as human-readable string + attr_accessor :last_executed_at_string + + # Last executed at in UTC + attr_accessor :last_executed_at_utc + + # Last published at in specified timezone + attr_accessor :last_published_at + + # Last published at formatted as human-readable string + attr_accessor :last_published_at_string + + # Last published at in UTC + attr_accessor :last_published_at_utc + + # Who manages this workflow (Admin only) + attr_accessor :managed_by + + # Conditions for matching workflow execution + attr_accessor :match_conditions + + # Draft conditions for matching workflow execution + attr_accessor :match_conditions_draft + + # Name of the workflow + attr_accessor :name + + # Object type identifier + attr_accessor :object + + # Whether the workflow is enabled + attr_accessor :on + + # Workflow execution statistics + attr_accessor :stats + + # Current status of the workflow + attr_accessor :status + + # Published workflow template layout + attr_accessor :template + + # Draft workflow template layout + attr_accessor :template_draft + + # Conditions for triggering the workflow + attr_accessor :trigger_conditions + + # Draft conditions for triggering the workflow + attr_accessor :trigger_conditions_draft + + # Updated at in specified timezone + attr_accessor :updated_at + + # Updated at formatted as human-readable string + attr_accessor :updated_at_string + + # Updated at in UTC + attr_accessor :updated_at_utc + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'account_template_id' => :'account_template_id', + :'action_type_ids' => :'action_type_ids', + :'actions_count' => :'actions_count', + :'auto_clone_for_new_users' => :'auto_clone_for_new_users', + :'created_at' => :'created_at', + :'created_at_string' => :'created_at_string', + :'created_at_utc' => :'created_at_utc', + :'description' => :'description', + :'event_trigger' => :'event_trigger', + :'event_trigger_draft' => :'event_trigger_draft', + :'executions_count' => :'executions_count', + :'groups' => :'groups', + :'has_draft' => :'has_draft', + :'is_managed' => :'is_managed', + :'is_template' => :'is_template', + :'key' => :'key', + :'last_executed_at' => :'last_executed_at', + :'last_executed_at_string' => :'last_executed_at_string', + :'last_executed_at_utc' => :'last_executed_at_utc', + :'last_published_at' => :'last_published_at', + :'last_published_at_string' => :'last_published_at_string', + :'last_published_at_utc' => :'last_published_at_utc', + :'managed_by' => :'managed_by', + :'match_conditions' => :'match_conditions', + :'match_conditions_draft' => :'match_conditions_draft', + :'name' => :'name', + :'object' => :'object', + :'on' => :'on', + :'stats' => :'stats', + :'status' => :'status', + :'template' => :'template', + :'template_draft' => :'template_draft', + :'trigger_conditions' => :'trigger_conditions', + :'trigger_conditions_draft' => :'trigger_conditions_draft', + :'updated_at' => :'updated_at', + :'updated_at_string' => :'updated_at_string', + :'updated_at_utc' => :'updated_at_utc' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'account_template_id' => :'String', + :'action_type_ids' => :'Array', + :'actions_count' => :'Integer', + :'auto_clone_for_new_users' => :'Boolean', + :'created_at' => :'String', + :'created_at_string' => :'String', + :'created_at_utc' => :'String', + :'description' => :'String', + :'event_trigger' => :'Object', + :'event_trigger_draft' => :'Object', + :'executions_count' => :'Integer', + :'groups' => :'Array', + :'has_draft' => :'Boolean', + :'is_managed' => :'Boolean', + :'is_template' => :'Boolean', + :'key' => :'String', + :'last_executed_at' => :'String', + :'last_executed_at_string' => :'String', + :'last_executed_at_utc' => :'String', + :'last_published_at' => :'String', + :'last_published_at_string' => :'String', + :'last_published_at_utc' => :'String', + :'managed_by' => :'String', + :'match_conditions' => :'Object', + :'match_conditions_draft' => :'Object', + :'name' => :'String', + :'object' => :'String', + :'on' => :'Boolean', + :'stats' => :'Hash', + :'status' => :'String', + :'template' => :'Object', + :'template_draft' => :'Object', + :'trigger_conditions' => :'Hash', + :'trigger_conditions_draft' => :'Hash', + :'updated_at' => :'String', + :'updated_at_string' => :'String', + :'updated_at_utc' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'account_template_id', + :'created_at', + :'created_at_string', + :'created_at_utc', + :'description', + :'event_trigger', + :'event_trigger_draft', + :'last_executed_at', + :'last_executed_at_string', + :'last_executed_at_utc', + :'last_published_at', + :'last_published_at_string', + :'last_published_at_utc', + :'managed_by', + :'match_conditions', + :'match_conditions_draft', + :'updated_at', + :'updated_at_string', + :'updated_at_utc' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CreateWorkflow201Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CreateWorkflow201Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'account_template_id') + self.account_template_id = attributes[:'account_template_id'] + end + + if attributes.key?(:'action_type_ids') + if (value = attributes[:'action_type_ids']).is_a?(Array) + self.action_type_ids = value + end + end + + if attributes.key?(:'actions_count') + self.actions_count = attributes[:'actions_count'] + end + + if attributes.key?(:'auto_clone_for_new_users') + self.auto_clone_for_new_users = attributes[:'auto_clone_for_new_users'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_at_string') + self.created_at_string = attributes[:'created_at_string'] + end + + if attributes.key?(:'created_at_utc') + self.created_at_utc = attributes[:'created_at_utc'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'event_trigger') + self.event_trigger = attributes[:'event_trigger'] + end + + if attributes.key?(:'event_trigger_draft') + self.event_trigger_draft = attributes[:'event_trigger_draft'] + end + + if attributes.key?(:'executions_count') + self.executions_count = attributes[:'executions_count'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'has_draft') + self.has_draft = attributes[:'has_draft'] + end + + if attributes.key?(:'is_managed') + self.is_managed = attributes[:'is_managed'] + end + + if attributes.key?(:'is_template') + self.is_template = attributes[:'is_template'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'last_executed_at') + self.last_executed_at = attributes[:'last_executed_at'] + end + + if attributes.key?(:'last_executed_at_string') + self.last_executed_at_string = attributes[:'last_executed_at_string'] + end + + if attributes.key?(:'last_executed_at_utc') + self.last_executed_at_utc = attributes[:'last_executed_at_utc'] + end + + if attributes.key?(:'last_published_at') + self.last_published_at = attributes[:'last_published_at'] + end + + if attributes.key?(:'last_published_at_string') + self.last_published_at_string = attributes[:'last_published_at_string'] + end + + if attributes.key?(:'last_published_at_utc') + self.last_published_at_utc = attributes[:'last_published_at_utc'] + end + + if attributes.key?(:'managed_by') + self.managed_by = attributes[:'managed_by'] + end + + if attributes.key?(:'match_conditions') + self.match_conditions = attributes[:'match_conditions'] + end + + if attributes.key?(:'match_conditions_draft') + self.match_conditions_draft = attributes[:'match_conditions_draft'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'on') + self.on = attributes[:'on'] + end + + if attributes.key?(:'stats') + if (value = attributes[:'stats']).is_a?(Hash) + self.stats = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'template') + self.template = attributes[:'template'] + end + + if attributes.key?(:'template_draft') + self.template_draft = attributes[:'template_draft'] + end + + if attributes.key?(:'trigger_conditions') + if (value = attributes[:'trigger_conditions']).is_a?(Hash) + self.trigger_conditions = value + end + end + + if attributes.key?(:'trigger_conditions_draft') + if (value = attributes[:'trigger_conditions_draft']).is_a?(Hash) + self.trigger_conditions_draft = value + end + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'updated_at_string') + self.updated_at_string = attributes[:'updated_at_string'] + end + + if attributes.key?(:'updated_at_utc') + self.updated_at_utc = attributes[:'updated_at_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + managed_by_validator = EnumAttributeValidator.new('String', ["tenant", "account"]) + return false unless managed_by_validator.valid?(@managed_by) + status_validator = EnumAttributeValidator.new('String', ["on", "off"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] managed_by Object to be assigned + def managed_by=(managed_by) + validator = EnumAttributeValidator.new('String', ["tenant", "account"]) + unless validator.valid?(managed_by) + fail ArgumentError, "invalid value for \"managed_by\", must be one of #{validator.allowable_values}." + end + @managed_by = managed_by + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["on", "off"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + account_template_id == o.account_template_id && + action_type_ids == o.action_type_ids && + actions_count == o.actions_count && + auto_clone_for_new_users == o.auto_clone_for_new_users && + created_at == o.created_at && + created_at_string == o.created_at_string && + created_at_utc == o.created_at_utc && + description == o.description && + event_trigger == o.event_trigger && + event_trigger_draft == o.event_trigger_draft && + executions_count == o.executions_count && + groups == o.groups && + has_draft == o.has_draft && + is_managed == o.is_managed && + is_template == o.is_template && + key == o.key && + last_executed_at == o.last_executed_at && + last_executed_at_string == o.last_executed_at_string && + last_executed_at_utc == o.last_executed_at_utc && + last_published_at == o.last_published_at && + last_published_at_string == o.last_published_at_string && + last_published_at_utc == o.last_published_at_utc && + managed_by == o.managed_by && + match_conditions == o.match_conditions && + match_conditions_draft == o.match_conditions_draft && + name == o.name && + object == o.object && + on == o.on && + stats == o.stats && + status == o.status && + template == o.template && + template_draft == o.template_draft && + trigger_conditions == o.trigger_conditions && + trigger_conditions_draft == o.trigger_conditions_draft && + updated_at == o.updated_at && + updated_at_string == o.updated_at_string && + updated_at_utc == o.updated_at_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, account_template_id, action_type_ids, actions_count, auto_clone_for_new_users, created_at, created_at_string, created_at_utc, description, event_trigger, event_trigger_draft, executions_count, groups, has_draft, is_managed, is_template, key, last_executed_at, last_executed_at_string, last_executed_at_utc, last_published_at, last_published_at_string, last_published_at_utc, managed_by, match_conditions, match_conditions_draft, name, object, on, stats, status, template, template_draft, trigger_conditions, trigger_conditions_draft, updated_at, updated_at_string, updated_at_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/create_workflow_request.rb b/lib/embed_workflow/models/create_workflow_request.rb new file mode 100644 index 0000000..973260a --- /dev/null +++ b/lib/embed_workflow/models/create_workflow_request.rb @@ -0,0 +1,295 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class CreateWorkflowRequest + # Name of resource + attr_accessor :name + + # User's key + attr_accessor :user_key + + # Description of the resource + attr_accessor :details + + attr_accessor :template_draft + + # The trigger's conditions + attr_accessor :trigger_conditions_draft + + # The trigger's key + attr_accessor :event_trigger_draft + + # Whether all or any of the trigger conditions must match + attr_accessor :match_conditions_draft + + # User permission groups. Only available to users with admin role. + attr_accessor :groups + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'user_key' => :'user_key', + :'details' => :'details', + :'template_draft' => :'template_draft', + :'trigger_conditions_draft' => :'trigger_conditions_draft', + :'event_trigger_draft' => :'event_trigger_draft', + :'match_conditions_draft' => :'match_conditions_draft', + :'groups' => :'groups' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'user_key' => :'String', + :'details' => :'String', + :'template_draft' => :'CreateWorkflowRequestTemplateDraft', + :'trigger_conditions_draft' => :'Object', + :'event_trigger_draft' => :'String', + :'match_conditions_draft' => :'String', + :'groups' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CreateWorkflowRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CreateWorkflowRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'user_key') + self.user_key = attributes[:'user_key'] + else + self.user_key = 'main' + end + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'template_draft') + self.template_draft = attributes[:'template_draft'] + end + + if attributes.key?(:'trigger_conditions_draft') + self.trigger_conditions_draft = attributes[:'trigger_conditions_draft'] + end + + if attributes.key?(:'event_trigger_draft') + self.event_trigger_draft = attributes[:'event_trigger_draft'] + end + + if attributes.key?(:'match_conditions_draft') + self.match_conditions_draft = attributes[:'match_conditions_draft'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + user_key == o.user_key && + details == o.details && + template_draft == o.template_draft && + trigger_conditions_draft == o.trigger_conditions_draft && + event_trigger_draft == o.event_trigger_draft && + match_conditions_draft == o.match_conditions_draft && + groups == o.groups + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, user_key, details, template_draft, trigger_conditions_draft, event_trigger_draft, match_conditions_draft, groups].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/create_workflow_request_template_draft.rb b/lib/embed_workflow/models/create_workflow_request_template_draft.rb new file mode 100644 index 0000000..380150c --- /dev/null +++ b/lib/embed_workflow/models/create_workflow_request_template_draft.rb @@ -0,0 +1,244 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + # The draft template of the workflow + class CreateWorkflowRequestTemplateDraft + # Array of workflow nodes + attr_accessor :nodes + + # Array of connections between nodes in format 'sourceId-targetId' + attr_accessor :edges + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nodes' => :'nodes', + :'edges' => :'edges' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'nodes' => :'Array', + :'edges' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CreateWorkflowRequestTemplateDraft` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CreateWorkflowRequestTemplateDraft`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'nodes') + if (value = attributes[:'nodes']).is_a?(Array) + self.nodes = value + end + else + self.nodes = nil + end + + if attributes.key?(:'edges') + if (value = attributes[:'edges']).is_a?(Array) + self.edges = value + end + else + self.edges = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @nodes.nil? + invalid_properties.push('invalid value for "nodes", nodes cannot be nil.') + end + + if @edges.nil? + invalid_properties.push('invalid value for "edges", edges cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @nodes.nil? + return false if @edges.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nodes == o.nodes && + edges == o.edges + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [nodes, edges].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/create_workflow_request_template_draft_nodes_inner.rb b/lib/embed_workflow/models/create_workflow_request_template_draft_nodes_inner.rb new file mode 100644 index 0000000..6c22101 --- /dev/null +++ b/lib/embed_workflow/models/create_workflow_request_template_draft_nodes_inner.rb @@ -0,0 +1,431 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class CreateWorkflowRequestTemplateDraftNodesInner + # Unique identifier for the node + attr_accessor :id + + # Type of the node + attr_accessor :type + + # Identifier for the action type + attr_accessor :action_type_id + + # Display name of the node + attr_accessor :name + + # Whether condition result is required + attr_accessor :required_condition_result + + # App connection identifier + attr_accessor :app_connection_id + + # Additional action data (for Custom nodes) + attr_accessor :action_data + + # Data response schema prefix (for Custom nodes) + attr_accessor :prefix + + # Delay amount (for Delay/Trigger nodes) + attr_accessor :delay_n + + # Delay unit (for Delay/Trigger nodes) + attr_accessor :delay_unit + + # Minute of day (for Delay/WaitUntil nodes) + attr_accessor :minute_of_day + + # End minute of day (for WaitUntil nodes) + attr_accessor :minute_of_day_end + + # Days of week (for WaitUntil nodes) + attr_accessor :days_of_week + + # Event trigger identifier (for Trigger nodes) + attr_accessor :event_trigger + + # Array of conditions (for Trigger/Condition nodes) + attr_accessor :conditions + + # How to match conditions (for Trigger/Condition nodes) + attr_accessor :match_conditions + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type', + :'action_type_id' => :'action_type_id', + :'name' => :'name', + :'required_condition_result' => :'required_condition_result', + :'app_connection_id' => :'app_connection_id', + :'action_data' => :'action_data', + :'prefix' => :'prefix', + :'delay_n' => :'delay_n', + :'delay_unit' => :'delay_unit', + :'minute_of_day' => :'minute_of_day', + :'minute_of_day_end' => :'minute_of_day_end', + :'days_of_week' => :'days_of_week', + :'event_trigger' => :'event_trigger', + :'conditions' => :'conditions', + :'match_conditions' => :'match_conditions' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'type' => :'String', + :'action_type_id' => :'String', + :'name' => :'String', + :'required_condition_result' => :'Boolean', + :'app_connection_id' => :'String', + :'action_data' => :'Hash', + :'prefix' => :'String', + :'delay_n' => :'Integer', + :'delay_unit' => :'String', + :'minute_of_day' => :'Integer', + :'minute_of_day_end' => :'Integer', + :'days_of_week' => :'Array', + :'event_trigger' => :'String', + :'conditions' => :'Array>', + :'match_conditions' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::CreateWorkflowRequestTemplateDraftNodesInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::CreateWorkflowRequestTemplateDraftNodesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'action_type_id') + self.action_type_id = attributes[:'action_type_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'required_condition_result') + self.required_condition_result = attributes[:'required_condition_result'] + end + + if attributes.key?(:'app_connection_id') + self.app_connection_id = attributes[:'app_connection_id'] + end + + if attributes.key?(:'action_data') + if (value = attributes[:'action_data']).is_a?(Hash) + self.action_data = value + end + end + + if attributes.key?(:'prefix') + self.prefix = attributes[:'prefix'] + end + + if attributes.key?(:'delay_n') + self.delay_n = attributes[:'delay_n'] + end + + if attributes.key?(:'delay_unit') + self.delay_unit = attributes[:'delay_unit'] + end + + if attributes.key?(:'minute_of_day') + self.minute_of_day = attributes[:'minute_of_day'] + end + + if attributes.key?(:'minute_of_day_end') + self.minute_of_day_end = attributes[:'minute_of_day_end'] + end + + if attributes.key?(:'days_of_week') + if (value = attributes[:'days_of_week']).is_a?(Array) + self.days_of_week = value + end + end + + if attributes.key?(:'event_trigger') + self.event_trigger = attributes[:'event_trigger'] + end + + if attributes.key?(:'conditions') + if (value = attributes[:'conditions']).is_a?(Array) + self.conditions = value + end + end + + if attributes.key?(:'match_conditions') + self.match_conditions = attributes[:'match_conditions'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('String', ["CustomCode", "CustomApiRequest", "Delay", "WaitUntil", "Trigger", "Condition"]) + return false unless type_validator.valid?(@type) + match_conditions_validator = EnumAttributeValidator.new('String', ["all", "any"]) + return false unless match_conditions_validator.valid?(@match_conditions) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["CustomCode", "CustomApiRequest", "Delay", "WaitUntil", "Trigger", "Condition"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] match_conditions Object to be assigned + def match_conditions=(match_conditions) + validator = EnumAttributeValidator.new('String', ["all", "any"]) + unless validator.valid?(match_conditions) + fail ArgumentError, "invalid value for \"match_conditions\", must be one of #{validator.allowable_values}." + end + @match_conditions = match_conditions + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + action_type_id == o.action_type_id && + name == o.name && + required_condition_result == o.required_condition_result && + app_connection_id == o.app_connection_id && + action_data == o.action_data && + prefix == o.prefix && + delay_n == o.delay_n && + delay_unit == o.delay_unit && + minute_of_day == o.minute_of_day && + minute_of_day_end == o.minute_of_day_end && + days_of_week == o.days_of_week && + event_trigger == o.event_trigger && + conditions == o.conditions && + match_conditions == o.match_conditions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, type, action_type_id, name, required_condition_result, app_connection_id, action_data, prefix, delay_n, delay_unit, minute_of_day, minute_of_day_end, days_of_week, event_trigger, conditions, match_conditions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/delete_action_type200_response.rb b/lib/embed_workflow/models/delete_action_type200_response.rb new file mode 100644 index 0000000..7f8d692 --- /dev/null +++ b/lib/embed_workflow/models/delete_action_type200_response.rb @@ -0,0 +1,222 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class DeleteActionType200Response + # ID of deleted resource + attr_accessor :id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::DeleteActionType200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::DeleteActionType200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/delete_workflow200_response.rb b/lib/embed_workflow/models/delete_workflow200_response.rb new file mode 100644 index 0000000..780cde0 --- /dev/null +++ b/lib/embed_workflow/models/delete_workflow200_response.rb @@ -0,0 +1,106 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + # Returns either id or key based on the id_type parameter + module DeleteWorkflow200Response + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'DeleteWorkflow200ResponseOneOf', + :'DeleteWorkflow200ResponseOneOf1' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = EmbedWorkflow.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/embed_workflow/models/delete_workflow200_response_one_of.rb b/lib/embed_workflow/models/delete_workflow200_response_one_of.rb new file mode 100644 index 0000000..68d95ca --- /dev/null +++ b/lib/embed_workflow/models/delete_workflow200_response_one_of.rb @@ -0,0 +1,223 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + # Response when id_type is 'id' + class DeleteWorkflow200ResponseOneOf + # System-generated unique identifier + attr_accessor :id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::DeleteWorkflow200ResponseOneOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::DeleteWorkflow200ResponseOneOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/delete_workflow200_response_one_of1.rb b/lib/embed_workflow/models/delete_workflow200_response_one_of1.rb new file mode 100644 index 0000000..76236a7 --- /dev/null +++ b/lib/embed_workflow/models/delete_workflow200_response_one_of1.rb @@ -0,0 +1,223 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + # Response when id_type is 'key' + class DeleteWorkflow200ResponseOneOf1 + # Client-provided unique identifier + attr_accessor :key + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'key' => :'key' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'key' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::DeleteWorkflow200ResponseOneOf1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::DeleteWorkflow200ResponseOneOf1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'key') + self.key = attributes[:'key'] + else + self.key = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @key.nil? + invalid_properties.push('invalid value for "key", key cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @key.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key == o.key + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [key].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/discard_workflow_draft_request.rb b/lib/embed_workflow/models/discard_workflow_draft_request.rb new file mode 100644 index 0000000..4c2939b --- /dev/null +++ b/lib/embed_workflow/models/discard_workflow_draft_request.rb @@ -0,0 +1,229 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class DiscardWorkflowDraftRequest + # User's key + attr_accessor :user_key + + # Expand related objects + attr_accessor :expand + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_key' => :'user_key', + :'expand' => :'expand' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_key' => :'String', + :'expand' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::DiscardWorkflowDraftRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::DiscardWorkflowDraftRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_key') + self.user_key = attributes[:'user_key'] + else + self.user_key = 'main' + end + + if attributes.key?(:'expand') + if (value = attributes[:'expand']).is_a?(Array) + self.expand = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_key == o.user_key && + expand == o.expand + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_key, expand].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/evaluate_expression200_response.rb b/lib/embed_workflow/models/evaluate_expression200_response.rb new file mode 100644 index 0000000..7e1916c --- /dev/null +++ b/lib/embed_workflow/models/evaluate_expression200_response.rb @@ -0,0 +1,214 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class EvaluateExpression200Response + attr_accessor :result + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'result' => :'result' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'result' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::EvaluateExpression200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::EvaluateExpression200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'result') + self.result = attributes[:'result'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + result == o.result + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [result].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/evaluate_expression_request.rb b/lib/embed_workflow/models/evaluate_expression_request.rb new file mode 100644 index 0000000..4901178 --- /dev/null +++ b/lib/embed_workflow/models/evaluate_expression_request.rb @@ -0,0 +1,241 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class EvaluateExpressionRequest + # Liquid template expression to evaluate against the provided data + attr_accessor :expression + + # Data context for evaluating the expression + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'expression' => :'expression', + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'expression' => :'String', + :'data' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::EvaluateExpressionRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::EvaluateExpressionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'expression') + self.expression = attributes[:'expression'] + else + self.expression = nil + end + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Hash) + self.data = value + end + else + self.data = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @expression.nil? + invalid_properties.push('invalid value for "expression", expression cannot be nil.') + end + + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @expression.nil? + return false if @data.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + expression == o.expression && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [expression, data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/execute_workflow201_response.rb b/lib/embed_workflow/models/execute_workflow201_response.rb new file mode 100644 index 0000000..947626d --- /dev/null +++ b/lib/embed_workflow/models/execute_workflow201_response.rb @@ -0,0 +1,383 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ExecuteWorkflow201Response + # System-generated unique identifier + attr_accessor :hashid + + # Total number of actions in the execution + attr_accessor :actions_count + + # Number of completed actions + attr_accessor :completed_actions_count + + # Created at in specified timezone + attr_accessor :created_at + + # Created at formatted as human-readable string + attr_accessor :created_at_string + + # Created at in UTC + attr_accessor :created_at_utc + + # Data context for the execution + attr_accessor :execution_data + + # Number of failed actions + attr_accessor :failed_actions_count + + # System-generated unique identifier + attr_accessor :id + + # Number of idle actions + attr_accessor :idle_actions_count + + # Unique key for the execution + attr_accessor :key + + # Execution log details + attr_accessor :log + + # Name of the execution + attr_accessor :name + + # Object type identifier + attr_accessor :object + + # Number of currently running actions + attr_accessor :running_actions_count + + # Current status of the execution + attr_accessor :status + + # Number of stopped actions + attr_accessor :stopped_actions_count + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'hashid' => :'hashid', + :'actions_count' => :'actions_count', + :'completed_actions_count' => :'completed_actions_count', + :'created_at' => :'created_at', + :'created_at_string' => :'created_at_string', + :'created_at_utc' => :'created_at_utc', + :'execution_data' => :'execution_data', + :'failed_actions_count' => :'failed_actions_count', + :'id' => :'id', + :'idle_actions_count' => :'idle_actions_count', + :'key' => :'key', + :'log' => :'log', + :'name' => :'name', + :'object' => :'object', + :'running_actions_count' => :'running_actions_count', + :'status' => :'status', + :'stopped_actions_count' => :'stopped_actions_count' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'hashid' => :'String', + :'actions_count' => :'Integer', + :'completed_actions_count' => :'Integer', + :'created_at' => :'String', + :'created_at_string' => :'String', + :'created_at_utc' => :'String', + :'execution_data' => :'Hash', + :'failed_actions_count' => :'Integer', + :'id' => :'String', + :'idle_actions_count' => :'Integer', + :'key' => :'String', + :'log' => :'Object', + :'name' => :'String', + :'object' => :'String', + :'running_actions_count' => :'Integer', + :'status' => :'String', + :'stopped_actions_count' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'actions_count', + :'created_at', + :'created_at_string', + :'created_at_utc', + :'execution_data', + :'log', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ExecuteWorkflow201Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ExecuteWorkflow201Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'hashid') + self.hashid = attributes[:'hashid'] + end + + if attributes.key?(:'actions_count') + self.actions_count = attributes[:'actions_count'] + end + + if attributes.key?(:'completed_actions_count') + self.completed_actions_count = attributes[:'completed_actions_count'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_at_string') + self.created_at_string = attributes[:'created_at_string'] + end + + if attributes.key?(:'created_at_utc') + self.created_at_utc = attributes[:'created_at_utc'] + end + + if attributes.key?(:'execution_data') + if (value = attributes[:'execution_data']).is_a?(Hash) + self.execution_data = value + end + end + + if attributes.key?(:'failed_actions_count') + self.failed_actions_count = attributes[:'failed_actions_count'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'idle_actions_count') + self.idle_actions_count = attributes[:'idle_actions_count'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'log') + self.log = attributes[:'log'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'running_actions_count') + self.running_actions_count = attributes[:'running_actions_count'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'stopped_actions_count') + self.stopped_actions_count = attributes[:'stopped_actions_count'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + hashid == o.hashid && + actions_count == o.actions_count && + completed_actions_count == o.completed_actions_count && + created_at == o.created_at && + created_at_string == o.created_at_string && + created_at_utc == o.created_at_utc && + execution_data == o.execution_data && + failed_actions_count == o.failed_actions_count && + id == o.id && + idle_actions_count == o.idle_actions_count && + key == o.key && + log == o.log && + name == o.name && + object == o.object && + running_actions_count == o.running_actions_count && + status == o.status && + stopped_actions_count == o.stopped_actions_count + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [hashid, actions_count, completed_actions_count, created_at, created_at_string, created_at_utc, execution_data, failed_actions_count, id, idle_actions_count, key, log, name, object, running_actions_count, status, stopped_actions_count].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/execute_workflow_request.rb b/lib/embed_workflow/models/execute_workflow_request.rb new file mode 100644 index 0000000..93df802 --- /dev/null +++ b/lib/embed_workflow/models/execute_workflow_request.rb @@ -0,0 +1,275 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ExecuteWorkflowRequest + # Type of identifier used in the URL + attr_accessor :id_type + + # User's key + attr_accessor :user_key + + # Data required to execute the workflow. Key-value pairs that provide context and variables needed during workflow execution. + attr_accessor :execution_data + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id_type' => :'id_type', + :'user_key' => :'user_key', + :'execution_data' => :'execution_data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id_type' => :'String', + :'user_key' => :'String', + :'execution_data' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ExecuteWorkflowRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ExecuteWorkflowRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id_type') + self.id_type = attributes[:'id_type'] + else + self.id_type = 'id' + end + + if attributes.key?(:'user_key') + self.user_key = attributes[:'user_key'] + else + self.user_key = 'main' + end + + if attributes.key?(:'execution_data') + if (value = attributes[:'execution_data']).is_a?(Hash) + self.execution_data = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + id_type_validator = EnumAttributeValidator.new('String', ["id", "key"]) + return false unless id_type_validator.valid?(@id_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] id_type Object to be assigned + def id_type=(id_type) + validator = EnumAttributeValidator.new('String', ["id", "key"]) + unless validator.valid?(id_type) + fail ArgumentError, "invalid value for \"id_type\", must be one of #{validator.allowable_values}." + end + @id_type = id_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id_type == o.id_type && + user_key == o.user_key && + execution_data == o.execution_data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id_type, user_key, execution_data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/export_configuration200_response.rb b/lib/embed_workflow/models/export_configuration200_response.rb new file mode 100644 index 0000000..31aa5d4 --- /dev/null +++ b/lib/embed_workflow/models/export_configuration200_response.rb @@ -0,0 +1,214 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ExportConfiguration200Response + attr_accessor :configuration + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'configuration' => :'configuration' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'configuration' => :'ExportConfiguration200ResponseConfiguration' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ExportConfiguration200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ExportConfiguration200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'configuration') + self.configuration = attributes[:'configuration'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + configuration == o.configuration + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [configuration].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/export_configuration200_response_configuration.rb b/lib/embed_workflow/models/export_configuration200_response_configuration.rb new file mode 100644 index 0000000..12a2edb --- /dev/null +++ b/lib/embed_workflow/models/export_configuration200_response_configuration.rb @@ -0,0 +1,105 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + module ExportConfiguration200ResponseConfiguration + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Object', + :'String' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = EmbedWorkflow.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/embed_workflow/models/import_configuration201_response.rb b/lib/embed_workflow/models/import_configuration201_response.rb new file mode 100644 index 0000000..16fcae5 --- /dev/null +++ b/lib/embed_workflow/models/import_configuration201_response.rb @@ -0,0 +1,275 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ImportConfiguration201Response + # Object type identifier + attr_accessor :object + + # Account data schema + attr_accessor :account_data_schema + + # ActionTypes + attr_accessor :action_types + + # Triggers + attr_accessor :triggers + + # User data schema for the account + attr_accessor :user_data_schema + + # Workflows + attr_accessor :workflows + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'object' => :'object', + :'account_data_schema' => :'account_data_schema', + :'action_types' => :'action_types', + :'triggers' => :'triggers', + :'user_data_schema' => :'user_data_schema', + :'workflows' => :'workflows' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'object' => :'String', + :'account_data_schema' => :'Array', + :'action_types' => :'Array', + :'triggers' => :'Array', + :'user_data_schema' => :'Array', + :'workflows' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ImportConfiguration201Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ImportConfiguration201Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'account_data_schema') + if (value = attributes[:'account_data_schema']).is_a?(Array) + self.account_data_schema = value + end + end + + if attributes.key?(:'action_types') + if (value = attributes[:'action_types']).is_a?(Array) + self.action_types = value + end + end + + if attributes.key?(:'triggers') + if (value = attributes[:'triggers']).is_a?(Array) + self.triggers = value + end + end + + if attributes.key?(:'user_data_schema') + if (value = attributes[:'user_data_schema']).is_a?(Array) + self.user_data_schema = value + end + end + + if attributes.key?(:'workflows') + if (value = attributes[:'workflows']).is_a?(Array) + self.workflows = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + object == o.object && + account_data_schema == o.account_data_schema && + action_types == o.action_types && + triggers == o.triggers && + user_data_schema == o.user_data_schema && + workflows == o.workflows + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [object, account_data_schema, action_types, triggers, user_data_schema, workflows].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/import_configuration_request.rb b/lib/embed_workflow/models/import_configuration_request.rb new file mode 100644 index 0000000..3328c2d --- /dev/null +++ b/lib/embed_workflow/models/import_configuration_request.rb @@ -0,0 +1,259 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ImportConfigurationRequest + attr_accessor :schema + + # Format for the configuration schema + attr_accessor :schema_format + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'schema' => :'schema', + :'schema_format' => :'schema_format' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'schema' => :'ImportConfigurationRequestSchema', + :'schema_format' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'schema_format' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ImportConfigurationRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ImportConfigurationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'schema') + self.schema = attributes[:'schema'] + end + + if attributes.key?(:'schema_format') + self.schema_format = attributes[:'schema_format'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + schema_format_validator = EnumAttributeValidator.new('String', ["null", "json", "yaml"]) + return false unless schema_format_validator.valid?(@schema_format) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] schema_format Object to be assigned + def schema_format=(schema_format) + validator = EnumAttributeValidator.new('String', ["null", "json", "yaml"]) + unless validator.valid?(schema_format) + fail ArgumentError, "invalid value for \"schema_format\", must be one of #{validator.allowable_values}." + end + @schema_format = schema_format + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + schema == o.schema && + schema_format == o.schema_format + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [schema, schema_format].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/import_configuration_request_schema.rb b/lib/embed_workflow/models/import_configuration_request_schema.rb new file mode 100644 index 0000000..a03e231 --- /dev/null +++ b/lib/embed_workflow/models/import_configuration_request_schema.rb @@ -0,0 +1,106 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + # Configuration data in YAML string or object format + module ImportConfigurationRequestSchema + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Hash', + :'String' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = EmbedWorkflow.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/embed_workflow/models/install_app201_response.rb b/lib/embed_workflow/models/install_app201_response.rb new file mode 100644 index 0000000..01243d5 --- /dev/null +++ b/lib/embed_workflow/models/install_app201_response.rb @@ -0,0 +1,388 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class InstallApp201Response + # System-generated unique identifier + attr_accessor :id + + # Unique identifier for the app + attr_accessor :app_identifier + + # Currently installed version of the app + attr_accessor :app_version + + # Latest available version of the app + attr_accessor :available_version + + # Permission groups that can access this app + attr_accessor :groups + + # Icon configuration for the installed app + attr_accessor :icon + + # Schema configuration for the installed app + attr_accessor :installed_schema + + # Last used at in specified timezone + attr_accessor :last_used_at + + # Last used at formatted as human-readable string + attr_accessor :last_used_at_string + + # Last used at in UTC + attr_accessor :last_used_at_utc + + # Display name of the installed app + attr_accessor :name + + # Object type identifier + attr_accessor :object + + # Previously installed version of the app + attr_accessor :previous_version + + # Whether an upgrade is available for this app + attr_accessor :upgrade_available + + # Upgraded at in specified timezone + attr_accessor :upgraded_at + + # Upgraded at formatted as human-readable string + attr_accessor :upgraded_at_string + + # Upgraded at in UTC + attr_accessor :upgraded_at_utc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'app_identifier' => :'app_identifier', + :'app_version' => :'app_version', + :'available_version' => :'available_version', + :'groups' => :'groups', + :'icon' => :'icon', + :'installed_schema' => :'installed_schema', + :'last_used_at' => :'last_used_at', + :'last_used_at_string' => :'last_used_at_string', + :'last_used_at_utc' => :'last_used_at_utc', + :'name' => :'name', + :'object' => :'object', + :'previous_version' => :'previous_version', + :'upgrade_available' => :'upgrade_available', + :'upgraded_at' => :'upgraded_at', + :'upgraded_at_string' => :'upgraded_at_string', + :'upgraded_at_utc' => :'upgraded_at_utc' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'app_identifier' => :'String', + :'app_version' => :'String', + :'available_version' => :'String', + :'groups' => :'Array', + :'icon' => :'Object', + :'installed_schema' => :'Hash', + :'last_used_at' => :'String', + :'last_used_at_string' => :'String', + :'last_used_at_utc' => :'String', + :'name' => :'String', + :'object' => :'String', + :'previous_version' => :'String', + :'upgrade_available' => :'Boolean', + :'upgraded_at' => :'String', + :'upgraded_at_string' => :'String', + :'upgraded_at_utc' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'available_version', + :'icon', + :'last_used_at', + :'last_used_at_string', + :'last_used_at_utc', + :'previous_version', + :'upgraded_at', + :'upgraded_at_string', + :'upgraded_at_utc' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::InstallApp201Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::InstallApp201Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'app_identifier') + self.app_identifier = attributes[:'app_identifier'] + end + + if attributes.key?(:'app_version') + self.app_version = attributes[:'app_version'] + end + + if attributes.key?(:'available_version') + self.available_version = attributes[:'available_version'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + + if attributes.key?(:'installed_schema') + if (value = attributes[:'installed_schema']).is_a?(Hash) + self.installed_schema = value + end + end + + if attributes.key?(:'last_used_at') + self.last_used_at = attributes[:'last_used_at'] + end + + if attributes.key?(:'last_used_at_string') + self.last_used_at_string = attributes[:'last_used_at_string'] + end + + if attributes.key?(:'last_used_at_utc') + self.last_used_at_utc = attributes[:'last_used_at_utc'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'previous_version') + self.previous_version = attributes[:'previous_version'] + end + + if attributes.key?(:'upgrade_available') + self.upgrade_available = attributes[:'upgrade_available'] + end + + if attributes.key?(:'upgraded_at') + self.upgraded_at = attributes[:'upgraded_at'] + end + + if attributes.key?(:'upgraded_at_string') + self.upgraded_at_string = attributes[:'upgraded_at_string'] + end + + if attributes.key?(:'upgraded_at_utc') + self.upgraded_at_utc = attributes[:'upgraded_at_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + app_identifier == o.app_identifier && + app_version == o.app_version && + available_version == o.available_version && + groups == o.groups && + icon == o.icon && + installed_schema == o.installed_schema && + last_used_at == o.last_used_at && + last_used_at_string == o.last_used_at_string && + last_used_at_utc == o.last_used_at_utc && + name == o.name && + object == o.object && + previous_version == o.previous_version && + upgrade_available == o.upgrade_available && + upgraded_at == o.upgraded_at && + upgraded_at_string == o.upgraded_at_string && + upgraded_at_utc == o.upgraded_at_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, app_identifier, app_version, available_version, groups, icon, installed_schema, last_used_at, last_used_at_string, last_used_at_utc, name, object, previous_version, upgrade_available, upgraded_at, upgraded_at_string, upgraded_at_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/install_app_request.rb b/lib/embed_workflow/models/install_app_request.rb new file mode 100644 index 0000000..a27baf1 --- /dev/null +++ b/lib/embed_workflow/models/install_app_request.rb @@ -0,0 +1,234 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class InstallAppRequest + # App indentifier + attr_accessor :app_identifier + + # User permission groups. Only available to users with admin role. + attr_accessor :groups + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'app_identifier' => :'app_identifier', + :'groups' => :'groups' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'app_identifier' => :'String', + :'groups' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::InstallAppRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::InstallAppRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'app_identifier') + self.app_identifier = attributes[:'app_identifier'] + else + self.app_identifier = nil + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @app_identifier.nil? + invalid_properties.push('invalid value for "app_identifier", app_identifier cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @app_identifier.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + app_identifier == o.app_identifier && + groups == o.groups + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [app_identifier, groups].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_action_types200_response.rb b/lib/embed_workflow/models/list_action_types200_response.rb new file mode 100644 index 0000000..a9b4f6c --- /dev/null +++ b/lib/embed_workflow/models/list_action_types200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListActionTypes200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListActionTypes200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListActionTypes200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_action_types200_response_collection_inner.rb b/lib/embed_workflow/models/list_action_types200_response_collection_inner.rb new file mode 100644 index 0000000..8bab44d --- /dev/null +++ b/lib/embed_workflow/models/list_action_types200_response_collection_inner.rb @@ -0,0 +1,755 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListActionTypes200ResponseCollectionInner + # System-generated unique identifier + attr_accessor :id + + # Human-readable name of the app connection + attr_accessor :app_name + + # Callback timeout duration value + attr_accessor :callback_timeout_n + + # Callback timeout duration unit + attr_accessor :callback_timeout_unit + + # Code content for the action type + attr_accessor :code + + # Draft code content for the action type + attr_accessor :code_draft + + # Created at in specified timezone + attr_accessor :created_at + + # Created at formatted as human-readable string + attr_accessor :created_at_string + + # Created at in UTC + attr_accessor :created_at_utc + + # Description of the action type + attr_accessor :description + + # Number of times this action type has been executed + attr_accessor :executed_count + + # Permission groups for this action type + attr_accessor :groups + + # Whether the action type has unsaved draft changes + attr_accessor :has_draft + + # Headers configuration for the action type + attr_accessor :headers + + # Draft headers configuration for the action type + attr_accessor :headers_draft + + # HTTP method for the action type + attr_accessor :http_method + + # Draft HTTP method for the action type + attr_accessor :http_method_draft + + # Icon configuration for the action type + attr_accessor :icon + + # Draft icon configuration for the action type + attr_accessor :icon_draft + + # Last executed at in specified timezone + attr_accessor :last_executed_at + + # Last executed at formatted as human-readable string + attr_accessor :last_executed_at_string + + # Last executed at in UTC + attr_accessor :last_executed_at_utc + + # Last published at in specified timezone + attr_accessor :last_published_at + + # Last published at formatted as human-readable string + attr_accessor :last_published_at_string + + # Last published at in UTC + attr_accessor :last_published_at_utc + + # Name of the action type + attr_accessor :name + + # Object type identifier + attr_accessor :object + + # Whether the action type is enabled + attr_accessor :on + + # Parameters configuration for the action type + attr_accessor :params + + # Draft parameters configuration for the action type + attr_accessor :params_draft + + # Primary category classification + attr_accessor :primary_category + + # The required app connection for this action type + attr_accessor :required_app_connection + + # Secondary category classification + attr_accessor :secondary_category + + # Source identifier for the action type + attr_accessor :source + + # Type classification of the action + attr_accessor :type + + # Updated at in specified timezone + attr_accessor :updated_at + + # Updated at formatted as human-readable string + attr_accessor :updated_at_string + + # Updated at in UTC + attr_accessor :updated_at_utc + + # URL for the action type + attr_accessor :url + + # Draft URL for the action type + attr_accessor :url_draft + + # When true, actions fire the webhook but wait for an external callback before completing + attr_accessor :wait_for_callback + + # Form fields for the action type + attr_accessor :form + + # Draft form fields for the action type + attr_accessor :form_draft + + # Response data schema for the action type + attr_accessor :response_data_schema + + # Draft response data schema for the action type + attr_accessor :response_data_schema_draft + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'app_name' => :'app_name', + :'callback_timeout_n' => :'callback_timeout_n', + :'callback_timeout_unit' => :'callback_timeout_unit', + :'code' => :'code', + :'code_draft' => :'code_draft', + :'created_at' => :'created_at', + :'created_at_string' => :'created_at_string', + :'created_at_utc' => :'created_at_utc', + :'description' => :'description', + :'executed_count' => :'executed_count', + :'groups' => :'groups', + :'has_draft' => :'has_draft', + :'headers' => :'headers', + :'headers_draft' => :'headers_draft', + :'http_method' => :'http_method', + :'http_method_draft' => :'http_method_draft', + :'icon' => :'icon', + :'icon_draft' => :'icon_draft', + :'last_executed_at' => :'last_executed_at', + :'last_executed_at_string' => :'last_executed_at_string', + :'last_executed_at_utc' => :'last_executed_at_utc', + :'last_published_at' => :'last_published_at', + :'last_published_at_string' => :'last_published_at_string', + :'last_published_at_utc' => :'last_published_at_utc', + :'name' => :'name', + :'object' => :'object', + :'on' => :'on', + :'params' => :'params', + :'params_draft' => :'params_draft', + :'primary_category' => :'primary_category', + :'required_app_connection' => :'required_app_connection', + :'secondary_category' => :'secondary_category', + :'source' => :'source', + :'type' => :'type', + :'updated_at' => :'updated_at', + :'updated_at_string' => :'updated_at_string', + :'updated_at_utc' => :'updated_at_utc', + :'url' => :'url', + :'url_draft' => :'url_draft', + :'wait_for_callback' => :'wait_for_callback', + :'form' => :'form', + :'form_draft' => :'form_draft', + :'response_data_schema' => :'response_data_schema', + :'response_data_schema_draft' => :'response_data_schema_draft' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'app_name' => :'String', + :'callback_timeout_n' => :'Integer', + :'callback_timeout_unit' => :'String', + :'code' => :'String', + :'code_draft' => :'String', + :'created_at' => :'String', + :'created_at_string' => :'String', + :'created_at_utc' => :'String', + :'description' => :'String', + :'executed_count' => :'Integer', + :'groups' => :'Array', + :'has_draft' => :'Boolean', + :'headers' => :'String', + :'headers_draft' => :'String', + :'http_method' => :'String', + :'http_method_draft' => :'String', + :'icon' => :'Object', + :'icon_draft' => :'Object', + :'last_executed_at' => :'String', + :'last_executed_at_string' => :'String', + :'last_executed_at_utc' => :'String', + :'last_published_at' => :'String', + :'last_published_at_string' => :'String', + :'last_published_at_utc' => :'String', + :'name' => :'String', + :'object' => :'String', + :'on' => :'Boolean', + :'params' => :'String', + :'params_draft' => :'String', + :'primary_category' => :'String', + :'required_app_connection' => :'String', + :'secondary_category' => :'String', + :'source' => :'String', + :'type' => :'String', + :'updated_at' => :'String', + :'updated_at_string' => :'String', + :'updated_at_utc' => :'String', + :'url' => :'String', + :'url_draft' => :'String', + :'wait_for_callback' => :'Boolean', + :'form' => :'Array', + :'form_draft' => :'Array', + :'response_data_schema' => :'Array', + :'response_data_schema_draft' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'app_name', + :'callback_timeout_n', + :'callback_timeout_unit', + :'code', + :'code_draft', + :'created_at', + :'created_at_string', + :'created_at_utc', + :'description', + :'headers', + :'headers_draft', + :'http_method', + :'http_method_draft', + :'icon', + :'icon_draft', + :'last_executed_at', + :'last_executed_at_string', + :'last_executed_at_utc', + :'last_published_at', + :'last_published_at_string', + :'last_published_at_utc', + :'params', + :'params_draft', + :'primary_category', + :'required_app_connection', + :'secondary_category', + :'source', + :'updated_at', + :'updated_at_string', + :'updated_at_utc', + :'url', + :'url_draft', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListActionTypes200ResponseCollectionInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListActionTypes200ResponseCollectionInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'app_name') + self.app_name = attributes[:'app_name'] + end + + if attributes.key?(:'callback_timeout_n') + self.callback_timeout_n = attributes[:'callback_timeout_n'] + end + + if attributes.key?(:'callback_timeout_unit') + self.callback_timeout_unit = attributes[:'callback_timeout_unit'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'code_draft') + self.code_draft = attributes[:'code_draft'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_at_string') + self.created_at_string = attributes[:'created_at_string'] + end + + if attributes.key?(:'created_at_utc') + self.created_at_utc = attributes[:'created_at_utc'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'executed_count') + self.executed_count = attributes[:'executed_count'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'has_draft') + self.has_draft = attributes[:'has_draft'] + end + + if attributes.key?(:'headers') + self.headers = attributes[:'headers'] + end + + if attributes.key?(:'headers_draft') + self.headers_draft = attributes[:'headers_draft'] + end + + if attributes.key?(:'http_method') + self.http_method = attributes[:'http_method'] + end + + if attributes.key?(:'http_method_draft') + self.http_method_draft = attributes[:'http_method_draft'] + end + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + + if attributes.key?(:'icon_draft') + self.icon_draft = attributes[:'icon_draft'] + end + + if attributes.key?(:'last_executed_at') + self.last_executed_at = attributes[:'last_executed_at'] + end + + if attributes.key?(:'last_executed_at_string') + self.last_executed_at_string = attributes[:'last_executed_at_string'] + end + + if attributes.key?(:'last_executed_at_utc') + self.last_executed_at_utc = attributes[:'last_executed_at_utc'] + end + + if attributes.key?(:'last_published_at') + self.last_published_at = attributes[:'last_published_at'] + end + + if attributes.key?(:'last_published_at_string') + self.last_published_at_string = attributes[:'last_published_at_string'] + end + + if attributes.key?(:'last_published_at_utc') + self.last_published_at_utc = attributes[:'last_published_at_utc'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'on') + self.on = attributes[:'on'] + end + + if attributes.key?(:'params') + self.params = attributes[:'params'] + end + + if attributes.key?(:'params_draft') + self.params_draft = attributes[:'params_draft'] + end + + if attributes.key?(:'primary_category') + self.primary_category = attributes[:'primary_category'] + end + + if attributes.key?(:'required_app_connection') + self.required_app_connection = attributes[:'required_app_connection'] + end + + if attributes.key?(:'secondary_category') + self.secondary_category = attributes[:'secondary_category'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'updated_at_string') + self.updated_at_string = attributes[:'updated_at_string'] + end + + if attributes.key?(:'updated_at_utc') + self.updated_at_utc = attributes[:'updated_at_utc'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + + if attributes.key?(:'url_draft') + self.url_draft = attributes[:'url_draft'] + end + + if attributes.key?(:'wait_for_callback') + self.wait_for_callback = attributes[:'wait_for_callback'] + end + + if attributes.key?(:'form') + if (value = attributes[:'form']).is_a?(Array) + self.form = value + end + end + + if attributes.key?(:'form_draft') + if (value = attributes[:'form_draft']).is_a?(Array) + self.form_draft = value + end + end + + if attributes.key?(:'response_data_schema') + if (value = attributes[:'response_data_schema']).is_a?(Array) + self.response_data_schema = value + end + end + + if attributes.key?(:'response_data_schema_draft') + if (value = attributes[:'response_data_schema_draft']).is_a?(Array) + self.response_data_schema_draft = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + callback_timeout_unit_validator = EnumAttributeValidator.new('String', ["sec", "min", "hour", "day", "week", "month", "year"]) + return false unless callback_timeout_unit_validator.valid?(@callback_timeout_unit) + http_method_validator = EnumAttributeValidator.new('String', ["get", "post", "put", "patch", "delete"]) + return false unless http_method_validator.valid?(@http_method) + http_method_draft_validator = EnumAttributeValidator.new('String', ["get", "post", "put", "patch", "delete"]) + return false unless http_method_draft_validator.valid?(@http_method_draft) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] callback_timeout_unit Object to be assigned + def callback_timeout_unit=(callback_timeout_unit) + validator = EnumAttributeValidator.new('String', ["sec", "min", "hour", "day", "week", "month", "year"]) + unless validator.valid?(callback_timeout_unit) + fail ArgumentError, "invalid value for \"callback_timeout_unit\", must be one of #{validator.allowable_values}." + end + @callback_timeout_unit = callback_timeout_unit + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] http_method Object to be assigned + def http_method=(http_method) + validator = EnumAttributeValidator.new('String', ["get", "post", "put", "patch", "delete"]) + unless validator.valid?(http_method) + fail ArgumentError, "invalid value for \"http_method\", must be one of #{validator.allowable_values}." + end + @http_method = http_method + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] http_method_draft Object to be assigned + def http_method_draft=(http_method_draft) + validator = EnumAttributeValidator.new('String', ["get", "post", "put", "patch", "delete"]) + unless validator.valid?(http_method_draft) + fail ArgumentError, "invalid value for \"http_method_draft\", must be one of #{validator.allowable_values}." + end + @http_method_draft = http_method_draft + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + app_name == o.app_name && + callback_timeout_n == o.callback_timeout_n && + callback_timeout_unit == o.callback_timeout_unit && + code == o.code && + code_draft == o.code_draft && + created_at == o.created_at && + created_at_string == o.created_at_string && + created_at_utc == o.created_at_utc && + description == o.description && + executed_count == o.executed_count && + groups == o.groups && + has_draft == o.has_draft && + headers == o.headers && + headers_draft == o.headers_draft && + http_method == o.http_method && + http_method_draft == o.http_method_draft && + icon == o.icon && + icon_draft == o.icon_draft && + last_executed_at == o.last_executed_at && + last_executed_at_string == o.last_executed_at_string && + last_executed_at_utc == o.last_executed_at_utc && + last_published_at == o.last_published_at && + last_published_at_string == o.last_published_at_string && + last_published_at_utc == o.last_published_at_utc && + name == o.name && + object == o.object && + on == o.on && + params == o.params && + params_draft == o.params_draft && + primary_category == o.primary_category && + required_app_connection == o.required_app_connection && + secondary_category == o.secondary_category && + source == o.source && + type == o.type && + updated_at == o.updated_at && + updated_at_string == o.updated_at_string && + updated_at_utc == o.updated_at_utc && + url == o.url && + url_draft == o.url_draft && + wait_for_callback == o.wait_for_callback && + form == o.form && + form_draft == o.form_draft && + response_data_schema == o.response_data_schema && + response_data_schema_draft == o.response_data_schema_draft + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, app_name, callback_timeout_n, callback_timeout_unit, code, code_draft, created_at, created_at_string, created_at_utc, description, executed_count, groups, has_draft, headers, headers_draft, http_method, http_method_draft, icon, icon_draft, last_executed_at, last_executed_at_string, last_executed_at_utc, last_published_at, last_published_at_string, last_published_at_utc, name, object, on, params, params_draft, primary_category, required_app_connection, secondary_category, source, type, updated_at, updated_at_string, updated_at_utc, url, url_draft, wait_for_callback, form, form_draft, response_data_schema, response_data_schema_draft].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_action_types200_response_meta.rb b/lib/embed_workflow/models/list_action_types200_response_meta.rb new file mode 100644 index 0000000..b776fe0 --- /dev/null +++ b/lib/embed_workflow/models/list_action_types200_response_meta.rb @@ -0,0 +1,233 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListActionTypes200ResponseMeta + attr_accessor :page_limit + + attr_accessor :has_next_page + + attr_accessor :has_previous_page + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'page_limit' => :'page_limit', + :'has_next_page' => :'has_next_page', + :'has_previous_page' => :'has_previous_page' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'page_limit' => :'Integer', + :'has_next_page' => :'Boolean', + :'has_previous_page' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'page_limit', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListActionTypes200ResponseMeta` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListActionTypes200ResponseMeta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'page_limit') + self.page_limit = attributes[:'page_limit'] + end + + if attributes.key?(:'has_next_page') + self.has_next_page = attributes[:'has_next_page'] + end + + if attributes.key?(:'has_previous_page') + self.has_previous_page = attributes[:'has_previous_page'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page_limit == o.page_limit && + has_next_page == o.has_next_page && + has_previous_page == o.has_previous_page + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [page_limit, has_next_page, has_previous_page].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_actions200_response.rb b/lib/embed_workflow/models/list_actions200_response.rb new file mode 100644 index 0000000..d0d9326 --- /dev/null +++ b/lib/embed_workflow/models/list_actions200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListActions200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListActions200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListActions200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_actions200_response_collection_inner.rb b/lib/embed_workflow/models/list_actions200_response_collection_inner.rb new file mode 100644 index 0000000..5e31ebd --- /dev/null +++ b/lib/embed_workflow/models/list_actions200_response_collection_inner.rb @@ -0,0 +1,429 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListActions200ResponseCollectionInner + # System-generated unique identifier + attr_accessor :hashid + + # Completed at in specified timezone + attr_accessor :completed_at + + # Completed at formatted as human-readable string + attr_accessor :completed_at_string + + # Completed at in UTC + attr_accessor :completed_at_utc + + # ID of the execution this action belongs to + attr_accessor :execution_id + + # Failed at in specified timezone + attr_accessor :failed_at + + # Failed at formatted as human-readable string + attr_accessor :failed_at_string + + # Failed at in UTC + attr_accessor :failed_at_utc + + # Error message when action fails + attr_accessor :failure_note + + # Execution log details for the action + attr_accessor :log + + # Name of the action + attr_accessor :name + + # Node identifier associated with this action + attr_accessor :node_id + + # Object type identifier + attr_accessor :object + + # Run at in specified timezone + attr_accessor :run_at + + # Run at formatted as human-readable string + attr_accessor :run_at_string + + # Run at in UTC + attr_accessor :run_at_utc + + # Current status of the action + attr_accessor :status + + # Stopped at in specified timezone + attr_accessor :stopped_at + + # Stopped at formatted as human-readable string + attr_accessor :stopped_at_string + + # Stopped at in UTC + attr_accessor :stopped_at_utc + + # UUID identifier for the action + attr_accessor :uuid + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'hashid' => :'hashid', + :'completed_at' => :'completed_at', + :'completed_at_string' => :'completed_at_string', + :'completed_at_utc' => :'completed_at_utc', + :'execution_id' => :'execution_id', + :'failed_at' => :'failed_at', + :'failed_at_string' => :'failed_at_string', + :'failed_at_utc' => :'failed_at_utc', + :'failure_note' => :'failure_note', + :'log' => :'log', + :'name' => :'name', + :'node_id' => :'node_id', + :'object' => :'object', + :'run_at' => :'run_at', + :'run_at_string' => :'run_at_string', + :'run_at_utc' => :'run_at_utc', + :'status' => :'status', + :'stopped_at' => :'stopped_at', + :'stopped_at_string' => :'stopped_at_string', + :'stopped_at_utc' => :'stopped_at_utc', + :'uuid' => :'uuid' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'hashid' => :'String', + :'completed_at' => :'String', + :'completed_at_string' => :'String', + :'completed_at_utc' => :'String', + :'execution_id' => :'String', + :'failed_at' => :'String', + :'failed_at_string' => :'String', + :'failed_at_utc' => :'String', + :'failure_note' => :'String', + :'log' => :'Object', + :'name' => :'String', + :'node_id' => :'String', + :'object' => :'String', + :'run_at' => :'String', + :'run_at_string' => :'String', + :'run_at_utc' => :'String', + :'status' => :'String', + :'stopped_at' => :'String', + :'stopped_at_string' => :'String', + :'stopped_at_utc' => :'String', + :'uuid' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'completed_at', + :'completed_at_string', + :'completed_at_utc', + :'failed_at', + :'failed_at_string', + :'failed_at_utc', + :'failure_note', + :'log', + :'run_at', + :'run_at_string', + :'run_at_utc', + :'stopped_at', + :'stopped_at_string', + :'stopped_at_utc', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListActions200ResponseCollectionInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListActions200ResponseCollectionInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'hashid') + self.hashid = attributes[:'hashid'] + end + + if attributes.key?(:'completed_at') + self.completed_at = attributes[:'completed_at'] + end + + if attributes.key?(:'completed_at_string') + self.completed_at_string = attributes[:'completed_at_string'] + end + + if attributes.key?(:'completed_at_utc') + self.completed_at_utc = attributes[:'completed_at_utc'] + end + + if attributes.key?(:'execution_id') + self.execution_id = attributes[:'execution_id'] + end + + if attributes.key?(:'failed_at') + self.failed_at = attributes[:'failed_at'] + end + + if attributes.key?(:'failed_at_string') + self.failed_at_string = attributes[:'failed_at_string'] + end + + if attributes.key?(:'failed_at_utc') + self.failed_at_utc = attributes[:'failed_at_utc'] + end + + if attributes.key?(:'failure_note') + self.failure_note = attributes[:'failure_note'] + end + + if attributes.key?(:'log') + self.log = attributes[:'log'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'node_id') + self.node_id = attributes[:'node_id'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'run_at') + self.run_at = attributes[:'run_at'] + end + + if attributes.key?(:'run_at_string') + self.run_at_string = attributes[:'run_at_string'] + end + + if attributes.key?(:'run_at_utc') + self.run_at_utc = attributes[:'run_at_utc'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'stopped_at') + self.stopped_at = attributes[:'stopped_at'] + end + + if attributes.key?(:'stopped_at_string') + self.stopped_at_string = attributes[:'stopped_at_string'] + end + + if attributes.key?(:'stopped_at_utc') + self.stopped_at_utc = attributes[:'stopped_at_utc'] + end + + if attributes.key?(:'uuid') + self.uuid = attributes[:'uuid'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + hashid == o.hashid && + completed_at == o.completed_at && + completed_at_string == o.completed_at_string && + completed_at_utc == o.completed_at_utc && + execution_id == o.execution_id && + failed_at == o.failed_at && + failed_at_string == o.failed_at_string && + failed_at_utc == o.failed_at_utc && + failure_note == o.failure_note && + log == o.log && + name == o.name && + node_id == o.node_id && + object == o.object && + run_at == o.run_at && + run_at_string == o.run_at_string && + run_at_utc == o.run_at_utc && + status == o.status && + stopped_at == o.stopped_at && + stopped_at_string == o.stopped_at_string && + stopped_at_utc == o.stopped_at_utc && + uuid == o.uuid + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [hashid, completed_at, completed_at_string, completed_at_utc, execution_id, failed_at, failed_at_string, failed_at_utc, failure_note, log, name, node_id, object, run_at, run_at_string, run_at_utc, status, stopped_at, stopped_at_string, stopped_at_utc, uuid].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_app_connections200_response.rb b/lib/embed_workflow/models/list_app_connections200_response.rb new file mode 100644 index 0000000..3017156 --- /dev/null +++ b/lib/embed_workflow/models/list_app_connections200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListAppConnections200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListAppConnections200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListAppConnections200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_app_connections200_response_collection_inner.rb b/lib/embed_workflow/models/list_app_connections200_response_collection_inner.rb new file mode 100644 index 0000000..e4e8750 --- /dev/null +++ b/lib/embed_workflow/models/list_app_connections200_response_collection_inner.rb @@ -0,0 +1,288 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListAppConnections200ResponseCollectionInner + # System-generated unique identifier + attr_accessor :id + + # Type of application being connected + attr_accessor :app_type + + # Last used at in specified timezone + attr_accessor :last_used_at + + # Last used at formatted as human-readable string + attr_accessor :last_used_at_string + + # Last used at in UTC + attr_accessor :last_used_at_utc + + # Name of the app connection + attr_accessor :name + + # Object type identifier + attr_accessor :object + + # Current status of the app connection + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'app_type' => :'app_type', + :'last_used_at' => :'last_used_at', + :'last_used_at_string' => :'last_used_at_string', + :'last_used_at_utc' => :'last_used_at_utc', + :'name' => :'name', + :'object' => :'object', + :'status' => :'status' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'app_type' => :'String', + :'last_used_at' => :'String', + :'last_used_at_string' => :'String', + :'last_used_at_utc' => :'String', + :'name' => :'String', + :'object' => :'String', + :'status' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'last_used_at', + :'last_used_at_string', + :'last_used_at_utc', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListAppConnections200ResponseCollectionInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListAppConnections200ResponseCollectionInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'app_type') + self.app_type = attributes[:'app_type'] + end + + if attributes.key?(:'last_used_at') + self.last_used_at = attributes[:'last_used_at'] + end + + if attributes.key?(:'last_used_at_string') + self.last_used_at_string = attributes[:'last_used_at_string'] + end + + if attributes.key?(:'last_used_at_utc') + self.last_used_at_utc = attributes[:'last_used_at_utc'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + app_type == o.app_type && + last_used_at == o.last_used_at && + last_used_at_string == o.last_used_at_string && + last_used_at_utc == o.last_used_at_utc && + name == o.name && + object == o.object && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, app_type, last_used_at, last_used_at_string, last_used_at_utc, name, object, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_available_apps200_response.rb b/lib/embed_workflow/models/list_available_apps200_response.rb new file mode 100644 index 0000000..afc5a1b --- /dev/null +++ b/lib/embed_workflow/models/list_available_apps200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListAvailableApps200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListAvailableApps200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListAvailableApps200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_available_apps200_response_collection_inner.rb b/lib/embed_workflow/models/list_available_apps200_response_collection_inner.rb new file mode 100644 index 0000000..ebcdbf0 --- /dev/null +++ b/lib/embed_workflow/models/list_available_apps200_response_collection_inner.rb @@ -0,0 +1,287 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListAvailableApps200ResponseCollectionInner + # Name of the app + attr_accessor :name + + # Unique identifier for the app + attr_accessor :app_identifier + + # Description of the available app + attr_accessor :description + + # Icon configuration for the available app + attr_accessor :icon + + # Latest available version of the app + attr_accessor :latest_version + + # Object type identifier + attr_accessor :object + + # Primary category classification for the app + attr_accessor :primary_category + + # Secondary category classification for the app + attr_accessor :secondary_category + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'app_identifier' => :'app_identifier', + :'description' => :'description', + :'icon' => :'icon', + :'latest_version' => :'latest_version', + :'object' => :'object', + :'primary_category' => :'primary_category', + :'secondary_category' => :'secondary_category' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'app_identifier' => :'String', + :'description' => :'String', + :'icon' => :'Object', + :'latest_version' => :'String', + :'object' => :'String', + :'primary_category' => :'String', + :'secondary_category' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'icon', + :'secondary_category' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListAvailableApps200ResponseCollectionInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListAvailableApps200ResponseCollectionInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'app_identifier') + self.app_identifier = attributes[:'app_identifier'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + + if attributes.key?(:'latest_version') + self.latest_version = attributes[:'latest_version'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'primary_category') + self.primary_category = attributes[:'primary_category'] + end + + if attributes.key?(:'secondary_category') + self.secondary_category = attributes[:'secondary_category'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + app_identifier == o.app_identifier && + description == o.description && + icon == o.icon && + latest_version == o.latest_version && + object == o.object && + primary_category == o.primary_category && + secondary_category == o.secondary_category + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, app_identifier, description, icon, latest_version, object, primary_category, secondary_category].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_data_fields200_response.rb b/lib/embed_workflow/models/list_data_fields200_response.rb new file mode 100644 index 0000000..0cee0b3 --- /dev/null +++ b/lib/embed_workflow/models/list_data_fields200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListDataFields200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListDataFields200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListDataFields200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_data_fields200_response_collection_inner.rb b/lib/embed_workflow/models/list_data_fields200_response_collection_inner.rb new file mode 100644 index 0000000..965b437 --- /dev/null +++ b/lib/embed_workflow/models/list_data_fields200_response_collection_inner.rb @@ -0,0 +1,369 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListDataFields200ResponseCollectionInner + # Variable name used in templates + attr_accessor :variable + + # Path to the data within the structure + attr_accessor :data_path + + # Display label for the data type + attr_accessor :display_label + + # Format specification for the data type + attr_accessor :format + + # Permission groups for this data type + attr_accessor :groups + + # Type of each item in a List (e.g., 'Object', 'String', 'Integer') + attr_accessor :item_type + + # Variable name for the current item when iterating over a List + attr_accessor :iterator + + # Variable name for list values + attr_accessor :list_values_variable + + # Object type identifier + attr_accessor :object + + # Whether this data type is required + attr_accessor :required + + # Whether this field value should be redacted in logs and API responses + attr_accessor :secret + + # Source identifier for the data type + attr_accessor :source + + # Data type identifier + attr_accessor :type + + # Default or current value + attr_accessor :value + + # Nested schema definitions. For arrays: single element defining item type. For objects: multiple elements defining properties + attr_accessor :children + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'variable' => :'variable', + :'data_path' => :'data_path', + :'display_label' => :'display_label', + :'format' => :'format', + :'groups' => :'groups', + :'item_type' => :'item_type', + :'iterator' => :'iterator', + :'list_values_variable' => :'list_values_variable', + :'object' => :'object', + :'required' => :'required', + :'secret' => :'secret', + :'source' => :'source', + :'type' => :'type', + :'value' => :'value', + :'children' => :'children' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'variable' => :'String', + :'data_path' => :'String', + :'display_label' => :'String', + :'format' => :'String', + :'groups' => :'Array', + :'item_type' => :'String', + :'iterator' => :'String', + :'list_values_variable' => :'String', + :'object' => :'String', + :'required' => :'Boolean', + :'secret' => :'Boolean', + :'source' => :'String', + :'type' => :'String', + :'value' => :'String', + :'children' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'data_path', + :'format', + :'groups', + :'item_type', + :'iterator', + :'list_values_variable', + :'secret', + :'source', + :'value', + :'children' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListDataFields200ResponseCollectionInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListDataFields200ResponseCollectionInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'variable') + self.variable = attributes[:'variable'] + end + + if attributes.key?(:'data_path') + self.data_path = attributes[:'data_path'] + end + + if attributes.key?(:'display_label') + self.display_label = attributes[:'display_label'] + end + + if attributes.key?(:'format') + self.format = attributes[:'format'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'item_type') + self.item_type = attributes[:'item_type'] + end + + if attributes.key?(:'iterator') + self.iterator = attributes[:'iterator'] + end + + if attributes.key?(:'list_values_variable') + self.list_values_variable = attributes[:'list_values_variable'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'required') + self.required = attributes[:'required'] + end + + if attributes.key?(:'secret') + self.secret = attributes[:'secret'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'children') + if (value = attributes[:'children']).is_a?(Array) + self.children = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + variable == o.variable && + data_path == o.data_path && + display_label == o.display_label && + format == o.format && + groups == o.groups && + item_type == o.item_type && + iterator == o.iterator && + list_values_variable == o.list_values_variable && + object == o.object && + required == o.required && + secret == o.secret && + source == o.source && + type == o.type && + value == o.value && + children == o.children + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [variable, data_path, display_label, format, groups, item_type, iterator, list_values_variable, object, required, secret, source, type, value, children].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_data_fields_type_parameter.rb b/lib/embed_workflow/models/list_data_fields_type_parameter.rb new file mode 100644 index 0000000..f02c33c --- /dev/null +++ b/lib/embed_workflow/models/list_data_fields_type_parameter.rb @@ -0,0 +1,105 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + module ListDataFieldsTypeParameter + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Array', + :'String' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = EmbedWorkflow.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/embed_workflow/models/list_events200_response.rb b/lib/embed_workflow/models/list_events200_response.rb new file mode 100644 index 0000000..a85c9ef --- /dev/null +++ b/lib/embed_workflow/models/list_events200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListEvents200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListEvents200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListEvents200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_events200_response_collection_inner.rb b/lib/embed_workflow/models/list_events200_response_collection_inner.rb new file mode 100644 index 0000000..b1479a4 --- /dev/null +++ b/lib/embed_workflow/models/list_events200_response_collection_inner.rb @@ -0,0 +1,312 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListEvents200ResponseCollectionInner + # System-generated unique identifier + attr_accessor :id + + # Ended at in specified timezone + attr_accessor :ended_at + + # Ended at formatted as human-readable string + attr_accessor :ended_at_string + + # Ended at in UTC + attr_accessor :ended_at_utc + + # Type of event that occurred + attr_accessor :event_type + + # Object type identifier + attr_accessor :object + + # Response body from the event + attr_accessor :response_body + + # Started at in specified timezone + attr_accessor :started_at + + # Started at formatted as human-readable string + attr_accessor :started_at_string + + # Started at in UTC + attr_accessor :started_at_utc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'ended_at' => :'ended_at', + :'ended_at_string' => :'ended_at_string', + :'ended_at_utc' => :'ended_at_utc', + :'event_type' => :'event_type', + :'object' => :'object', + :'response_body' => :'response_body', + :'started_at' => :'started_at', + :'started_at_string' => :'started_at_string', + :'started_at_utc' => :'started_at_utc' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'ended_at' => :'String', + :'ended_at_string' => :'String', + :'ended_at_utc' => :'String', + :'event_type' => :'String', + :'object' => :'String', + :'response_body' => :'String', + :'started_at' => :'String', + :'started_at_string' => :'String', + :'started_at_utc' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'ended_at', + :'ended_at_string', + :'ended_at_utc', + :'response_body', + :'started_at', + :'started_at_string', + :'started_at_utc' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListEvents200ResponseCollectionInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListEvents200ResponseCollectionInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'ended_at') + self.ended_at = attributes[:'ended_at'] + end + + if attributes.key?(:'ended_at_string') + self.ended_at_string = attributes[:'ended_at_string'] + end + + if attributes.key?(:'ended_at_utc') + self.ended_at_utc = attributes[:'ended_at_utc'] + end + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'response_body') + self.response_body = attributes[:'response_body'] + end + + if attributes.key?(:'started_at') + self.started_at = attributes[:'started_at'] + end + + if attributes.key?(:'started_at_string') + self.started_at_string = attributes[:'started_at_string'] + end + + if attributes.key?(:'started_at_utc') + self.started_at_utc = attributes[:'started_at_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + ended_at == o.ended_at && + ended_at_string == o.ended_at_string && + ended_at_utc == o.ended_at_utc && + event_type == o.event_type && + object == o.object && + response_body == o.response_body && + started_at == o.started_at && + started_at_string == o.started_at_string && + started_at_utc == o.started_at_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, ended_at, ended_at_string, ended_at_utc, event_type, object, response_body, started_at, started_at_string, started_at_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_installed_apps200_response.rb b/lib/embed_workflow/models/list_installed_apps200_response.rb new file mode 100644 index 0000000..27c6c86 --- /dev/null +++ b/lib/embed_workflow/models/list_installed_apps200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListInstalledApps200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListInstalledApps200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListInstalledApps200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_installed_apps200_response_collection_inner.rb b/lib/embed_workflow/models/list_installed_apps200_response_collection_inner.rb new file mode 100644 index 0000000..3a9a72c --- /dev/null +++ b/lib/embed_workflow/models/list_installed_apps200_response_collection_inner.rb @@ -0,0 +1,376 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListInstalledApps200ResponseCollectionInner + # System-generated unique identifier + attr_accessor :id + + # Unique identifier for the app + attr_accessor :app_identifier + + # Currently installed version of the app + attr_accessor :app_version + + # Latest available version of the app + attr_accessor :available_version + + # Permission groups that can access this app + attr_accessor :groups + + # Icon configuration for the installed app + attr_accessor :icon + + # Last used at in specified timezone + attr_accessor :last_used_at + + # Last used at formatted as human-readable string + attr_accessor :last_used_at_string + + # Last used at in UTC + attr_accessor :last_used_at_utc + + # Display name of the installed app + attr_accessor :name + + # Object type identifier + attr_accessor :object + + # Previously installed version of the app + attr_accessor :previous_version + + # Whether an upgrade is available for this app + attr_accessor :upgrade_available + + # Upgraded at in specified timezone + attr_accessor :upgraded_at + + # Upgraded at formatted as human-readable string + attr_accessor :upgraded_at_string + + # Upgraded at in UTC + attr_accessor :upgraded_at_utc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'app_identifier' => :'app_identifier', + :'app_version' => :'app_version', + :'available_version' => :'available_version', + :'groups' => :'groups', + :'icon' => :'icon', + :'last_used_at' => :'last_used_at', + :'last_used_at_string' => :'last_used_at_string', + :'last_used_at_utc' => :'last_used_at_utc', + :'name' => :'name', + :'object' => :'object', + :'previous_version' => :'previous_version', + :'upgrade_available' => :'upgrade_available', + :'upgraded_at' => :'upgraded_at', + :'upgraded_at_string' => :'upgraded_at_string', + :'upgraded_at_utc' => :'upgraded_at_utc' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'app_identifier' => :'String', + :'app_version' => :'String', + :'available_version' => :'String', + :'groups' => :'Array', + :'icon' => :'Object', + :'last_used_at' => :'String', + :'last_used_at_string' => :'String', + :'last_used_at_utc' => :'String', + :'name' => :'String', + :'object' => :'String', + :'previous_version' => :'String', + :'upgrade_available' => :'Boolean', + :'upgraded_at' => :'String', + :'upgraded_at_string' => :'String', + :'upgraded_at_utc' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'available_version', + :'icon', + :'last_used_at', + :'last_used_at_string', + :'last_used_at_utc', + :'previous_version', + :'upgraded_at', + :'upgraded_at_string', + :'upgraded_at_utc' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListInstalledApps200ResponseCollectionInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListInstalledApps200ResponseCollectionInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'app_identifier') + self.app_identifier = attributes[:'app_identifier'] + end + + if attributes.key?(:'app_version') + self.app_version = attributes[:'app_version'] + end + + if attributes.key?(:'available_version') + self.available_version = attributes[:'available_version'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + + if attributes.key?(:'last_used_at') + self.last_used_at = attributes[:'last_used_at'] + end + + if attributes.key?(:'last_used_at_string') + self.last_used_at_string = attributes[:'last_used_at_string'] + end + + if attributes.key?(:'last_used_at_utc') + self.last_used_at_utc = attributes[:'last_used_at_utc'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'previous_version') + self.previous_version = attributes[:'previous_version'] + end + + if attributes.key?(:'upgrade_available') + self.upgrade_available = attributes[:'upgrade_available'] + end + + if attributes.key?(:'upgraded_at') + self.upgraded_at = attributes[:'upgraded_at'] + end + + if attributes.key?(:'upgraded_at_string') + self.upgraded_at_string = attributes[:'upgraded_at_string'] + end + + if attributes.key?(:'upgraded_at_utc') + self.upgraded_at_utc = attributes[:'upgraded_at_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + app_identifier == o.app_identifier && + app_version == o.app_version && + available_version == o.available_version && + groups == o.groups && + icon == o.icon && + last_used_at == o.last_used_at && + last_used_at_string == o.last_used_at_string && + last_used_at_utc == o.last_used_at_utc && + name == o.name && + object == o.object && + previous_version == o.previous_version && + upgrade_available == o.upgrade_available && + upgraded_at == o.upgraded_at && + upgraded_at_string == o.upgraded_at_string && + upgraded_at_utc == o.upgraded_at_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, app_identifier, app_version, available_version, groups, icon, last_used_at, last_used_at_string, last_used_at_utc, name, object, previous_version, upgrade_available, upgraded_at, upgraded_at_string, upgraded_at_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_triggers200_response.rb b/lib/embed_workflow/models/list_triggers200_response.rb new file mode 100644 index 0000000..2a673b7 --- /dev/null +++ b/lib/embed_workflow/models/list_triggers200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListTriggers200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListTriggers200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListTriggers200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_triggers200_response_collection_inner.rb b/lib/embed_workflow/models/list_triggers200_response_collection_inner.rb new file mode 100644 index 0000000..d2a3cf4 --- /dev/null +++ b/lib/embed_workflow/models/list_triggers200_response_collection_inner.rb @@ -0,0 +1,387 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListTriggers200ResponseCollectionInner + # System-generated unique identifier + attr_accessor :id + + # Created at in specified timezone + attr_accessor :created_at + + # Created at formatted as human-readable string + attr_accessor :created_at_string + + # Created at in UTC + attr_accessor :created_at_utc + + # Short description for the trigger + attr_accessor :description + + # Event type that activates this trigger + attr_accessor :event + + # Permission groups for this trigger + attr_accessor :groups + + # Hook identifier for the trigger + attr_accessor :hook_id + + # Icon configuration for the trigger + attr_accessor :icon + + # Last triggered at in specified timezone + attr_accessor :last_triggered_at + + # Last triggered at formatted as human-readable string + attr_accessor :last_triggered_at_string + + # Last triggered at in UTC + attr_accessor :last_triggered_at_utc + + # Object type identifier + attr_accessor :object + + # Whether the trigger is enabled + attr_accessor :on + + # Number of times this trigger has been processed + attr_accessor :processed_count + + # Display title for the trigger + attr_accessor :title + + # Data input schema for the trigger + attr_accessor :data_input_schema + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'created_at' => :'created_at', + :'created_at_string' => :'created_at_string', + :'created_at_utc' => :'created_at_utc', + :'description' => :'description', + :'event' => :'event', + :'groups' => :'groups', + :'hook_id' => :'hook_id', + :'icon' => :'icon', + :'last_triggered_at' => :'last_triggered_at', + :'last_triggered_at_string' => :'last_triggered_at_string', + :'last_triggered_at_utc' => :'last_triggered_at_utc', + :'object' => :'object', + :'on' => :'on', + :'processed_count' => :'processed_count', + :'title' => :'title', + :'data_input_schema' => :'data_input_schema' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'created_at' => :'String', + :'created_at_string' => :'String', + :'created_at_utc' => :'String', + :'description' => :'String', + :'event' => :'String', + :'groups' => :'Array', + :'hook_id' => :'String', + :'icon' => :'Object', + :'last_triggered_at' => :'String', + :'last_triggered_at_string' => :'String', + :'last_triggered_at_utc' => :'String', + :'object' => :'String', + :'on' => :'Boolean', + :'processed_count' => :'Integer', + :'title' => :'String', + :'data_input_schema' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'created_at', + :'created_at_string', + :'created_at_utc', + :'description', + :'icon', + :'last_triggered_at', + :'last_triggered_at_string', + :'last_triggered_at_utc', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListTriggers200ResponseCollectionInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListTriggers200ResponseCollectionInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_at_string') + self.created_at_string = attributes[:'created_at_string'] + end + + if attributes.key?(:'created_at_utc') + self.created_at_utc = attributes[:'created_at_utc'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'event') + self.event = attributes[:'event'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'hook_id') + self.hook_id = attributes[:'hook_id'] + end + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + + if attributes.key?(:'last_triggered_at') + self.last_triggered_at = attributes[:'last_triggered_at'] + end + + if attributes.key?(:'last_triggered_at_string') + self.last_triggered_at_string = attributes[:'last_triggered_at_string'] + end + + if attributes.key?(:'last_triggered_at_utc') + self.last_triggered_at_utc = attributes[:'last_triggered_at_utc'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'on') + self.on = attributes[:'on'] + end + + if attributes.key?(:'processed_count') + self.processed_count = attributes[:'processed_count'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'data_input_schema') + if (value = attributes[:'data_input_schema']).is_a?(Array) + self.data_input_schema = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + created_at == o.created_at && + created_at_string == o.created_at_string && + created_at_utc == o.created_at_utc && + description == o.description && + event == o.event && + groups == o.groups && + hook_id == o.hook_id && + icon == o.icon && + last_triggered_at == o.last_triggered_at && + last_triggered_at_string == o.last_triggered_at_string && + last_triggered_at_utc == o.last_triggered_at_utc && + object == o.object && + on == o.on && + processed_count == o.processed_count && + title == o.title && + data_input_schema == o.data_input_schema + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, created_at, created_at_string, created_at_utc, description, event, groups, hook_id, icon, last_triggered_at, last_triggered_at_string, last_triggered_at_utc, object, on, processed_count, title, data_input_schema].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_users200_response.rb b/lib/embed_workflow/models/list_users200_response.rb new file mode 100644 index 0000000..982092d --- /dev/null +++ b/lib/embed_workflow/models/list_users200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListUsers200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListUsers200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListUsers200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_users200_response_collection_inner.rb b/lib/embed_workflow/models/list_users200_response_collection_inner.rb new file mode 100644 index 0000000..7d53b04 --- /dev/null +++ b/lib/embed_workflow/models/list_users200_response_collection_inner.rb @@ -0,0 +1,326 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListUsers200ResponseCollectionInner + # Unique identifier for the user + attr_accessor :key + + # Created at in specified timezone + attr_accessor :created_at + + # Created at formatted as human-readable string + attr_accessor :created_at_string + + # Created at in UTC + attr_accessor :created_at_utc + + # User's email address + attr_accessor :email + + # Permission groups the user belongs to + attr_accessor :groups + + # System-generated unique identifier + attr_accessor :id + + # User's display name + attr_accessor :name + + # Object type identifier + attr_accessor :object + + # Time zone setting for the user in IANA timezone format (e.g. 'America/New_York', 'Europe/London', 'Asia/Tokyo', 'Etc/UTC') + attr_accessor :time_zone + + # User's data schema configuration + attr_accessor :user_data_schema + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'key' => :'key', + :'created_at' => :'created_at', + :'created_at_string' => :'created_at_string', + :'created_at_utc' => :'created_at_utc', + :'email' => :'email', + :'groups' => :'groups', + :'id' => :'id', + :'name' => :'name', + :'object' => :'object', + :'time_zone' => :'time_zone', + :'user_data_schema' => :'user_data_schema' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'key' => :'String', + :'created_at' => :'String', + :'created_at_string' => :'String', + :'created_at_utc' => :'String', + :'email' => :'String', + :'groups' => :'Array', + :'id' => :'String', + :'name' => :'String', + :'object' => :'String', + :'time_zone' => :'String', + :'user_data_schema' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'created_at', + :'created_at_string', + :'created_at_utc', + :'groups', + :'name', + :'time_zone', + :'user_data_schema' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListUsers200ResponseCollectionInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListUsers200ResponseCollectionInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_at_string') + self.created_at_string = attributes[:'created_at_string'] + end + + if attributes.key?(:'created_at_utc') + self.created_at_utc = attributes[:'created_at_utc'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'time_zone') + self.time_zone = attributes[:'time_zone'] + end + + if attributes.key?(:'user_data_schema') + if (value = attributes[:'user_data_schema']).is_a?(Array) + self.user_data_schema = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key == o.key && + created_at == o.created_at && + created_at_string == o.created_at_string && + created_at_utc == o.created_at_utc && + email == o.email && + groups == o.groups && + id == o.id && + name == o.name && + object == o.object && + time_zone == o.time_zone && + user_data_schema == o.user_data_schema + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [key, created_at, created_at_string, created_at_utc, email, groups, id, name, object, time_zone, user_data_schema].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_workflow_executions200_response.rb b/lib/embed_workflow/models/list_workflow_executions200_response.rb new file mode 100644 index 0000000..86b902e --- /dev/null +++ b/lib/embed_workflow/models/list_workflow_executions200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListWorkflowExecutions200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListWorkflowExecutions200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListWorkflowExecutions200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_workflow_versions200_response.rb b/lib/embed_workflow/models/list_workflow_versions200_response.rb new file mode 100644 index 0000000..0baf3ef --- /dev/null +++ b/lib/embed_workflow/models/list_workflow_versions200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListWorkflowVersions200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListWorkflowVersions200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListWorkflowVersions200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_workflow_versions200_response_collection_inner.rb b/lib/embed_workflow/models/list_workflow_versions200_response_collection_inner.rb new file mode 100644 index 0000000..bd05fa7 --- /dev/null +++ b/lib/embed_workflow/models/list_workflow_versions200_response_collection_inner.rb @@ -0,0 +1,278 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListWorkflowVersions200ResponseCollectionInner + # System-generated unique identifier + attr_accessor :id + + # Created at in specified timezone + attr_accessor :created_at + + # Created at formatted as human-readable string + attr_accessor :created_at_string + + # Created at in UTC + attr_accessor :created_at_utc + + # The event that created this version + attr_accessor :event + + # Object type identifier + attr_accessor :object + + # Type of resource this version belongs to + attr_accessor :resource_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'created_at' => :'created_at', + :'created_at_string' => :'created_at_string', + :'created_at_utc' => :'created_at_utc', + :'event' => :'event', + :'object' => :'object', + :'resource_type' => :'resource_type' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'created_at' => :'String', + :'created_at_string' => :'String', + :'created_at_utc' => :'String', + :'event' => :'String', + :'object' => :'String', + :'resource_type' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'created_at', + :'created_at_string', + :'created_at_utc', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListWorkflowVersions200ResponseCollectionInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListWorkflowVersions200ResponseCollectionInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_at_string') + self.created_at_string = attributes[:'created_at_string'] + end + + if attributes.key?(:'created_at_utc') + self.created_at_utc = attributes[:'created_at_utc'] + end + + if attributes.key?(:'event') + self.event = attributes[:'event'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'resource_type') + self.resource_type = attributes[:'resource_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + created_at == o.created_at && + created_at_string == o.created_at_string && + created_at_utc == o.created_at_utc && + event == o.event && + object == o.object && + resource_type == o.resource_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, created_at, created_at_string, created_at_utc, event, object, resource_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_workflows200_response.rb b/lib/embed_workflow/models/list_workflows200_response.rb new file mode 100644 index 0000000..365d51c --- /dev/null +++ b/lib/embed_workflow/models/list_workflows200_response.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListWorkflows200Response + attr_accessor :collection + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'collection' => :'collection', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'collection' => :'Array', + :'meta' => :'ListActionTypes200ResponseMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListWorkflows200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListWorkflows200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'collection') + if (value = attributes[:'collection']).is_a?(Array) + self.collection = value + end + else + self.collection = nil + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + else + self.meta = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @collection.nil? + invalid_properties.push('invalid value for "collection", collection cannot be nil.') + end + + if @meta.nil? + invalid_properties.push('invalid value for "meta", meta cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @collection.nil? + return false if @meta.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + collection == o.collection && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [collection, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/list_workflows200_response_collection_inner.rb b/lib/embed_workflow/models/list_workflows200_response_collection_inner.rb new file mode 100644 index 0000000..d1c36b0 --- /dev/null +++ b/lib/embed_workflow/models/list_workflows200_response_collection_inner.rb @@ -0,0 +1,562 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class ListWorkflows200ResponseCollectionInner + # Unique identifier + attr_accessor :id + + # Action type IDs used in this workflow's template + attr_accessor :action_type_ids + + # Number of actions in the workflow + attr_accessor :actions_count + + # Created at in specified timezone + attr_accessor :created_at + + # Created at formatted as human-readable string + attr_accessor :created_at_string + + # Created at in UTC + attr_accessor :created_at_utc + + # Description of the workflow + attr_accessor :description + + # Event trigger configuration + attr_accessor :event_trigger + + # Draft event trigger configuration + attr_accessor :event_trigger_draft + + # Number of times workflow has been executed + attr_accessor :executions_count + + # Whether the workflow has unsaved draft changes + attr_accessor :has_draft + + # Whether this workflow is managed by the account and read-only + attr_accessor :is_managed + + # Unique key for the workflow + attr_accessor :key + + # Last executed at in specified timezone + attr_accessor :last_executed_at + + # Last executed at formatted as human-readable string + attr_accessor :last_executed_at_string + + # Last executed at in UTC + attr_accessor :last_executed_at_utc + + # Last published at in specified timezone + attr_accessor :last_published_at + + # Last published at formatted as human-readable string + attr_accessor :last_published_at_string + + # Last published at in UTC + attr_accessor :last_published_at_utc + + # Conditions for matching workflow execution + attr_accessor :match_conditions + + # Draft conditions for matching workflow execution + attr_accessor :match_conditions_draft + + # Name of the workflow + attr_accessor :name + + # Object type identifier + attr_accessor :object + + # Whether the workflow is enabled + attr_accessor :on + + # Current status of the workflow + attr_accessor :status + + # Conditions for triggering the workflow + attr_accessor :trigger_conditions + + # Draft conditions for triggering the workflow + attr_accessor :trigger_conditions_draft + + # Updated at in specified timezone + attr_accessor :updated_at + + # Updated at formatted as human-readable string + attr_accessor :updated_at_string + + # Updated at in UTC + attr_accessor :updated_at_utc + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'action_type_ids' => :'action_type_ids', + :'actions_count' => :'actions_count', + :'created_at' => :'created_at', + :'created_at_string' => :'created_at_string', + :'created_at_utc' => :'created_at_utc', + :'description' => :'description', + :'event_trigger' => :'event_trigger', + :'event_trigger_draft' => :'event_trigger_draft', + :'executions_count' => :'executions_count', + :'has_draft' => :'has_draft', + :'is_managed' => :'is_managed', + :'key' => :'key', + :'last_executed_at' => :'last_executed_at', + :'last_executed_at_string' => :'last_executed_at_string', + :'last_executed_at_utc' => :'last_executed_at_utc', + :'last_published_at' => :'last_published_at', + :'last_published_at_string' => :'last_published_at_string', + :'last_published_at_utc' => :'last_published_at_utc', + :'match_conditions' => :'match_conditions', + :'match_conditions_draft' => :'match_conditions_draft', + :'name' => :'name', + :'object' => :'object', + :'on' => :'on', + :'status' => :'status', + :'trigger_conditions' => :'trigger_conditions', + :'trigger_conditions_draft' => :'trigger_conditions_draft', + :'updated_at' => :'updated_at', + :'updated_at_string' => :'updated_at_string', + :'updated_at_utc' => :'updated_at_utc' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'action_type_ids' => :'Array', + :'actions_count' => :'Integer', + :'created_at' => :'String', + :'created_at_string' => :'String', + :'created_at_utc' => :'String', + :'description' => :'String', + :'event_trigger' => :'Object', + :'event_trigger_draft' => :'Object', + :'executions_count' => :'Integer', + :'has_draft' => :'Boolean', + :'is_managed' => :'Boolean', + :'key' => :'String', + :'last_executed_at' => :'String', + :'last_executed_at_string' => :'String', + :'last_executed_at_utc' => :'String', + :'last_published_at' => :'String', + :'last_published_at_string' => :'String', + :'last_published_at_utc' => :'String', + :'match_conditions' => :'Object', + :'match_conditions_draft' => :'Object', + :'name' => :'String', + :'object' => :'String', + :'on' => :'Boolean', + :'status' => :'String', + :'trigger_conditions' => :'Hash', + :'trigger_conditions_draft' => :'Hash', + :'updated_at' => :'String', + :'updated_at_string' => :'String', + :'updated_at_utc' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'created_at', + :'created_at_string', + :'created_at_utc', + :'description', + :'event_trigger', + :'event_trigger_draft', + :'last_executed_at', + :'last_executed_at_string', + :'last_executed_at_utc', + :'last_published_at', + :'last_published_at_string', + :'last_published_at_utc', + :'match_conditions', + :'match_conditions_draft', + :'updated_at', + :'updated_at_string', + :'updated_at_utc' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::ListWorkflows200ResponseCollectionInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::ListWorkflows200ResponseCollectionInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'action_type_ids') + if (value = attributes[:'action_type_ids']).is_a?(Array) + self.action_type_ids = value + end + end + + if attributes.key?(:'actions_count') + self.actions_count = attributes[:'actions_count'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_at_string') + self.created_at_string = attributes[:'created_at_string'] + end + + if attributes.key?(:'created_at_utc') + self.created_at_utc = attributes[:'created_at_utc'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'event_trigger') + self.event_trigger = attributes[:'event_trigger'] + end + + if attributes.key?(:'event_trigger_draft') + self.event_trigger_draft = attributes[:'event_trigger_draft'] + end + + if attributes.key?(:'executions_count') + self.executions_count = attributes[:'executions_count'] + end + + if attributes.key?(:'has_draft') + self.has_draft = attributes[:'has_draft'] + end + + if attributes.key?(:'is_managed') + self.is_managed = attributes[:'is_managed'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'last_executed_at') + self.last_executed_at = attributes[:'last_executed_at'] + end + + if attributes.key?(:'last_executed_at_string') + self.last_executed_at_string = attributes[:'last_executed_at_string'] + end + + if attributes.key?(:'last_executed_at_utc') + self.last_executed_at_utc = attributes[:'last_executed_at_utc'] + end + + if attributes.key?(:'last_published_at') + self.last_published_at = attributes[:'last_published_at'] + end + + if attributes.key?(:'last_published_at_string') + self.last_published_at_string = attributes[:'last_published_at_string'] + end + + if attributes.key?(:'last_published_at_utc') + self.last_published_at_utc = attributes[:'last_published_at_utc'] + end + + if attributes.key?(:'match_conditions') + self.match_conditions = attributes[:'match_conditions'] + end + + if attributes.key?(:'match_conditions_draft') + self.match_conditions_draft = attributes[:'match_conditions_draft'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'on') + self.on = attributes[:'on'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'trigger_conditions') + if (value = attributes[:'trigger_conditions']).is_a?(Hash) + self.trigger_conditions = value + end + end + + if attributes.key?(:'trigger_conditions_draft') + if (value = attributes[:'trigger_conditions_draft']).is_a?(Hash) + self.trigger_conditions_draft = value + end + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'updated_at_string') + self.updated_at_string = attributes[:'updated_at_string'] + end + + if attributes.key?(:'updated_at_utc') + self.updated_at_utc = attributes[:'updated_at_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + status_validator = EnumAttributeValidator.new('String', ["on", "off"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["on", "off"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + action_type_ids == o.action_type_ids && + actions_count == o.actions_count && + created_at == o.created_at && + created_at_string == o.created_at_string && + created_at_utc == o.created_at_utc && + description == o.description && + event_trigger == o.event_trigger && + event_trigger_draft == o.event_trigger_draft && + executions_count == o.executions_count && + has_draft == o.has_draft && + is_managed == o.is_managed && + key == o.key && + last_executed_at == o.last_executed_at && + last_executed_at_string == o.last_executed_at_string && + last_executed_at_utc == o.last_executed_at_utc && + last_published_at == o.last_published_at && + last_published_at_string == o.last_published_at_string && + last_published_at_utc == o.last_published_at_utc && + match_conditions == o.match_conditions && + match_conditions_draft == o.match_conditions_draft && + name == o.name && + object == o.object && + on == o.on && + status == o.status && + trigger_conditions == o.trigger_conditions && + trigger_conditions_draft == o.trigger_conditions_draft && + updated_at == o.updated_at && + updated_at_string == o.updated_at_string && + updated_at_utc == o.updated_at_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, action_type_ids, actions_count, created_at, created_at_string, created_at_utc, description, event_trigger, event_trigger_draft, executions_count, has_draft, is_managed, key, last_executed_at, last_executed_at_string, last_executed_at_utc, last_published_at, last_published_at_string, last_published_at_utc, match_conditions, match_conditions_draft, name, object, on, status, trigger_conditions, trigger_conditions_draft, updated_at, updated_at_string, updated_at_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/publish_workflow_request.rb b/lib/embed_workflow/models/publish_workflow_request.rb new file mode 100644 index 0000000..a0ba283 --- /dev/null +++ b/lib/embed_workflow/models/publish_workflow_request.rb @@ -0,0 +1,217 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class PublishWorkflowRequest + # User's key + attr_accessor :user_key + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_key' => :'user_key' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_key' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::PublishWorkflowRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::PublishWorkflowRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_key') + self.user_key = attributes[:'user_key'] + else + self.user_key = 'main' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_key == o.user_key + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_key].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/retrieve_account200_response.rb b/lib/embed_workflow/models/retrieve_account200_response.rb new file mode 100644 index 0000000..a063adc --- /dev/null +++ b/lib/embed_workflow/models/retrieve_account200_response.rb @@ -0,0 +1,371 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class RetrieveAccount200Response + # Available action type categories for the account + attr_accessor :action_type_categories + + # Whether action type categories are enabled for display + attr_accessor :action_type_categories_enabled + + # Company name associated with the account + attr_accessor :company_name + + # Custom domain for the account + attr_accessor :custom_domain + + # Additional account data + attr_accessor :data + + # Permission groups for the account + attr_accessor :groups + + # System-generated unique identifier + attr_accessor :id + + # Account level or tier + attr_accessor :level + + # Object type identifier + attr_accessor :object + + # Theme setting for the account + attr_accessor :theme + + # Time zone setting for the account in IANA timezone format (e.g. 'America/New_York', 'Europe/London', 'Asia/Tokyo', 'Etc/UTC') + attr_accessor :time_zone + + # User name from context + attr_accessor :user_name + + # Time zone setting for the user in IANA timezone format (e.g. 'America/New_York', 'Europe/London', 'Asia/Tokyo', 'Etc/UTC') + attr_accessor :user_time_zone + + # Account data schema + attr_accessor :data_schema + + # User data schema for the account + attr_accessor :user_data_schema + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'action_type_categories' => :'action_type_categories', + :'action_type_categories_enabled' => :'action_type_categories_enabled', + :'company_name' => :'company_name', + :'custom_domain' => :'custom_domain', + :'data' => :'data', + :'groups' => :'groups', + :'id' => :'id', + :'level' => :'level', + :'object' => :'object', + :'theme' => :'theme', + :'time_zone' => :'time_zone', + :'user_name' => :'user_name', + :'user_time_zone' => :'user_time_zone', + :'data_schema' => :'data_schema', + :'user_data_schema' => :'user_data_schema' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'action_type_categories' => :'Array', + :'action_type_categories_enabled' => :'Boolean', + :'company_name' => :'String', + :'custom_domain' => :'String', + :'data' => :'Hash', + :'groups' => :'Array', + :'id' => :'String', + :'level' => :'Integer', + :'object' => :'String', + :'theme' => :'String', + :'time_zone' => :'String', + :'user_name' => :'String', + :'user_time_zone' => :'String', + :'data_schema' => :'Array', + :'user_data_schema' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'company_name', + :'custom_domain', + :'theme', + :'time_zone', + :'user_name', + :'user_time_zone', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::RetrieveAccount200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::RetrieveAccount200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'action_type_categories') + if (value = attributes[:'action_type_categories']).is_a?(Array) + self.action_type_categories = value + end + end + + if attributes.key?(:'action_type_categories_enabled') + self.action_type_categories_enabled = attributes[:'action_type_categories_enabled'] + end + + if attributes.key?(:'company_name') + self.company_name = attributes[:'company_name'] + end + + if attributes.key?(:'custom_domain') + self.custom_domain = attributes[:'custom_domain'] + end + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Hash) + self.data = value + end + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'theme') + self.theme = attributes[:'theme'] + end + + if attributes.key?(:'time_zone') + self.time_zone = attributes[:'time_zone'] + end + + if attributes.key?(:'user_name') + self.user_name = attributes[:'user_name'] + end + + if attributes.key?(:'user_time_zone') + self.user_time_zone = attributes[:'user_time_zone'] + end + + if attributes.key?(:'data_schema') + if (value = attributes[:'data_schema']).is_a?(Array) + self.data_schema = value + end + end + + if attributes.key?(:'user_data_schema') + if (value = attributes[:'user_data_schema']).is_a?(Array) + self.user_data_schema = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action_type_categories == o.action_type_categories && + action_type_categories_enabled == o.action_type_categories_enabled && + company_name == o.company_name && + custom_domain == o.custom_domain && + data == o.data && + groups == o.groups && + id == o.id && + level == o.level && + object == o.object && + theme == o.theme && + time_zone == o.time_zone && + user_name == o.user_name && + user_time_zone == o.user_time_zone && + data_schema == o.data_schema && + user_data_schema == o.user_data_schema + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [action_type_categories, action_type_categories_enabled, company_name, custom_domain, data, groups, id, level, object, theme, time_zone, user_name, user_time_zone, data_schema, user_data_schema].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/retrieve_account_usage200_response.rb b/lib/embed_workflow/models/retrieve_account_usage200_response.rb new file mode 100644 index 0000000..a99336f --- /dev/null +++ b/lib/embed_workflow/models/retrieve_account_usage200_response.rb @@ -0,0 +1,275 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class RetrieveAccountUsage200Response + # Number of active workflows (on: true) + attr_accessor :active_workflows_count + + # End of the usage period (ISO 8601 format) + attr_accessor :end_time + + # Number of executions in the specified time period + attr_accessor :executions_count + + # Object type identifier + attr_accessor :object + + # Start of the usage period (ISO 8601 format) + attr_accessor :start_time + + # Total number of actions in the specified time period + attr_accessor :usage + + # Total number of users in the account + attr_accessor :users_count + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'active_workflows_count' => :'active_workflows_count', + :'end_time' => :'end_time', + :'executions_count' => :'executions_count', + :'object' => :'object', + :'start_time' => :'start_time', + :'usage' => :'usage', + :'users_count' => :'users_count' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'active_workflows_count' => :'Integer', + :'end_time' => :'String', + :'executions_count' => :'Integer', + :'object' => :'String', + :'start_time' => :'String', + :'usage' => :'Integer', + :'users_count' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::RetrieveAccountUsage200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::RetrieveAccountUsage200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'active_workflows_count') + self.active_workflows_count = attributes[:'active_workflows_count'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'executions_count') + self.executions_count = attributes[:'executions_count'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'usage') + self.usage = attributes[:'usage'] + end + + if attributes.key?(:'users_count') + self.users_count = attributes[:'users_count'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + active_workflows_count == o.active_workflows_count && + end_time == o.end_time && + executions_count == o.executions_count && + object == o.object && + start_time == o.start_time && + usage == o.usage && + users_count == o.users_count + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [active_workflows_count, end_time, executions_count, object, start_time, usage, users_count].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/retrieve_available_app200_response.rb b/lib/embed_workflow/models/retrieve_available_app200_response.rb new file mode 100644 index 0000000..a746f32 --- /dev/null +++ b/lib/embed_workflow/models/retrieve_available_app200_response.rb @@ -0,0 +1,299 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class RetrieveAvailableApp200Response + # Name of the app + attr_accessor :name + + # Unique identifier for the app + attr_accessor :app_identifier + + # Description of the available app + attr_accessor :description + + # Icon configuration for the available app + attr_accessor :icon + + # Latest available version of the app + attr_accessor :latest_version + + # Object type identifier + attr_accessor :object + + # Primary category classification for the app + attr_accessor :primary_category + + # App schema configuration + attr_accessor :schema + + # Secondary category classification for the app + attr_accessor :secondary_category + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'app_identifier' => :'app_identifier', + :'description' => :'description', + :'icon' => :'icon', + :'latest_version' => :'latest_version', + :'object' => :'object', + :'primary_category' => :'primary_category', + :'schema' => :'schema', + :'secondary_category' => :'secondary_category' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'app_identifier' => :'String', + :'description' => :'String', + :'icon' => :'Object', + :'latest_version' => :'String', + :'object' => :'String', + :'primary_category' => :'String', + :'schema' => :'Hash', + :'secondary_category' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'icon', + :'secondary_category' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::RetrieveAvailableApp200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::RetrieveAvailableApp200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'app_identifier') + self.app_identifier = attributes[:'app_identifier'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + + if attributes.key?(:'latest_version') + self.latest_version = attributes[:'latest_version'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'primary_category') + self.primary_category = attributes[:'primary_category'] + end + + if attributes.key?(:'schema') + if (value = attributes[:'schema']).is_a?(Hash) + self.schema = value + end + end + + if attributes.key?(:'secondary_category') + self.secondary_category = attributes[:'secondary_category'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + app_identifier == o.app_identifier && + description == o.description && + icon == o.icon && + latest_version == o.latest_version && + object == o.object && + primary_category == o.primary_category && + schema == o.schema && + secondary_category == o.secondary_category + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, app_identifier, description, icon, latest_version, object, primary_category, schema, secondary_category].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/retrieve_execution200_response.rb b/lib/embed_workflow/models/retrieve_execution200_response.rb new file mode 100644 index 0000000..0878b08 --- /dev/null +++ b/lib/embed_workflow/models/retrieve_execution200_response.rb @@ -0,0 +1,405 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class RetrieveExecution200Response + # System-generated unique identifier + attr_accessor :hashid + + # Total number of actions in the execution + attr_accessor :actions_count + + # Number of completed actions + attr_accessor :completed_actions_count + + # Created at in specified timezone + attr_accessor :created_at + + # Created at formatted as human-readable string + attr_accessor :created_at_string + + # Created at in UTC + attr_accessor :created_at_utc + + # Data context for the execution + attr_accessor :execution_data + + # Number of failed actions + attr_accessor :failed_actions_count + + # System-generated unique identifier + attr_accessor :id + + # Number of idle actions + attr_accessor :idle_actions_count + + # Unique key for the execution + attr_accessor :key + + # Execution log details + attr_accessor :log + + # Name of the execution + attr_accessor :name + + # Object type identifier + attr_accessor :object + + # Number of currently running actions + attr_accessor :running_actions_count + + # Execution statistics + attr_accessor :stats + + # Current status of the execution + attr_accessor :status + + # Number of stopped actions + attr_accessor :stopped_actions_count + + # Template layout for the execution + attr_accessor :template + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'hashid' => :'hashid', + :'actions_count' => :'actions_count', + :'completed_actions_count' => :'completed_actions_count', + :'created_at' => :'created_at', + :'created_at_string' => :'created_at_string', + :'created_at_utc' => :'created_at_utc', + :'execution_data' => :'execution_data', + :'failed_actions_count' => :'failed_actions_count', + :'id' => :'id', + :'idle_actions_count' => :'idle_actions_count', + :'key' => :'key', + :'log' => :'log', + :'name' => :'name', + :'object' => :'object', + :'running_actions_count' => :'running_actions_count', + :'stats' => :'stats', + :'status' => :'status', + :'stopped_actions_count' => :'stopped_actions_count', + :'template' => :'template' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'hashid' => :'String', + :'actions_count' => :'Integer', + :'completed_actions_count' => :'Integer', + :'created_at' => :'String', + :'created_at_string' => :'String', + :'created_at_utc' => :'String', + :'execution_data' => :'Hash', + :'failed_actions_count' => :'Integer', + :'id' => :'String', + :'idle_actions_count' => :'Integer', + :'key' => :'String', + :'log' => :'Object', + :'name' => :'String', + :'object' => :'String', + :'running_actions_count' => :'Integer', + :'stats' => :'Hash', + :'status' => :'String', + :'stopped_actions_count' => :'Integer', + :'template' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'actions_count', + :'created_at', + :'created_at_string', + :'created_at_utc', + :'execution_data', + :'log', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::RetrieveExecution200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::RetrieveExecution200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'hashid') + self.hashid = attributes[:'hashid'] + end + + if attributes.key?(:'actions_count') + self.actions_count = attributes[:'actions_count'] + end + + if attributes.key?(:'completed_actions_count') + self.completed_actions_count = attributes[:'completed_actions_count'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_at_string') + self.created_at_string = attributes[:'created_at_string'] + end + + if attributes.key?(:'created_at_utc') + self.created_at_utc = attributes[:'created_at_utc'] + end + + if attributes.key?(:'execution_data') + if (value = attributes[:'execution_data']).is_a?(Hash) + self.execution_data = value + end + end + + if attributes.key?(:'failed_actions_count') + self.failed_actions_count = attributes[:'failed_actions_count'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'idle_actions_count') + self.idle_actions_count = attributes[:'idle_actions_count'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'log') + self.log = attributes[:'log'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'object') + self.object = attributes[:'object'] + end + + if attributes.key?(:'running_actions_count') + self.running_actions_count = attributes[:'running_actions_count'] + end + + if attributes.key?(:'stats') + if (value = attributes[:'stats']).is_a?(Hash) + self.stats = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'stopped_actions_count') + self.stopped_actions_count = attributes[:'stopped_actions_count'] + end + + if attributes.key?(:'template') + self.template = attributes[:'template'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + hashid == o.hashid && + actions_count == o.actions_count && + completed_actions_count == o.completed_actions_count && + created_at == o.created_at && + created_at_string == o.created_at_string && + created_at_utc == o.created_at_utc && + execution_data == o.execution_data && + failed_actions_count == o.failed_actions_count && + id == o.id && + idle_actions_count == o.idle_actions_count && + key == o.key && + log == o.log && + name == o.name && + object == o.object && + running_actions_count == o.running_actions_count && + stats == o.stats && + status == o.status && + stopped_actions_count == o.stopped_actions_count && + template == o.template + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [hashid, actions_count, completed_actions_count, created_at, created_at_string, created_at_utc, execution_data, failed_actions_count, id, idle_actions_count, key, log, name, object, running_actions_count, stats, status, stopped_actions_count, template].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/retry_action_request.rb b/lib/embed_workflow/models/retry_action_request.rb new file mode 100644 index 0000000..fbffe59 --- /dev/null +++ b/lib/embed_workflow/models/retry_action_request.rb @@ -0,0 +1,239 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class RetryActionRequest + # User's key + attr_accessor :user_key + + # The trigger's hook id used for third party webhooks. + attr_accessor :hook_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_key' => :'user_key', + :'hook_id' => :'hook_id' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_key' => :'String', + :'hook_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::RetryActionRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::RetryActionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_key') + self.user_key = attributes[:'user_key'] + else + self.user_key = 'main' + end + + if attributes.key?(:'hook_id') + self.hook_id = attributes[:'hook_id'] + else + self.hook_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_key.nil? + invalid_properties.push('invalid value for "user_key", user_key cannot be nil.') + end + + if @hook_id.nil? + invalid_properties.push('invalid value for "hook_id", hook_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_key.nil? + return false if @hook_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_key == o.user_key && + hook_id == o.hook_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_key, hook_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/stop_executions_request.rb b/lib/embed_workflow/models/stop_executions_request.rb new file mode 100644 index 0000000..81fde28 --- /dev/null +++ b/lib/embed_workflow/models/stop_executions_request.rb @@ -0,0 +1,232 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class StopExecutionsRequest + # User's key + attr_accessor :user_key + + # Data to filter + attr_accessor :filters + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_key' => :'user_key', + :'filters' => :'filters' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_key' => :'String', + :'filters' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::StopExecutionsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::StopExecutionsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_key') + self.user_key = attributes[:'user_key'] + else + self.user_key = 'main' + end + + if attributes.key?(:'filters') + self.filters = attributes[:'filters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_key.nil? + invalid_properties.push('invalid value for "user_key", user_key cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_key.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_key == o.user_key && + filters == o.filters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_key, filters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/trigger_workflow_request.rb b/lib/embed_workflow/models/trigger_workflow_request.rb new file mode 100644 index 0000000..dfb46fb --- /dev/null +++ b/lib/embed_workflow/models/trigger_workflow_request.rb @@ -0,0 +1,263 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class TriggerWorkflowRequest + # User's key + attr_accessor :user_key + + # Data required to execute the workflow. Key-value pairs that provide context and variables needed during workflow execution. + attr_accessor :execution_data + + # The trigger's key + attr_accessor :event + + # Array of workflow ids. + attr_accessor :workflow_ids + + # Array of workflow keys. + attr_accessor :workflow_keys + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_key' => :'user_key', + :'execution_data' => :'execution_data', + :'event' => :'event', + :'workflow_ids' => :'workflow_ids', + :'workflow_keys' => :'workflow_keys' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_key' => :'String', + :'execution_data' => :'Hash', + :'event' => :'String', + :'workflow_ids' => :'Array', + :'workflow_keys' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::TriggerWorkflowRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::TriggerWorkflowRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_key') + self.user_key = attributes[:'user_key'] + else + self.user_key = 'main' + end + + if attributes.key?(:'execution_data') + if (value = attributes[:'execution_data']).is_a?(Hash) + self.execution_data = value + end + end + + if attributes.key?(:'event') + self.event = attributes[:'event'] + end + + if attributes.key?(:'workflow_ids') + if (value = attributes[:'workflow_ids']).is_a?(Array) + self.workflow_ids = value + end + end + + if attributes.key?(:'workflow_keys') + if (value = attributes[:'workflow_keys']).is_a?(Array) + self.workflow_keys = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_key == o.user_key && + execution_data == o.execution_data && + event == o.event && + workflow_ids == o.workflow_ids && + workflow_keys == o.workflow_keys + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_key, execution_data, event, workflow_ids, workflow_keys].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/update_account_request.rb b/lib/embed_workflow/models/update_account_request.rb new file mode 100644 index 0000000..1694d64 --- /dev/null +++ b/lib/embed_workflow/models/update_account_request.rb @@ -0,0 +1,327 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class UpdateAccountRequest + # Company name associated with the account + attr_accessor :company_name + + # User name for the account + attr_accessor :user_name + + # Theme setting for the account + attr_accessor :theme + + # Time zone setting for the account + attr_accessor :time_zone + + # Custom domain for the account + attr_accessor :custom_domain + + # User permission groups. Only available to users with admin role. + attr_accessor :groups + + # Enable or disable action type categories display + attr_accessor :action_type_categories_enabled + + # Action type categories for the account. + attr_accessor :action_type_categories + + # Additional account data + attr_accessor :data + + # Data schema configuration + attr_accessor :user_data_schema + + # Data schema configuration + attr_accessor :data_schema + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'company_name' => :'company_name', + :'user_name' => :'user_name', + :'theme' => :'theme', + :'time_zone' => :'time_zone', + :'custom_domain' => :'custom_domain', + :'groups' => :'groups', + :'action_type_categories_enabled' => :'action_type_categories_enabled', + :'action_type_categories' => :'action_type_categories', + :'data' => :'data', + :'user_data_schema' => :'user_data_schema', + :'data_schema' => :'data_schema' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'company_name' => :'String', + :'user_name' => :'String', + :'theme' => :'String', + :'time_zone' => :'String', + :'custom_domain' => :'String', + :'groups' => :'Array', + :'action_type_categories_enabled' => :'Boolean', + :'action_type_categories' => :'Array', + :'data' => :'Hash', + :'user_data_schema' => :'Array', + :'data_schema' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::UpdateAccountRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::UpdateAccountRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'company_name') + self.company_name = attributes[:'company_name'] + end + + if attributes.key?(:'user_name') + self.user_name = attributes[:'user_name'] + end + + if attributes.key?(:'theme') + self.theme = attributes[:'theme'] + end + + if attributes.key?(:'time_zone') + self.time_zone = attributes[:'time_zone'] + end + + if attributes.key?(:'custom_domain') + self.custom_domain = attributes[:'custom_domain'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'action_type_categories_enabled') + self.action_type_categories_enabled = attributes[:'action_type_categories_enabled'] + else + self.action_type_categories_enabled = false + end + + if attributes.key?(:'action_type_categories') + if (value = attributes[:'action_type_categories']).is_a?(Array) + self.action_type_categories = value + end + end + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Hash) + self.data = value + end + end + + if attributes.key?(:'user_data_schema') + if (value = attributes[:'user_data_schema']).is_a?(Array) + self.user_data_schema = value + end + end + + if attributes.key?(:'data_schema') + if (value = attributes[:'data_schema']).is_a?(Array) + self.data_schema = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + company_name == o.company_name && + user_name == o.user_name && + theme == o.theme && + time_zone == o.time_zone && + custom_domain == o.custom_domain && + groups == o.groups && + action_type_categories_enabled == o.action_type_categories_enabled && + action_type_categories == o.action_type_categories && + data == o.data && + user_data_schema == o.user_data_schema && + data_schema == o.data_schema + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [company_name, user_name, theme, time_zone, custom_domain, groups, action_type_categories_enabled, action_type_categories, data, user_data_schema, data_schema].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/update_account_request_action_type_categories_inner.rb b/lib/embed_workflow/models/update_account_request_action_type_categories_inner.rb new file mode 100644 index 0000000..d7da8f6 --- /dev/null +++ b/lib/embed_workflow/models/update_account_request_action_type_categories_inner.rb @@ -0,0 +1,258 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class UpdateAccountRequestActionTypeCategoriesInner + # Immutable category identifier + attr_accessor :key + + # Display name (user-editable) + attr_accessor :name + + # Short description (user-editable) + attr_accessor :description + + attr_accessor :icon + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'key' => :'key', + :'name' => :'name', + :'description' => :'description', + :'icon' => :'icon' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'key' => :'String', + :'name' => :'String', + :'description' => :'String', + :'icon' => :'UpdateAccountRequestActionTypeCategoriesInnerIcon' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'key') + self.key = attributes[:'key'] + else + self.key = nil + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @key.nil? + invalid_properties.push('invalid value for "key", key cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @key.nil? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key == o.key && + name == o.name && + description == o.description && + icon == o.icon + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [key, name, description, icon].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/update_account_request_action_type_categories_inner_icon.rb b/lib/embed_workflow/models/update_account_request_action_type_categories_inner_icon.rb new file mode 100644 index 0000000..94a1966 --- /dev/null +++ b/lib/embed_workflow/models/update_account_request_action_type_categories_inner_icon.rb @@ -0,0 +1,233 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + # Icon configuration (user-editable) + class UpdateAccountRequestActionTypeCategoriesInnerIcon + attr_accessor :type + + attr_accessor :background_color + + attr_accessor :url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'background_color' => :'background_color', + :'url' => :'url' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'background_color' => :'String', + :'url' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInnerIcon` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInnerIcon`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'background_color') + self.background_color = attributes[:'background_color'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + background_color == o.background_color && + url == o.url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, background_color, url].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/update_account_request_user_data_schema_inner.rb b/lib/embed_workflow/models/update_account_request_user_data_schema_inner.rb new file mode 100644 index 0000000..7da8913 --- /dev/null +++ b/lib/embed_workflow/models/update_account_request_user_data_schema_inner.rb @@ -0,0 +1,271 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class UpdateAccountRequestUserDataSchemaInner + # Variable name for the data field + attr_accessor :variable + + # Path to the data within the structure + attr_accessor :data_path + + # Data type identifier + attr_accessor :type + + # Whether this field is required + attr_accessor :required + + # Permission groups for this data field + attr_accessor :groups + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'variable' => :'variable', + :'data_path' => :'data_path', + :'type' => :'type', + :'required' => :'required', + :'groups' => :'groups' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'variable' => :'String', + :'data_path' => :'String', + :'type' => :'String', + :'required' => :'Boolean', + :'groups' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::UpdateAccountRequestUserDataSchemaInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::UpdateAccountRequestUserDataSchemaInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'variable') + self.variable = attributes[:'variable'] + else + self.variable = nil + end + + if attributes.key?(:'data_path') + self.data_path = attributes[:'data_path'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'required') + self.required = attributes[:'required'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @variable.nil? + invalid_properties.push('invalid value for "variable", variable cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @variable.nil? + return false if @type.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + variable == o.variable && + data_path == o.data_path && + type == o.type && + required == o.required && + groups == o.groups + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [variable, data_path, type, required, groups].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/update_action_type_request.rb b/lib/embed_workflow/models/update_action_type_request.rb new file mode 100644 index 0000000..a8197e4 --- /dev/null +++ b/lib/embed_workflow/models/update_action_type_request.rb @@ -0,0 +1,384 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class UpdateActionTypeRequest + # Name of resource + attr_accessor :name + + # Description of action type + attr_accessor :description + + # Enable or disable the resource. + attr_accessor :on + + # HTTP parameters as key:value pairs, one per line + attr_accessor :params_draft + + # HTTP headers as key:value pairs, one per line + attr_accessor :headers_draft + + # HTTP url + attr_accessor :url_draft + + # HTTP method + attr_accessor :http_method_draft + + # JavaScript code snippt + attr_accessor :code_draft + + # Form field configuration + attr_accessor :form_draft + + # Data schema configuration + attr_accessor :response_data_schema_draft + + # User permission groups. Only available to users with admin role. + attr_accessor :groups + + attr_accessor :icon_draft + + # Primary category for the action type + attr_accessor :primary_category + + # Secondary category for the action type + attr_accessor :secondary_category + + # When true, actions fire the webhook but wait for an external callback before completing + attr_accessor :wait_for_callback + + # Callback timeout duration value + attr_accessor :callback_timeout_n + + # Callback timeout duration unit (sec, min, hour, day, week, month, year) + attr_accessor :callback_timeout_unit + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'description' => :'description', + :'on' => :'on', + :'params_draft' => :'params_draft', + :'headers_draft' => :'headers_draft', + :'url_draft' => :'url_draft', + :'http_method_draft' => :'http_method_draft', + :'code_draft' => :'code_draft', + :'form_draft' => :'form_draft', + :'response_data_schema_draft' => :'response_data_schema_draft', + :'groups' => :'groups', + :'icon_draft' => :'icon_draft', + :'primary_category' => :'primary_category', + :'secondary_category' => :'secondary_category', + :'wait_for_callback' => :'wait_for_callback', + :'callback_timeout_n' => :'callback_timeout_n', + :'callback_timeout_unit' => :'callback_timeout_unit' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'description' => :'String', + :'on' => :'Boolean', + :'params_draft' => :'String', + :'headers_draft' => :'String', + :'url_draft' => :'String', + :'http_method_draft' => :'String', + :'code_draft' => :'String', + :'form_draft' => :'Array', + :'response_data_schema_draft' => :'Array', + :'groups' => :'Array', + :'icon_draft' => :'CreateActionTypeRequestIconDraft', + :'primary_category' => :'String', + :'secondary_category' => :'String', + :'wait_for_callback' => :'Boolean', + :'callback_timeout_n' => :'Integer', + :'callback_timeout_unit' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::UpdateActionTypeRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::UpdateActionTypeRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'on') + self.on = attributes[:'on'] + else + self.on = true + end + + if attributes.key?(:'params_draft') + self.params_draft = attributes[:'params_draft'] + end + + if attributes.key?(:'headers_draft') + self.headers_draft = attributes[:'headers_draft'] + end + + if attributes.key?(:'url_draft') + self.url_draft = attributes[:'url_draft'] + end + + if attributes.key?(:'http_method_draft') + self.http_method_draft = attributes[:'http_method_draft'] + end + + if attributes.key?(:'code_draft') + self.code_draft = attributes[:'code_draft'] + end + + if attributes.key?(:'form_draft') + if (value = attributes[:'form_draft']).is_a?(Array) + self.form_draft = value + end + end + + if attributes.key?(:'response_data_schema_draft') + if (value = attributes[:'response_data_schema_draft']).is_a?(Array) + self.response_data_schema_draft = value + end + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'icon_draft') + self.icon_draft = attributes[:'icon_draft'] + end + + if attributes.key?(:'primary_category') + self.primary_category = attributes[:'primary_category'] + end + + if attributes.key?(:'secondary_category') + self.secondary_category = attributes[:'secondary_category'] + end + + if attributes.key?(:'wait_for_callback') + self.wait_for_callback = attributes[:'wait_for_callback'] + else + self.wait_for_callback = false + end + + if attributes.key?(:'callback_timeout_n') + self.callback_timeout_n = attributes[:'callback_timeout_n'] + end + + if attributes.key?(:'callback_timeout_unit') + self.callback_timeout_unit = attributes[:'callback_timeout_unit'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + description == o.description && + on == o.on && + params_draft == o.params_draft && + headers_draft == o.headers_draft && + url_draft == o.url_draft && + http_method_draft == o.http_method_draft && + code_draft == o.code_draft && + form_draft == o.form_draft && + response_data_schema_draft == o.response_data_schema_draft && + groups == o.groups && + icon_draft == o.icon_draft && + primary_category == o.primary_category && + secondary_category == o.secondary_category && + wait_for_callback == o.wait_for_callback && + callback_timeout_n == o.callback_timeout_n && + callback_timeout_unit == o.callback_timeout_unit + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, description, on, params_draft, headers_draft, url_draft, http_method_draft, code_draft, form_draft, response_data_schema_draft, groups, icon_draft, primary_category, secondary_category, wait_for_callback, callback_timeout_n, callback_timeout_unit].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/update_installed_app_request.rb b/lib/embed_workflow/models/update_installed_app_request.rb new file mode 100644 index 0000000..ff9f5c6 --- /dev/null +++ b/lib/embed_workflow/models/update_installed_app_request.rb @@ -0,0 +1,217 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class UpdateInstalledAppRequest + # User permission groups. Only available to users with admin role. + attr_accessor :groups + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'groups' => :'groups' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'groups' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::UpdateInstalledAppRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::UpdateInstalledAppRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + groups == o.groups + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [groups].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/update_trigger_request.rb b/lib/embed_workflow/models/update_trigger_request.rb new file mode 100644 index 0000000..e8011de --- /dev/null +++ b/lib/embed_workflow/models/update_trigger_request.rb @@ -0,0 +1,225 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class UpdateTriggerRequest + # The trigger's key + attr_accessor :event + + # Title + attr_accessor :title + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event' => :'event', + :'title' => :'title' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event' => :'String', + :'title' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::UpdateTriggerRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::UpdateTriggerRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event') + self.event = attributes[:'event'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event == o.event && + title == o.title + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event, title].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/update_workflow_request.rb b/lib/embed_workflow/models/update_workflow_request.rb new file mode 100644 index 0000000..7a4f367 --- /dev/null +++ b/lib/embed_workflow/models/update_workflow_request.rb @@ -0,0 +1,329 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class UpdateWorkflowRequest + # Name of resource + attr_accessor :name + + # Client-provided unique identifier + attr_accessor :key + + # Mark workflow as default template. When true, new users will automatically receive a clone of this workflow (Admin only) + attr_accessor :auto_clone_for_new_users + + # Mark workflow as a template. When true, new users will see this in a library of templates (Admin only) + attr_accessor :is_template + + # Enable or disable the resource. + attr_accessor :on + + # Description of the resource + attr_accessor :details + + attr_accessor :template_draft + + # The trigger's conditions + attr_accessor :trigger_conditions_draft + + # The trigger's key + attr_accessor :event_trigger_draft + + # Whether all or any of the trigger conditions must match + attr_accessor :match_conditions_draft + + # User permission groups. Only available to users with admin role. + attr_accessor :groups + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'key' => :'key', + :'auto_clone_for_new_users' => :'auto_clone_for_new_users', + :'is_template' => :'is_template', + :'on' => :'on', + :'details' => :'details', + :'template_draft' => :'template_draft', + :'trigger_conditions_draft' => :'trigger_conditions_draft', + :'event_trigger_draft' => :'event_trigger_draft', + :'match_conditions_draft' => :'match_conditions_draft', + :'groups' => :'groups' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'key' => :'String', + :'auto_clone_for_new_users' => :'Boolean', + :'is_template' => :'Boolean', + :'on' => :'Boolean', + :'details' => :'String', + :'template_draft' => :'CreateWorkflowRequestTemplateDraft', + :'trigger_conditions_draft' => :'Object', + :'event_trigger_draft' => :'String', + :'match_conditions_draft' => :'String', + :'groups' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::UpdateWorkflowRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::UpdateWorkflowRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'auto_clone_for_new_users') + self.auto_clone_for_new_users = attributes[:'auto_clone_for_new_users'] + else + self.auto_clone_for_new_users = false + end + + if attributes.key?(:'is_template') + self.is_template = attributes[:'is_template'] + else + self.is_template = false + end + + if attributes.key?(:'on') + self.on = attributes[:'on'] + else + self.on = true + end + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'template_draft') + self.template_draft = attributes[:'template_draft'] + end + + if attributes.key?(:'trigger_conditions_draft') + self.trigger_conditions_draft = attributes[:'trigger_conditions_draft'] + end + + if attributes.key?(:'event_trigger_draft') + self.event_trigger_draft = attributes[:'event_trigger_draft'] + end + + if attributes.key?(:'match_conditions_draft') + self.match_conditions_draft = attributes[:'match_conditions_draft'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + key == o.key && + auto_clone_for_new_users == o.auto_clone_for_new_users && + is_template == o.is_template && + on == o.on && + details == o.details && + template_draft == o.template_draft && + trigger_conditions_draft == o.trigger_conditions_draft && + event_trigger_draft == o.event_trigger_draft && + match_conditions_draft == o.match_conditions_draft && + groups == o.groups + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, key, auto_clone_for_new_users, is_template, on, details, template_draft, trigger_conditions_draft, event_trigger_draft, match_conditions_draft, groups].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/models/upsert_user_request.rb b/lib/embed_workflow/models/upsert_user_request.rb new file mode 100644 index 0000000..0604d14 --- /dev/null +++ b/lib/embed_workflow/models/upsert_user_request.rb @@ -0,0 +1,259 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'date' +require 'time' + +module EmbedWorkflow + class UpsertUserRequest + # Name of resource + attr_accessor :name + + # Email address + attr_accessor :email + + # Additional user data + attr_accessor :data + + # User permission groups. Only available to users with admin role. + attr_accessor :groups + + # Time zone + attr_accessor :time_zone + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'email' => :'email', + :'data' => :'data', + :'groups' => :'groups', + :'time_zone' => :'time_zone' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'email' => :'String', + :'data' => :'Hash', + :'groups' => :'Array', + :'time_zone' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `EmbedWorkflow::UpsertUserRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `EmbedWorkflow::UpsertUserRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Hash) + self.data = value + end + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'time_zone') + self.time_zone = attributes[:'time_zone'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + email == o.email && + data == o.data && + groups == o.groups && + time_zone == o.time_zone + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, email, data, groups, time_zone].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = EmbedWorkflow.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/embed_workflow/trigger.rb b/lib/embed_workflow/trigger.rb deleted file mode 100644 index 1f6b6ea..0000000 --- a/lib/embed_workflow/trigger.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -require "net/http" -require "uri" - -module EmbedWorkflow - module Trigger - class << self - include Base - include Client - - RESOURCE_BASE_PATH = "#{BASE_API_PATH}/trigger".freeze - - def create(event:, all_workflows: false, workflow_hashids: nil, workflow_keys: nil, user_key: nil, execution_data: nil) - attrs = { - event: event, - all_workflows: all_workflows, - workflow_hashids: workflow_hashids, - workflow_keys: workflow_keys, - user_key: user_key, - execution_data: execution_data - }.compact - - post_request( - path: RESOURCE_BASE_PATH, - body: attrs - ) - end - end - end -end diff --git a/lib/embed_workflow/users.rb b/lib/embed_workflow/users.rb deleted file mode 100644 index d81c67c..0000000 --- a/lib/embed_workflow/users.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require "net/http" -require "uri" - -module EmbedWorkflow - module Users - class << self - include Base - include Client - - RESOURCE_BASE_PATH = "#{BASE_API_PATH}/users".freeze - - def upsert(key:, name: UNSET, email: UNSET, data: UNSET, groups: UNSET, time_zone: UNSET) - attrs = prepare_params({ - key: key, - name: name, - email: email, - data: data, - groups: groups, - time_zone: time_zone - }) - - put_request( - path: "#{RESOURCE_BASE_PATH}/#{key}", - body: attrs - ) - end - - def fetch(key:) - get_request(path: "#{RESOURCE_BASE_PATH}/#{key}") - end - - def list(starting_after: nil, ending_before: nil, limit: nil) - params = { - starting_after: starting_after, - ending_before: ending_before, - limit: limit - }.compact - - get_request( - path: RESOURCE_BASE_PATH, - params: params - ) - end - - def delete(key:) - delete_request(path: "#{RESOURCE_BASE_PATH}/#{key}") - end - end - end -end diff --git a/lib/embed_workflow/version.rb b/lib/embed_workflow/version.rb index 898ddec..c8791d2 100644 --- a/lib/embed_workflow/version.rb +++ b/lib/embed_workflow/version.rb @@ -1,5 +1,15 @@ -# frozen_string_literal: true +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end module EmbedWorkflow - VERSION = "0.3.0" + VERSION = '1.2.0' end diff --git a/lib/embed_workflow/workflows.rb b/lib/embed_workflow/workflows.rb deleted file mode 100644 index c690beb..0000000 --- a/lib/embed_workflow/workflows.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -require "net/http" -require "uri" - -module EmbedWorkflow - module Workflows - class << self - include Base - include Client - - RESOURCE_BASE_PATH = "#{BASE_API_PATH}/workflows" - - def create(name:, template: nil, user_key: nil, event_trigger: nil, trigger_conditions: nil) - attrs = { - name: name, - template: template, - event_trigger: event_trigger, - trigger_conditions: trigger_conditions, - user_key: user_key - } - - post_request( - path: RESOURCE_BASE_PATH, - body: attrs - ) - end - - def fetch(hashid: nil, key: nil) - get_request( - path: "#{RESOURCE_BASE_PATH}/#{hashid}" - ) - end - - def update(hashid:, name: nil, template: nil, user_key: nil) - attrs = { - name: name, - template: template, - user_key: user_key - }.compact - - put_request( - path: "#{RESOURCE_BASE_PATH}/#{hashid}", - body: attrs - ) - end - - def list(user_key: nil, starting_after: nil, ending_before: nil, limit: nil) - params = { - user_key: user_key, - starting_after: starting_after, - ending_before: ending_before, - limit: limit - }.compact - - get_request( - path: RESOURCE_BASE_PATH, - params: params - ) - end - - def execute(hashid: nil, key: nil, user_key: nil, execution_data: {}) - raise ArgumentError, "Hashid or Key is required" if hashid.nil? && key.nil? - - attrs = { - user_key: user_key, - id_type: hashid.nil? ? "key" : "hashid", - execution_data: execution_data, - }.compact - - post_request( - path: "#{RESOURCE_BASE_PATH}/#{hashid || key}/execute", - body: attrs - ) - end - - def clone(hashid:, user_key: nil) - attrs = { user_key: user_key }.compact - - post_request( - path: "#{RESOURCE_BASE_PATH}/#{hashid}/clone", - body: attrs - ) - end - - def activities(hashid:) - get_request( - path: "#{RESOURCE_BASE_PATH}/#{hashid}/activities" - ) - end - - def delete(hashid: nil, key: nil, user_key: nil) - raise ArgumentError, "Hashid or Key is required" if hashid.nil? && key.nil? - - attrs = { - user_key: user_key, - id_type: hashid.nil? ? "key" : "hashid" - }.compact - - delete_request( - path: "#{RESOURCE_BASE_PATH}/#{hashid || key}", - params: attrs - ) - end - end - end -end diff --git a/spec/.DS_Store b/spec/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a0c3517b4a5bf89f76d43c54ee87179ade4c624b GIT binary patch literal 6148 zcmeHKOHRWu5S?iwREbR&ELb65p%QyS6;99#KnZG*5+xF1p98=JxDZ!h*(0!G%^S~@ z#t>K{RAwam+4HmWq}U!J;`x0!BbpM?1Wk}-Fd(8HG>yzzj4U~3i|eLt2U7f9mF#^? zSJcvNwd(Kx>11cAo1$1&%@Uf)(c|WH_4a(;x0XLx+jT$dE5hi2YHFyY8>;9oS#?xC ze75)3K3l(R*G_WO&29(Z`6T9s z6U+@e#dvg}izNUsgE|VvQcFloFw6}*MOYxLp+F5~D=}EZp%3Pl8+M8sPHe>o+sfPG zh2!eTAEG;PuIRlp;0&Y;jCDGd`~L#J%wUn9hWN}Ga0d2_0nUm=F~>*Q-TLM8] :sections + # @return [ExportConfiguration200Response] + describe 'export_configuration test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for import_configuration + # Import configuration + # @param [Hash] opts the optional parameters + # @option opts [ImportConfigurationRequest] :import_configuration_request + # @return [ImportConfiguration201Response] + describe 'import_configuration test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for retrieve_account + # Retrieve account + # @param [Hash] opts the optional parameters + # @return [RetrieveAccount200Response] + describe 'retrieve_account test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for retrieve_account_usage + # Retrieve account usage + # @param [Hash] opts the optional parameters + # @option opts [Time] :start_time + # @option opts [Time] :end_time + # @option opts [String] :user_key User key to filter usage for a specific user + # @return [RetrieveAccountUsage200Response] + describe 'retrieve_account_usage test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for update_account + # Update account + # @param [Hash] opts the optional parameters + # @option opts [UpdateAccountRequest] :update_account_request + # @return [RetrieveAccount200Response] + describe 'update_account test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/action_types_api_spec.rb b/spec/api/action_types_api_spec.rb new file mode 100644 index 0000000..d288169 --- /dev/null +++ b/spec/api/action_types_api_spec.rb @@ -0,0 +1,116 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::ActionTypesApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ActionTypesApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::ActionTypesApi.new + end + + after do + # run after each test + end + + describe 'test an instance of ActionTypesApi' do + it 'should create an instance of ActionTypesApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::ActionTypesApi) + end + end + + # unit tests for create_action_type + # Create action type + # @param [Hash] opts the optional parameters + # @option opts [CreateActionTypeRequest] :create_action_type_request + # @return [ListActionTypes200ResponseCollectionInner] + describe 'create_action_type test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for delete_action_type + # Delete action type + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [DeleteActionType200Response] + describe 'delete_action_type test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for discard_action_type_draft + # Discard action type draft + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [ListActionTypes200ResponseCollectionInner] + describe 'discard_action_type_draft test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_action_types + # List action types + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :category Filter by category (matches primary or secondary) + # @return [ListActionTypes200Response] + describe 'list_action_types test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for publish_action_type + # Publish action type + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [ListActionTypes200ResponseCollectionInner] + describe 'publish_action_type test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for retrieve_action_type + # Retrieve action type + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [ListActionTypes200ResponseCollectionInner] + describe 'retrieve_action_type test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for update_action_type + # Update action type + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [UpdateActionTypeRequest] :update_action_type_request + # @return [ListActionTypes200ResponseCollectionInner] + describe 'update_action_type test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/actions_api_spec.rb b/spec/api/actions_api_spec.rb new file mode 100644 index 0000000..5c7c5dd --- /dev/null +++ b/spec/api/actions_api_spec.rb @@ -0,0 +1,125 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::ActionsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ActionsApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::ActionsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of ActionsApi' do + it 'should create an instance of ActionsApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::ActionsApi) + end + end + + # unit tests for list_actions + # List actions + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :status Filter results by status + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [ListActions200Response] + describe 'list_actions test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_completed_actions + # List completed actions + # @param status Filter results by status + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [ListActions200Response] + describe 'list_completed_actions test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_failed_actions + # List failed actions + # @param status Filter results by status + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [ListActions200Response] + describe 'list_failed_actions test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_scheduled_actions + # List scheduled actions + # @param status Filter results by status + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :execution_id Filter results by execution id + # @option opts [String] :workflow_id Filter results by workflow id + # @return [ListActions200Response] + describe 'list_scheduled_actions test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_workflow_actions + # List workflow actions + # @param workflow_id Filter results by workflow id + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [ListActions200Response] + describe 'list_workflow_actions test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for retry_action + # Retry action + # @param hashid Action's hashid + # @param [Hash] opts the optional parameters + # @option opts [RetryActionRequest] :retry_action_request + # @return [Object] + describe 'retry_action test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/app_connections_api_spec.rb b/spec/api/app_connections_api_spec.rb new file mode 100644 index 0000000..fed6729 --- /dev/null +++ b/spec/api/app_connections_api_spec.rb @@ -0,0 +1,97 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::AppConnectionsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AppConnectionsApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::AppConnectionsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of AppConnectionsApi' do + it 'should create an instance of AppConnectionsApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::AppConnectionsApi) + end + end + + # unit tests for create_app_connection + # Create app connection + # @param [Hash] opts the optional parameters + # @option opts [CreateAppConnectionRequest] :create_app_connection_request + # @return [ListAppConnections200ResponseCollectionInner] + describe 'create_app_connection test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for delete_app_connection + # Delete app connection + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key Unique user identifier + # @return [DeleteActionType200Response] + describe 'delete_app_connection test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_app_connections + # List app connections + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :user_key Unique user identifier + # @option opts [String] :app_type Filter results by app type + # @return [ListAppConnections200Response] + describe 'list_app_connections test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for retrieve_app_connection + # Retrieve app connection + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key Unique user identifier + # @return [ListAppConnections200ResponseCollectionInner] + describe 'retrieve_app_connection test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for update_app_connection + # Update app connection + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [CreateAppConnectionRequest] :create_app_connection_request + # @return [ListAppConnections200ResponseCollectionInner] + describe 'update_app_connection test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/available_apps_api_spec.rb b/spec/api/available_apps_api_spec.rb new file mode 100644 index 0000000..d5e29d2 --- /dev/null +++ b/spec/api/available_apps_api_spec.rb @@ -0,0 +1,57 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::AvailableAppsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AvailableAppsApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::AvailableAppsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of AvailableAppsApi' do + it 'should create an instance of AvailableAppsApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::AvailableAppsApi) + end + end + + # unit tests for list_available_apps + # List available apps + # @param [Hash] opts the optional parameters + # @option opts [String] :exclude_installed Exclude already installed apps + # @return [ListAvailableApps200Response] + describe 'list_available_apps test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for retrieve_available_app + # Retrieve available app + # @param app_identifier App indentifier + # @param [Hash] opts the optional parameters + # @return [RetrieveAvailableApp200Response] + describe 'retrieve_available_app test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/data_fields_api_spec.rb b/spec/api/data_fields_api_spec.rb new file mode 100644 index 0000000..398f0bc --- /dev/null +++ b/spec/api/data_fields_api_spec.rb @@ -0,0 +1,76 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::DataFieldsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'DataFieldsApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::DataFieldsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of DataFieldsApi' do + it 'should create an instance of DataFieldsApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::DataFieldsApi) + end + end + + # unit tests for evaluate_expression + # Evaluate expression + # @param [Hash] opts the optional parameters + # @option opts [EvaluateExpressionRequest] :evaluate_expression_request + # @return [EvaluateExpression200Response] + describe 'evaluate_expression test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_data_fields + # List data fields + # @param [Hash] opts the optional parameters + # @option opts [String] :user_key Filter results by user key + # @option opts [String] :event_trigger Filter results by event trigger + # @option opts [ListDataFieldsTypeParameter] :type Data type filter - can be a single type or multiple types + # @return [ListDataFields200Response] + describe 'list_data_fields test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_workflow_data_fields + # List workflow data fields + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :node_id Node ID to determine current workflow position + # @option opts [String] :parent_node_id Parent node ID to determine workflow position + # @option opts [String] :user_key User context for determining available data fields + # @option opts [String] :event_trigger Event trigger context for determining available data fields + # @option opts [String] :action_event_trigger Action's event trigger context for determining available data fields + # @option opts [ListDataFieldsTypeParameter] :type Data type filter - can be a single type or multiple types + # @return [ListDataFields200Response] + describe 'list_workflow_data_fields test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/events_api_spec.rb b/spec/api/events_api_spec.rb new file mode 100644 index 0000000..4d48891 --- /dev/null +++ b/spec/api/events_api_spec.rb @@ -0,0 +1,48 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::EventsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EventsApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::EventsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of EventsApi' do + it 'should create an instance of EventsApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::EventsApi) + end + end + + # unit tests for list_events + # List events + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [ListEvents200Response] + describe 'list_events test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/executions_api_spec.rb b/spec/api/executions_api_spec.rb new file mode 100644 index 0000000..ab5e237 --- /dev/null +++ b/spec/api/executions_api_spec.rb @@ -0,0 +1,72 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::ExecutionsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ExecutionsApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::ExecutionsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of ExecutionsApi' do + it 'should create an instance of ExecutionsApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::ExecutionsApi) + end + end + + # unit tests for list_workflow_executions + # List workflow executions + # @param workflow_id Filter results by workflow id + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [ListWorkflowExecutions200Response] + describe 'list_workflow_executions test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for retrieve_execution + # Retrieve execution + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :id_type Type of identifier used in the URL + # @return [RetrieveExecution200Response] + describe 'retrieve_execution test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for stop_executions + # Stop executions + # @param [Hash] opts the optional parameters + # @option opts [StopExecutionsRequest] :stop_executions_request + # @return [Object] + describe 'stop_executions test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/installed_apps_api_spec.rb b/spec/api/installed_apps_api_spec.rb new file mode 100644 index 0000000..cdcf77d --- /dev/null +++ b/spec/api/installed_apps_api_spec.rb @@ -0,0 +1,79 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::InstalledAppsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InstalledAppsApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::InstalledAppsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of InstalledAppsApi' do + it 'should create an instance of InstalledAppsApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::InstalledAppsApi) + end + end + + # unit tests for install_app + # Install app + # @param [Hash] opts the optional parameters + # @option opts [InstallAppRequest] :install_app_request + # @return [InstallApp201Response] + describe 'install_app test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_installed_apps + # List installed apps + # @param [Hash] opts the optional parameters + # @return [ListInstalledApps200Response] + describe 'list_installed_apps test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for retrieve_installed_app + # Retrieve installed app + # @param app_identifier App indentifier + # @param [Hash] opts the optional parameters + # @return [InstallApp201Response] + describe 'retrieve_installed_app test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for update_installed_app + # Update installed app + # @param app_identifier App indentifier + # @param [Hash] opts the optional parameters + # @option opts [UpdateInstalledAppRequest] :update_installed_app_request + # @return [InstallApp201Response] + describe 'update_installed_app test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/payments_api_spec.rb b/spec/api/payments_api_spec.rb new file mode 100644 index 0000000..fe27ce4 --- /dev/null +++ b/spec/api/payments_api_spec.rb @@ -0,0 +1,48 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::PaymentsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PaymentsApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::PaymentsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of PaymentsApi' do + it 'should create an instance of PaymentsApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::PaymentsApi) + end + end + + # unit tests for list_payments + # List payments + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [ListEvents200Response] + describe 'list_payments test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/triggers_api_spec.rb b/spec/api/triggers_api_spec.rb new file mode 100644 index 0000000..3dcecd1 --- /dev/null +++ b/spec/api/triggers_api_spec.rb @@ -0,0 +1,82 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::TriggersApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TriggersApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::TriggersApi.new + end + + after do + # run after each test + end + + describe 'test an instance of TriggersApi' do + it 'should create an instance of TriggersApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::TriggersApi) + end + end + + # unit tests for delete_trigger + # Delete trigger + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [DeleteActionType200Response] + describe 'delete_trigger test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_triggers + # List triggers + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @return [ListTriggers200Response] + describe 'list_triggers test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for retrieve_trigger + # Retrieve trigger + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @return [ListTriggers200ResponseCollectionInner] + describe 'retrieve_trigger test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for update_trigger + # Update trigger + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [UpdateTriggerRequest] :update_trigger_request + # @return [ListTriggers200ResponseCollectionInner] + describe 'update_trigger test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/users_api_spec.rb b/spec/api/users_api_spec.rb new file mode 100644 index 0000000..a7fc13c --- /dev/null +++ b/spec/api/users_api_spec.rb @@ -0,0 +1,94 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::UsersApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'UsersApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::UsersApi.new + end + + after do + # run after each test + end + + describe 'test an instance of UsersApi' do + it 'should create an instance of UsersApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::UsersApi) + end + end + + # unit tests for create_user_token + # Create user token + # @param [Hash] opts the optional parameters + # @option opts [CreateUserTokenRequest] :create_user_token_request + # @return [CreateUserToken200Response] + describe 'create_user_token test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for delete_user + # Delete user + # @param key Client-provided unique identifier + # @param [Hash] opts the optional parameters + # @return [ListUsers200ResponseCollectionInner] + describe 'delete_user test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_users + # List users + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :search Search users by key + # @return [ListUsers200Response] + describe 'list_users test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for retrieve_user + # Retrieve user + # @param key Client-provided unique identifier + # @param [Hash] opts the optional parameters + # @return [ListUsers200ResponseCollectionInner] + describe 'retrieve_user test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for upsert_user + # Upsert user + # @param key Client-provided unique identifier + # @param [Hash] opts the optional parameters + # @option opts [UpsertUserRequest] :upsert_user_request + # @return [ListUsers200ResponseCollectionInner] + describe 'upsert_user test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/api/workflows_api_spec.rb b/spec/api/workflows_api_spec.rb new file mode 100644 index 0000000..cdd6c03 --- /dev/null +++ b/spec/api/workflows_api_spec.rb @@ -0,0 +1,190 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for EmbedWorkflow::WorkflowsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'WorkflowsApi' do + before do + # run before each test + @api_instance = EmbedWorkflow::WorkflowsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of WorkflowsApi' do + it 'should create an instance of WorkflowsApi' do + expect(@api_instance).to be_instance_of(EmbedWorkflow::WorkflowsApi) + end + end + + # unit tests for catch_hook + # Catch hook + # @param hook_id The trigger's hook id used for third party webhooks + # @param [Hash] opts the optional parameters + # @option opts [CatchHookRequest] :catch_hook_request + # @return [Object] + describe 'catch_hook test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for clone_workflow + # Clone workflow + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [DiscardWorkflowDraftRequest] :discard_workflow_draft_request + # @return [ListWorkflows200ResponseCollectionInner] + describe 'clone_workflow test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for create_workflow + # Create workflow + # @param [Hash] opts the optional parameters + # @option opts [CreateWorkflowRequest] :create_workflow_request + # @return [CreateWorkflow201Response] + describe 'create_workflow test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for delete_workflow + # Delete workflow + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :id_type Type of identifier used in the URL + # @option opts [String] :user_key Unique user identifier + # @return [DeleteWorkflow200Response] + describe 'delete_workflow test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for discard_workflow_draft + # Discard workflow draft + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [DiscardWorkflowDraftRequest] :discard_workflow_draft_request + # @return [CreateWorkflow201Response] + describe 'discard_workflow_draft test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for execute_workflow + # Execute workflow + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [ExecuteWorkflowRequest] :execute_workflow_request + # @return [ExecuteWorkflow201Response] + describe 'execute_workflow test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_workflow_versions + # List workflow versions + # @param workflow_id Filter results by workflow id + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [String] :user_key Unique user identifier + # @return [ListWorkflowVersions200Response] + describe 'list_workflow_versions test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for list_workflows + # List workflows + # @param [Hash] opts the optional parameters + # @option opts [String] :starting_after Cursor for pagination - return results after this ID + # @option opts [String] :ending_before Cursor for pagination - return results before this ID + # @option opts [Integer] :limit Number of items to return (max 100) + # @option opts [Array] :expand Expand related objects + # @option opts [String] :user_key Unique user identifier + # @option opts [Boolean] :is_template Filter workflows by is_template value + # @option opts [Boolean] :on Filter workflows by on value + # @option opts [String] :order_by Field to order results by + # @option opts [String] :order_direction + # @return [ListWorkflows200Response] + describe 'list_workflows test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for publish_workflow + # Publish workflow + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [PublishWorkflowRequest] :publish_workflow_request + # @return [CreateWorkflow201Response] + describe 'publish_workflow test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for retrieve_workflow + # Retrieve workflow + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [String] :id_type Type of identifier used in the URL + # @option opts [String] :user_key Unique user identifier + # @option opts [Array] :expand Expand related objects + # @return [CreateWorkflow201Response] + describe 'retrieve_workflow test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for trigger_workflow + # Trigger workflow + # @param [Hash] opts the optional parameters + # @option opts [TriggerWorkflowRequest] :trigger_workflow_request + # @return [Object] + describe 'trigger_workflow test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for update_workflow + # Update workflow + # @param id System-generated unique identifier + # @param [Hash] opts the optional parameters + # @option opts [UpdateWorkflowRequest] :update_workflow_request + # @return [nil] + describe 'update_workflow test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/app_connections_spec.rb b/spec/app_connections_spec.rb deleted file mode 100644 index 535cd3f..0000000 --- a/spec/app_connections_spec.rb +++ /dev/null @@ -1,168 +0,0 @@ -# frozen_string_literal: true - -require_relative "../lib/embed_workflow" -require "net/http" - -describe "app_connections" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:execute_request) - .with(instance_of(Net::HTTPRequest)) - .and_return("response") - end - - describe "#list" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:get_request) - .with({ path: "/api/v1/app_connections", params: {} }) - .and_return("response") - end - - it "sends the correct parameters to the app_connections API" do - EmbedWorkflow::AppConnections.list - end - - context "with pagination parameters" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:get_request) - .with({ - path: "/api/v1/app_connections", - params: { - starting_after: "550e8400-e29b-41d4-a716-446655440000", - limit: 50 - } - }) - .and_return("response") - end - - it "sends the correct pagination parameters" do - EmbedWorkflow::AppConnections.list( - starting_after: "550e8400-e29b-41d4-a716-446655440000", - limit: 50 - ) - end - end - - context "with user_key parameter" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:get_request) - .with({ - path: "/api/v1/app_connections", - params: { user_key: "api-user-1" } - }) - .and_return("response") - end - - it "sends the correct user_key parameter" do - EmbedWorkflow::AppConnections.list(user_key: "api-user-1") - end - end - end - - describe "#fetch" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:get_request) - .with({ - path: "/api/v1/app_connections/75233470-6316-4fa9-a7f5-5196f3d06067", - params: {} - }) - .and_return("response") - end - - it "sends the correct parameters to the app_connections API" do - EmbedWorkflow::AppConnections.fetch(id: "75233470-6316-4fa9-a7f5-5196f3d06067") - end - - context "with user_key parameter" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:get_request) - .with({ - path: "/api/v1/app_connections/75233470-6316-4fa9-a7f5-5196f3d06067", - params: { user_key: "api-user-1" } - }) - .and_return("response") - end - - it "sends the correct user_key parameter" do - EmbedWorkflow::AppConnections.fetch( - id: "75233470-6316-4fa9-a7f5-5196f3d06067", - user_key: "api-user-1" - ) - end - end - end - - describe "#create" do - before do - config = { - api_key: "sk-1234567890abcdef", - organization_id: "org-abcdefg123456" - } - - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:post_request) - .with({ - path: "/api/v1/app_connections", - body: { - name: "My OpenAI Connection", - app_type: "openai", - config: config - } - }) - .and_return("response") - end - - it "sends the correct parameters to the app_connections API" do - config = { - api_key: "sk-1234567890abcdef", - organization_id: "org-abcdefg123456" - } - - EmbedWorkflow::AppConnections.create( - name: "My OpenAI Connection", - app_type: "openai", - config: config - ) - end - end - - describe "#update" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:put_request) - .with({ - path: "/api/v1/app_connections/75233470-6316-4fa9-a7f5-5196f3d06067", - body: { name: "Updated OpenAI Connection" } - }) - .and_return("response") - end - - it "sends the correct parameters to the app_connections API" do - EmbedWorkflow::AppConnections.update( - id: "75233470-6316-4fa9-a7f5-5196f3d06067", - name: "Updated OpenAI Connection" - ) - end - end - - describe "#delete" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:delete_request) - .with({ - path: "/api/v1/app_connections/75233470-6316-4fa9-a7f5-5196f3d06067", - params: {} - }) - .and_return("response") - end - - it "sends the correct parameters to the app_connections API" do - EmbedWorkflow::AppConnections.delete(id: "75233470-6316-4fa9-a7f5-5196f3d06067") - end - end -end diff --git a/spec/models/catch_hook_request_spec.rb b/spec/models/catch_hook_request_spec.rb new file mode 100644 index 0000000..6737c22 --- /dev/null +++ b/spec/models/catch_hook_request_spec.rb @@ -0,0 +1,36 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CatchHookRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CatchHookRequest do + let(:instance) { EmbedWorkflow::CatchHookRequest.new } + + describe 'test an instance of CatchHookRequest' do + it 'should create an instance of CatchHookRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CatchHookRequest) + end + end + + describe 'test attribute "user_key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/create_action_type422_response_spec.rb b/spec/models/create_action_type422_response_spec.rb new file mode 100644 index 0000000..ccc7bce --- /dev/null +++ b/spec/models/create_action_type422_response_spec.rb @@ -0,0 +1,48 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CreateActionType422Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CreateActionType422Response do + let(:instance) { EmbedWorkflow::CreateActionType422Response.new } + + describe 'test an instance of CreateActionType422Response' do + it 'should create an instance of CreateActionType422Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CreateActionType422Response) + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/create_action_type_request_form_draft_inner_spec.rb b/spec/models/create_action_type_request_form_draft_inner_spec.rb new file mode 100644 index 0000000..58dded5 --- /dev/null +++ b/spec/models/create_action_type_request_form_draft_inner_spec.rb @@ -0,0 +1,82 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CreateActionTypeRequestFormDraftInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CreateActionTypeRequestFormDraftInner do + let(:instance) { EmbedWorkflow::CreateActionTypeRequestFormDraftInner.new } + + describe 'test an instance of CreateActionTypeRequestFormDraftInner' do + it 'should create an instance of CreateActionTypeRequestFormDraftInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CreateActionTypeRequestFormDraftInner) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "required"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "advanced"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "label"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["text", "email", "password", "textarea", "select", "checkbox", "radio", "number", "date", "file"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/create_action_type_request_icon_draft_spec.rb b/spec/models/create_action_type_request_icon_draft_spec.rb new file mode 100644 index 0000000..b1c4ebe --- /dev/null +++ b/spec/models/create_action_type_request_icon_draft_spec.rb @@ -0,0 +1,48 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CreateActionTypeRequestIconDraft +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CreateActionTypeRequestIconDraft do + let(:instance) { EmbedWorkflow::CreateActionTypeRequestIconDraft.new } + + describe 'test an instance of CreateActionTypeRequestIconDraft' do + it 'should create an instance of CreateActionTypeRequestIconDraft' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CreateActionTypeRequestIconDraft) + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "background_color"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "url"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/create_action_type_request_spec.rb b/spec/models/create_action_type_request_spec.rb new file mode 100644 index 0000000..f9dc21c --- /dev/null +++ b/spec/models/create_action_type_request_spec.rb @@ -0,0 +1,126 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CreateActionTypeRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CreateActionTypeRequest do + let(:instance) { EmbedWorkflow::CreateActionTypeRequest.new } + + describe 'test an instance of CreateActionTypeRequest' do + it 'should create an instance of CreateActionTypeRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CreateActionTypeRequest) + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "on"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "params_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "headers_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "url_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "http_method_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "code_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "publish"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "form_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "response_data_schema_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "icon_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "primary_category"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "secondary_category"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/create_app_connection_request_spec.rb b/spec/models/create_app_connection_request_spec.rb new file mode 100644 index 0000000..589b68e --- /dev/null +++ b/spec/models/create_app_connection_request_spec.rb @@ -0,0 +1,54 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CreateAppConnectionRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CreateAppConnectionRequest do + let(:instance) { EmbedWorkflow::CreateAppConnectionRequest.new } + + describe 'test an instance of CreateAppConnectionRequest' do + it 'should create an instance of CreateAppConnectionRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CreateAppConnectionRequest) + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "app_type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "user_key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "config"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/create_user_token200_response_spec.rb b/spec/models/create_user_token200_response_spec.rb new file mode 100644 index 0000000..50acf3b --- /dev/null +++ b/spec/models/create_user_token200_response_spec.rb @@ -0,0 +1,36 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CreateUserToken200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CreateUserToken200Response do + let(:instance) { EmbedWorkflow::CreateUserToken200Response.new } + + describe 'test an instance of CreateUserToken200Response' do + it 'should create an instance of CreateUserToken200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CreateUserToken200Response) + end + end + + describe 'test attribute "user_token"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/create_user_token_request_spec.rb b/spec/models/create_user_token_request_spec.rb new file mode 100644 index 0000000..6f2eb8d --- /dev/null +++ b/spec/models/create_user_token_request_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CreateUserTokenRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CreateUserTokenRequest do + let(:instance) { EmbedWorkflow::CreateUserTokenRequest.new } + + describe 'test an instance of CreateUserTokenRequest' do + it 'should create an instance of CreateUserTokenRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CreateUserTokenRequest) + end + end + + describe 'test attribute "key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/create_workflow201_response_spec.rb b/spec/models/create_workflow201_response_spec.rb new file mode 100644 index 0000000..80d5ef5 --- /dev/null +++ b/spec/models/create_workflow201_response_spec.rb @@ -0,0 +1,266 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CreateWorkflow201Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CreateWorkflow201Response do + let(:instance) { EmbedWorkflow::CreateWorkflow201Response.new } + + describe 'test an instance of CreateWorkflow201Response' do + it 'should create an instance of CreateWorkflow201Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CreateWorkflow201Response) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "account_template_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "action_type_ids"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "auto_clone_for_new_users"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "event_trigger"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "event_trigger_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "executions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "has_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "is_managed"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "is_template"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_executed_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_executed_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_executed_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_published_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_published_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_published_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "managed_by"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["tenant", "account"]) + # validator.allowable_values.each do |value| + # expect { instance.managed_by = value }.not_to raise_error + # end + end + end + + describe 'test attribute "match_conditions"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "match_conditions_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "on"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "stats"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["on", "off"]) + # validator.allowable_values.each do |value| + # expect { instance.status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "template"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "template_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "trigger_conditions"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "trigger_conditions_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "updated_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "updated_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "updated_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/create_workflow_request_spec.rb b/spec/models/create_workflow_request_spec.rb new file mode 100644 index 0000000..1b999bc --- /dev/null +++ b/spec/models/create_workflow_request_spec.rb @@ -0,0 +1,78 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CreateWorkflowRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CreateWorkflowRequest do + let(:instance) { EmbedWorkflow::CreateWorkflowRequest.new } + + describe 'test an instance of CreateWorkflowRequest' do + it 'should create an instance of CreateWorkflowRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CreateWorkflowRequest) + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "user_key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "details"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "template_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "trigger_conditions_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "event_trigger_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "match_conditions_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/create_workflow_request_template_draft_nodes_inner_spec.rb b/spec/models/create_workflow_request_template_draft_nodes_inner_spec.rb new file mode 100644 index 0000000..beb7a01 --- /dev/null +++ b/spec/models/create_workflow_request_template_draft_nodes_inner_spec.rb @@ -0,0 +1,134 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CreateWorkflowRequestTemplateDraftNodesInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CreateWorkflowRequestTemplateDraftNodesInner do + let(:instance) { EmbedWorkflow::CreateWorkflowRequestTemplateDraftNodesInner.new } + + describe 'test an instance of CreateWorkflowRequestTemplateDraftNodesInner' do + it 'should create an instance of CreateWorkflowRequestTemplateDraftNodesInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CreateWorkflowRequestTemplateDraftNodesInner) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["CustomCode", "CustomApiRequest", "Delay", "WaitUntil", "Trigger", "Condition"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "action_type_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "required_condition_result"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "app_connection_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "action_data"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "prefix"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "delay_n"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "delay_unit"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "minute_of_day"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "minute_of_day_end"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "days_of_week"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "event_trigger"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "conditions"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "match_conditions"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["all", "any"]) + # validator.allowable_values.each do |value| + # expect { instance.match_conditions = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/models/create_workflow_request_template_draft_spec.rb b/spec/models/create_workflow_request_template_draft_spec.rb new file mode 100644 index 0000000..d42e642 --- /dev/null +++ b/spec/models/create_workflow_request_template_draft_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::CreateWorkflowRequestTemplateDraft +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::CreateWorkflowRequestTemplateDraft do + let(:instance) { EmbedWorkflow::CreateWorkflowRequestTemplateDraft.new } + + describe 'test an instance of CreateWorkflowRequestTemplateDraft' do + it 'should create an instance of CreateWorkflowRequestTemplateDraft' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::CreateWorkflowRequestTemplateDraft) + end + end + + describe 'test attribute "nodes"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "edges"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/delete_action_type200_response_spec.rb b/spec/models/delete_action_type200_response_spec.rb new file mode 100644 index 0000000..4d6db07 --- /dev/null +++ b/spec/models/delete_action_type200_response_spec.rb @@ -0,0 +1,36 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::DeleteActionType200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::DeleteActionType200Response do + let(:instance) { EmbedWorkflow::DeleteActionType200Response.new } + + describe 'test an instance of DeleteActionType200Response' do + it 'should create an instance of DeleteActionType200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::DeleteActionType200Response) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/delete_workflow200_response_one_of1_spec.rb b/spec/models/delete_workflow200_response_one_of1_spec.rb new file mode 100644 index 0000000..42a7219 --- /dev/null +++ b/spec/models/delete_workflow200_response_one_of1_spec.rb @@ -0,0 +1,36 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::DeleteWorkflow200ResponseOneOf1 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::DeleteWorkflow200ResponseOneOf1 do + let(:instance) { EmbedWorkflow::DeleteWorkflow200ResponseOneOf1.new } + + describe 'test an instance of DeleteWorkflow200ResponseOneOf1' do + it 'should create an instance of DeleteWorkflow200ResponseOneOf1' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::DeleteWorkflow200ResponseOneOf1) + end + end + + describe 'test attribute "key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/delete_workflow200_response_one_of_spec.rb b/spec/models/delete_workflow200_response_one_of_spec.rb new file mode 100644 index 0000000..8f759b4 --- /dev/null +++ b/spec/models/delete_workflow200_response_one_of_spec.rb @@ -0,0 +1,36 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::DeleteWorkflow200ResponseOneOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::DeleteWorkflow200ResponseOneOf do + let(:instance) { EmbedWorkflow::DeleteWorkflow200ResponseOneOf.new } + + describe 'test an instance of DeleteWorkflow200ResponseOneOf' do + it 'should create an instance of DeleteWorkflow200ResponseOneOf' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::DeleteWorkflow200ResponseOneOf) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/delete_workflow200_response_spec.rb b/spec/models/delete_workflow200_response_spec.rb new file mode 100644 index 0000000..92d513e --- /dev/null +++ b/spec/models/delete_workflow200_response_spec.rb @@ -0,0 +1,32 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::DeleteWorkflow200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::DeleteWorkflow200Response do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end + end + + describe '.build' do + it 'returns the correct model' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end +end diff --git a/spec/models/discard_workflow_draft_request_spec.rb b/spec/models/discard_workflow_draft_request_spec.rb new file mode 100644 index 0000000..e26bf83 --- /dev/null +++ b/spec/models/discard_workflow_draft_request_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::DiscardWorkflowDraftRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::DiscardWorkflowDraftRequest do + let(:instance) { EmbedWorkflow::DiscardWorkflowDraftRequest.new } + + describe 'test an instance of DiscardWorkflowDraftRequest' do + it 'should create an instance of DiscardWorkflowDraftRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::DiscardWorkflowDraftRequest) + end + end + + describe 'test attribute "user_key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "expand"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/evaluate_expression200_response_spec.rb b/spec/models/evaluate_expression200_response_spec.rb new file mode 100644 index 0000000..65c984c --- /dev/null +++ b/spec/models/evaluate_expression200_response_spec.rb @@ -0,0 +1,36 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::EvaluateExpression200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::EvaluateExpression200Response do + let(:instance) { EmbedWorkflow::EvaluateExpression200Response.new } + + describe 'test an instance of EvaluateExpression200Response' do + it 'should create an instance of EvaluateExpression200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::EvaluateExpression200Response) + end + end + + describe 'test attribute "result"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/evaluate_expression_request_spec.rb b/spec/models/evaluate_expression_request_spec.rb new file mode 100644 index 0000000..0036606 --- /dev/null +++ b/spec/models/evaluate_expression_request_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::EvaluateExpressionRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::EvaluateExpressionRequest do + let(:instance) { EmbedWorkflow::EvaluateExpressionRequest.new } + + describe 'test an instance of EvaluateExpressionRequest' do + it 'should create an instance of EvaluateExpressionRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::EvaluateExpressionRequest) + end + end + + describe 'test attribute "expression"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/execute_workflow201_response_spec.rb b/spec/models/execute_workflow201_response_spec.rb new file mode 100644 index 0000000..3944ddc --- /dev/null +++ b/spec/models/execute_workflow201_response_spec.rb @@ -0,0 +1,132 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ExecuteWorkflow201Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ExecuteWorkflow201Response do + let(:instance) { EmbedWorkflow::ExecuteWorkflow201Response.new } + + describe 'test an instance of ExecuteWorkflow201Response' do + it 'should create an instance of ExecuteWorkflow201Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ExecuteWorkflow201Response) + end + end + + describe 'test attribute "hashid"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "completed_actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "execution_data"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "failed_actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "idle_actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "log"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "running_actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "stopped_actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/execute_workflow_request_spec.rb b/spec/models/execute_workflow_request_spec.rb new file mode 100644 index 0000000..669c38a --- /dev/null +++ b/spec/models/execute_workflow_request_spec.rb @@ -0,0 +1,52 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ExecuteWorkflowRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ExecuteWorkflowRequest do + let(:instance) { EmbedWorkflow::ExecuteWorkflowRequest.new } + + describe 'test an instance of ExecuteWorkflowRequest' do + it 'should create an instance of ExecuteWorkflowRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ExecuteWorkflowRequest) + end + end + + describe 'test attribute "id_type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["id", "key"]) + # validator.allowable_values.each do |value| + # expect { instance.id_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "user_key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "execution_data"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/export_configuration200_response_configuration_spec.rb b/spec/models/export_configuration200_response_configuration_spec.rb new file mode 100644 index 0000000..fd354d8 --- /dev/null +++ b/spec/models/export_configuration200_response_configuration_spec.rb @@ -0,0 +1,32 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ExportConfiguration200ResponseConfiguration +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ExportConfiguration200ResponseConfiguration do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end + end + + describe '.build' do + it 'returns the correct model' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end +end diff --git a/spec/models/export_configuration200_response_spec.rb b/spec/models/export_configuration200_response_spec.rb new file mode 100644 index 0000000..a8eb3c2 --- /dev/null +++ b/spec/models/export_configuration200_response_spec.rb @@ -0,0 +1,36 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ExportConfiguration200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ExportConfiguration200Response do + let(:instance) { EmbedWorkflow::ExportConfiguration200Response.new } + + describe 'test an instance of ExportConfiguration200Response' do + it 'should create an instance of ExportConfiguration200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ExportConfiguration200Response) + end + end + + describe 'test attribute "configuration"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/import_configuration201_response_spec.rb b/spec/models/import_configuration201_response_spec.rb new file mode 100644 index 0000000..618386c --- /dev/null +++ b/spec/models/import_configuration201_response_spec.rb @@ -0,0 +1,66 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ImportConfiguration201Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ImportConfiguration201Response do + let(:instance) { EmbedWorkflow::ImportConfiguration201Response.new } + + describe 'test an instance of ImportConfiguration201Response' do + it 'should create an instance of ImportConfiguration201Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ImportConfiguration201Response) + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "account_data_schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "action_types"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "triggers"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "user_data_schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "workflows"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/import_configuration_request_schema_spec.rb b/spec/models/import_configuration_request_schema_spec.rb new file mode 100644 index 0000000..ff39ef0 --- /dev/null +++ b/spec/models/import_configuration_request_schema_spec.rb @@ -0,0 +1,32 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ImportConfigurationRequestSchema +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ImportConfigurationRequestSchema do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end + end + + describe '.build' do + it 'returns the correct model' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end +end diff --git a/spec/models/import_configuration_request_spec.rb b/spec/models/import_configuration_request_spec.rb new file mode 100644 index 0000000..a88d756 --- /dev/null +++ b/spec/models/import_configuration_request_spec.rb @@ -0,0 +1,46 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ImportConfigurationRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ImportConfigurationRequest do + let(:instance) { EmbedWorkflow::ImportConfigurationRequest.new } + + describe 'test an instance of ImportConfigurationRequest' do + it 'should create an instance of ImportConfigurationRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ImportConfigurationRequest) + end + end + + describe 'test attribute "schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "schema_format"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["null", "json", "yaml"]) + # validator.allowable_values.each do |value| + # expect { instance.schema_format = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/models/install_app201_response_spec.rb b/spec/models/install_app201_response_spec.rb new file mode 100644 index 0000000..fba2270 --- /dev/null +++ b/spec/models/install_app201_response_spec.rb @@ -0,0 +1,132 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::InstallApp201Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::InstallApp201Response do + let(:instance) { EmbedWorkflow::InstallApp201Response.new } + + describe 'test an instance of InstallApp201Response' do + it 'should create an instance of InstallApp201Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::InstallApp201Response) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "app_identifier"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "app_version"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "available_version"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "icon"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "installed_schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_used_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_used_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_used_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "previous_version"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "upgrade_available"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "upgraded_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "upgraded_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "upgraded_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/install_app_request_spec.rb b/spec/models/install_app_request_spec.rb new file mode 100644 index 0000000..4426156 --- /dev/null +++ b/spec/models/install_app_request_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::InstallAppRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::InstallAppRequest do + let(:instance) { EmbedWorkflow::InstallAppRequest.new } + + describe 'test an instance of InstallAppRequest' do + it 'should create an instance of InstallAppRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::InstallAppRequest) + end + end + + describe 'test attribute "app_identifier"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_action_types200_response_collection_inner_spec.rb b/spec/models/list_action_types200_response_collection_inner_spec.rb new file mode 100644 index 0000000..c5b650e --- /dev/null +++ b/spec/models/list_action_types200_response_collection_inner_spec.rb @@ -0,0 +1,312 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListActionTypes200ResponseCollectionInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListActionTypes200ResponseCollectionInner do + let(:instance) { EmbedWorkflow::ListActionTypes200ResponseCollectionInner.new } + + describe 'test an instance of ListActionTypes200ResponseCollectionInner' do + it 'should create an instance of ListActionTypes200ResponseCollectionInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListActionTypes200ResponseCollectionInner) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "app_name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "callback_timeout_n"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "callback_timeout_unit"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["sec", "min", "hour", "day", "week", "month", "year"]) + # validator.allowable_values.each do |value| + # expect { instance.callback_timeout_unit = value }.not_to raise_error + # end + end + end + + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "code_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "executed_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "has_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "headers"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "headers_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "http_method"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["get", "post", "put", "patch", "delete"]) + # validator.allowable_values.each do |value| + # expect { instance.http_method = value }.not_to raise_error + # end + end + end + + describe 'test attribute "http_method_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["get", "post", "put", "patch", "delete"]) + # validator.allowable_values.each do |value| + # expect { instance.http_method_draft = value }.not_to raise_error + # end + end + end + + describe 'test attribute "icon"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "icon_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_executed_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_executed_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_executed_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_published_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_published_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_published_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "on"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "params"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "params_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "primary_category"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "required_app_connection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "secondary_category"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "source"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "updated_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "updated_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "updated_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "url"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "url_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "wait_for_callback"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "form"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "form_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "response_data_schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "response_data_schema_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_action_types200_response_meta_spec.rb b/spec/models/list_action_types200_response_meta_spec.rb new file mode 100644 index 0000000..9814276 --- /dev/null +++ b/spec/models/list_action_types200_response_meta_spec.rb @@ -0,0 +1,48 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListActionTypes200ResponseMeta +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListActionTypes200ResponseMeta do + let(:instance) { EmbedWorkflow::ListActionTypes200ResponseMeta.new } + + describe 'test an instance of ListActionTypes200ResponseMeta' do + it 'should create an instance of ListActionTypes200ResponseMeta' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListActionTypes200ResponseMeta) + end + end + + describe 'test attribute "page_limit"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "has_next_page"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "has_previous_page"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_action_types200_response_spec.rb b/spec/models/list_action_types200_response_spec.rb new file mode 100644 index 0000000..374818d --- /dev/null +++ b/spec/models/list_action_types200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListActionTypes200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListActionTypes200Response do + let(:instance) { EmbedWorkflow::ListActionTypes200Response.new } + + describe 'test an instance of ListActionTypes200Response' do + it 'should create an instance of ListActionTypes200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListActionTypes200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_actions200_response_collection_inner_spec.rb b/spec/models/list_actions200_response_collection_inner_spec.rb new file mode 100644 index 0000000..6c0efb6 --- /dev/null +++ b/spec/models/list_actions200_response_collection_inner_spec.rb @@ -0,0 +1,156 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListActions200ResponseCollectionInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListActions200ResponseCollectionInner do + let(:instance) { EmbedWorkflow::ListActions200ResponseCollectionInner.new } + + describe 'test an instance of ListActions200ResponseCollectionInner' do + it 'should create an instance of ListActions200ResponseCollectionInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListActions200ResponseCollectionInner) + end + end + + describe 'test attribute "hashid"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "completed_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "completed_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "completed_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "execution_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "failed_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "failed_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "failed_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "failure_note"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "log"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "node_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "run_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "run_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "run_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "stopped_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "stopped_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "stopped_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "uuid"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_actions200_response_spec.rb b/spec/models/list_actions200_response_spec.rb new file mode 100644 index 0000000..133b25d --- /dev/null +++ b/spec/models/list_actions200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListActions200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListActions200Response do + let(:instance) { EmbedWorkflow::ListActions200Response.new } + + describe 'test an instance of ListActions200Response' do + it 'should create an instance of ListActions200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListActions200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_app_connections200_response_collection_inner_spec.rb b/spec/models/list_app_connections200_response_collection_inner_spec.rb new file mode 100644 index 0000000..86720ab --- /dev/null +++ b/spec/models/list_app_connections200_response_collection_inner_spec.rb @@ -0,0 +1,78 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListAppConnections200ResponseCollectionInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListAppConnections200ResponseCollectionInner do + let(:instance) { EmbedWorkflow::ListAppConnections200ResponseCollectionInner.new } + + describe 'test an instance of ListAppConnections200ResponseCollectionInner' do + it 'should create an instance of ListAppConnections200ResponseCollectionInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListAppConnections200ResponseCollectionInner) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "app_type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_used_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_used_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_used_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_app_connections200_response_spec.rb b/spec/models/list_app_connections200_response_spec.rb new file mode 100644 index 0000000..8abb237 --- /dev/null +++ b/spec/models/list_app_connections200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListAppConnections200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListAppConnections200Response do + let(:instance) { EmbedWorkflow::ListAppConnections200Response.new } + + describe 'test an instance of ListAppConnections200Response' do + it 'should create an instance of ListAppConnections200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListAppConnections200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_available_apps200_response_collection_inner_spec.rb b/spec/models/list_available_apps200_response_collection_inner_spec.rb new file mode 100644 index 0000000..c5eb28c --- /dev/null +++ b/spec/models/list_available_apps200_response_collection_inner_spec.rb @@ -0,0 +1,78 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListAvailableApps200ResponseCollectionInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListAvailableApps200ResponseCollectionInner do + let(:instance) { EmbedWorkflow::ListAvailableApps200ResponseCollectionInner.new } + + describe 'test an instance of ListAvailableApps200ResponseCollectionInner' do + it 'should create an instance of ListAvailableApps200ResponseCollectionInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListAvailableApps200ResponseCollectionInner) + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "app_identifier"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "icon"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "latest_version"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "primary_category"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "secondary_category"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_available_apps200_response_spec.rb b/spec/models/list_available_apps200_response_spec.rb new file mode 100644 index 0000000..f8a76a0 --- /dev/null +++ b/spec/models/list_available_apps200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListAvailableApps200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListAvailableApps200Response do + let(:instance) { EmbedWorkflow::ListAvailableApps200Response.new } + + describe 'test an instance of ListAvailableApps200Response' do + it 'should create an instance of ListAvailableApps200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListAvailableApps200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_data_fields200_response_collection_inner_spec.rb b/spec/models/list_data_fields200_response_collection_inner_spec.rb new file mode 100644 index 0000000..27ccee7 --- /dev/null +++ b/spec/models/list_data_fields200_response_collection_inner_spec.rb @@ -0,0 +1,120 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListDataFields200ResponseCollectionInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListDataFields200ResponseCollectionInner do + let(:instance) { EmbedWorkflow::ListDataFields200ResponseCollectionInner.new } + + describe 'test an instance of ListDataFields200ResponseCollectionInner' do + it 'should create an instance of ListDataFields200ResponseCollectionInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListDataFields200ResponseCollectionInner) + end + end + + describe 'test attribute "variable"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "data_path"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "display_label"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "format"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "item_type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "iterator"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "list_values_variable"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "required"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "secret"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "source"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "value"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "children"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_data_fields200_response_spec.rb b/spec/models/list_data_fields200_response_spec.rb new file mode 100644 index 0000000..8961468 --- /dev/null +++ b/spec/models/list_data_fields200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListDataFields200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListDataFields200Response do + let(:instance) { EmbedWorkflow::ListDataFields200Response.new } + + describe 'test an instance of ListDataFields200Response' do + it 'should create an instance of ListDataFields200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListDataFields200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_data_fields_type_parameter_spec.rb b/spec/models/list_data_fields_type_parameter_spec.rb new file mode 100644 index 0000000..ab92b76 --- /dev/null +++ b/spec/models/list_data_fields_type_parameter_spec.rb @@ -0,0 +1,32 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListDataFieldsTypeParameter +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListDataFieldsTypeParameter do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end + end + + describe '.build' do + it 'returns the correct model' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end +end diff --git a/spec/models/list_events200_response_collection_inner_spec.rb b/spec/models/list_events200_response_collection_inner_spec.rb new file mode 100644 index 0000000..3ba48fc --- /dev/null +++ b/spec/models/list_events200_response_collection_inner_spec.rb @@ -0,0 +1,90 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListEvents200ResponseCollectionInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListEvents200ResponseCollectionInner do + let(:instance) { EmbedWorkflow::ListEvents200ResponseCollectionInner.new } + + describe 'test an instance of ListEvents200ResponseCollectionInner' do + it 'should create an instance of ListEvents200ResponseCollectionInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListEvents200ResponseCollectionInner) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "ended_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "ended_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "ended_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "response_body"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "started_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "started_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "started_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_events200_response_spec.rb b/spec/models/list_events200_response_spec.rb new file mode 100644 index 0000000..edfa1dd --- /dev/null +++ b/spec/models/list_events200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListEvents200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListEvents200Response do + let(:instance) { EmbedWorkflow::ListEvents200Response.new } + + describe 'test an instance of ListEvents200Response' do + it 'should create an instance of ListEvents200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListEvents200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_installed_apps200_response_collection_inner_spec.rb b/spec/models/list_installed_apps200_response_collection_inner_spec.rb new file mode 100644 index 0000000..ddbeba0 --- /dev/null +++ b/spec/models/list_installed_apps200_response_collection_inner_spec.rb @@ -0,0 +1,126 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListInstalledApps200ResponseCollectionInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListInstalledApps200ResponseCollectionInner do + let(:instance) { EmbedWorkflow::ListInstalledApps200ResponseCollectionInner.new } + + describe 'test an instance of ListInstalledApps200ResponseCollectionInner' do + it 'should create an instance of ListInstalledApps200ResponseCollectionInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListInstalledApps200ResponseCollectionInner) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "app_identifier"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "app_version"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "available_version"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "icon"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_used_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_used_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_used_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "previous_version"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "upgrade_available"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "upgraded_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "upgraded_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "upgraded_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_installed_apps200_response_spec.rb b/spec/models/list_installed_apps200_response_spec.rb new file mode 100644 index 0000000..c153352 --- /dev/null +++ b/spec/models/list_installed_apps200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListInstalledApps200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListInstalledApps200Response do + let(:instance) { EmbedWorkflow::ListInstalledApps200Response.new } + + describe 'test an instance of ListInstalledApps200Response' do + it 'should create an instance of ListInstalledApps200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListInstalledApps200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_triggers200_response_collection_inner_spec.rb b/spec/models/list_triggers200_response_collection_inner_spec.rb new file mode 100644 index 0000000..11c5077 --- /dev/null +++ b/spec/models/list_triggers200_response_collection_inner_spec.rb @@ -0,0 +1,132 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListTriggers200ResponseCollectionInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListTriggers200ResponseCollectionInner do + let(:instance) { EmbedWorkflow::ListTriggers200ResponseCollectionInner.new } + + describe 'test an instance of ListTriggers200ResponseCollectionInner' do + it 'should create an instance of ListTriggers200ResponseCollectionInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListTriggers200ResponseCollectionInner) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "event"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "hook_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "icon"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_triggered_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_triggered_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_triggered_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "on"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "processed_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "data_input_schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_triggers200_response_spec.rb b/spec/models/list_triggers200_response_spec.rb new file mode 100644 index 0000000..1329247 --- /dev/null +++ b/spec/models/list_triggers200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListTriggers200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListTriggers200Response do + let(:instance) { EmbedWorkflow::ListTriggers200Response.new } + + describe 'test an instance of ListTriggers200Response' do + it 'should create an instance of ListTriggers200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListTriggers200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_users200_response_collection_inner_spec.rb b/spec/models/list_users200_response_collection_inner_spec.rb new file mode 100644 index 0000000..c96fb6f --- /dev/null +++ b/spec/models/list_users200_response_collection_inner_spec.rb @@ -0,0 +1,96 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListUsers200ResponseCollectionInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListUsers200ResponseCollectionInner do + let(:instance) { EmbedWorkflow::ListUsers200ResponseCollectionInner.new } + + describe 'test an instance of ListUsers200ResponseCollectionInner' do + it 'should create an instance of ListUsers200ResponseCollectionInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListUsers200ResponseCollectionInner) + end + end + + describe 'test attribute "key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "email"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "time_zone"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "user_data_schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_users200_response_spec.rb b/spec/models/list_users200_response_spec.rb new file mode 100644 index 0000000..f80723a --- /dev/null +++ b/spec/models/list_users200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListUsers200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListUsers200Response do + let(:instance) { EmbedWorkflow::ListUsers200Response.new } + + describe 'test an instance of ListUsers200Response' do + it 'should create an instance of ListUsers200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListUsers200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_workflow_executions200_response_spec.rb b/spec/models/list_workflow_executions200_response_spec.rb new file mode 100644 index 0000000..4b9da85 --- /dev/null +++ b/spec/models/list_workflow_executions200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListWorkflowExecutions200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListWorkflowExecutions200Response do + let(:instance) { EmbedWorkflow::ListWorkflowExecutions200Response.new } + + describe 'test an instance of ListWorkflowExecutions200Response' do + it 'should create an instance of ListWorkflowExecutions200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListWorkflowExecutions200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_workflow_versions200_response_collection_inner_spec.rb b/spec/models/list_workflow_versions200_response_collection_inner_spec.rb new file mode 100644 index 0000000..1f9e48b --- /dev/null +++ b/spec/models/list_workflow_versions200_response_collection_inner_spec.rb @@ -0,0 +1,72 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListWorkflowVersions200ResponseCollectionInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListWorkflowVersions200ResponseCollectionInner do + let(:instance) { EmbedWorkflow::ListWorkflowVersions200ResponseCollectionInner.new } + + describe 'test an instance of ListWorkflowVersions200ResponseCollectionInner' do + it 'should create an instance of ListWorkflowVersions200ResponseCollectionInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListWorkflowVersions200ResponseCollectionInner) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "event"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "resource_type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_workflow_versions200_response_spec.rb b/spec/models/list_workflow_versions200_response_spec.rb new file mode 100644 index 0000000..b38aac1 --- /dev/null +++ b/spec/models/list_workflow_versions200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListWorkflowVersions200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListWorkflowVersions200Response do + let(:instance) { EmbedWorkflow::ListWorkflowVersions200Response.new } + + describe 'test an instance of ListWorkflowVersions200Response' do + it 'should create an instance of ListWorkflowVersions200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListWorkflowVersions200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_workflows200_response_collection_inner_spec.rb b/spec/models/list_workflows200_response_collection_inner_spec.rb new file mode 100644 index 0000000..dc9aa33 --- /dev/null +++ b/spec/models/list_workflows200_response_collection_inner_spec.rb @@ -0,0 +1,214 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListWorkflows200ResponseCollectionInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListWorkflows200ResponseCollectionInner do + let(:instance) { EmbedWorkflow::ListWorkflows200ResponseCollectionInner.new } + + describe 'test an instance of ListWorkflows200ResponseCollectionInner' do + it 'should create an instance of ListWorkflows200ResponseCollectionInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListWorkflows200ResponseCollectionInner) + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "action_type_ids"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "event_trigger"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "event_trigger_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "executions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "has_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "is_managed"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_executed_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_executed_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_executed_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_published_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_published_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_published_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "match_conditions"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "match_conditions_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "on"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["on", "off"]) + # validator.allowable_values.each do |value| + # expect { instance.status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "trigger_conditions"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "trigger_conditions_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "updated_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "updated_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "updated_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/list_workflows200_response_spec.rb b/spec/models/list_workflows200_response_spec.rb new file mode 100644 index 0000000..e1198a8 --- /dev/null +++ b/spec/models/list_workflows200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::ListWorkflows200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::ListWorkflows200Response do + let(:instance) { EmbedWorkflow::ListWorkflows200Response.new } + + describe 'test an instance of ListWorkflows200Response' do + it 'should create an instance of ListWorkflows200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::ListWorkflows200Response) + end + end + + describe 'test attribute "collection"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/publish_workflow_request_spec.rb b/spec/models/publish_workflow_request_spec.rb new file mode 100644 index 0000000..4fcfaab --- /dev/null +++ b/spec/models/publish_workflow_request_spec.rb @@ -0,0 +1,36 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::PublishWorkflowRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::PublishWorkflowRequest do + let(:instance) { EmbedWorkflow::PublishWorkflowRequest.new } + + describe 'test an instance of PublishWorkflowRequest' do + it 'should create an instance of PublishWorkflowRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::PublishWorkflowRequest) + end + end + + describe 'test attribute "user_key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/retrieve_account200_response_spec.rb b/spec/models/retrieve_account200_response_spec.rb new file mode 100644 index 0000000..2c71c75 --- /dev/null +++ b/spec/models/retrieve_account200_response_spec.rb @@ -0,0 +1,120 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::RetrieveAccount200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::RetrieveAccount200Response do + let(:instance) { EmbedWorkflow::RetrieveAccount200Response.new } + + describe 'test an instance of RetrieveAccount200Response' do + it 'should create an instance of RetrieveAccount200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::RetrieveAccount200Response) + end + end + + describe 'test attribute "action_type_categories"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "action_type_categories_enabled"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "company_name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "custom_domain"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "level"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "theme"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "time_zone"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "user_name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "user_time_zone"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "data_schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "user_data_schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/retrieve_account_usage200_response_spec.rb b/spec/models/retrieve_account_usage200_response_spec.rb new file mode 100644 index 0000000..f67b84b --- /dev/null +++ b/spec/models/retrieve_account_usage200_response_spec.rb @@ -0,0 +1,72 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::RetrieveAccountUsage200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::RetrieveAccountUsage200Response do + let(:instance) { EmbedWorkflow::RetrieveAccountUsage200Response.new } + + describe 'test an instance of RetrieveAccountUsage200Response' do + it 'should create an instance of RetrieveAccountUsage200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::RetrieveAccountUsage200Response) + end + end + + describe 'test attribute "active_workflows_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "end_time"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "executions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "usage"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "users_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/retrieve_available_app200_response_spec.rb b/spec/models/retrieve_available_app200_response_spec.rb new file mode 100644 index 0000000..fc72e52 --- /dev/null +++ b/spec/models/retrieve_available_app200_response_spec.rb @@ -0,0 +1,84 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::RetrieveAvailableApp200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::RetrieveAvailableApp200Response do + let(:instance) { EmbedWorkflow::RetrieveAvailableApp200Response.new } + + describe 'test an instance of RetrieveAvailableApp200Response' do + it 'should create an instance of RetrieveAvailableApp200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::RetrieveAvailableApp200Response) + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "app_identifier"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "icon"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "latest_version"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "primary_category"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "secondary_category"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/retrieve_execution200_response_spec.rb b/spec/models/retrieve_execution200_response_spec.rb new file mode 100644 index 0000000..086da0e --- /dev/null +++ b/spec/models/retrieve_execution200_response_spec.rb @@ -0,0 +1,144 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::RetrieveExecution200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::RetrieveExecution200Response do + let(:instance) { EmbedWorkflow::RetrieveExecution200Response.new } + + describe 'test an instance of RetrieveExecution200Response' do + it 'should create an instance of RetrieveExecution200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::RetrieveExecution200Response) + end + end + + describe 'test attribute "hashid"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "completed_actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_string"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at_utc"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "execution_data"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "failed_actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "idle_actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "log"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "running_actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "stats"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "stopped_actions_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "template"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/retry_action_request_spec.rb b/spec/models/retry_action_request_spec.rb new file mode 100644 index 0000000..a6e66f0 --- /dev/null +++ b/spec/models/retry_action_request_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::RetryActionRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::RetryActionRequest do + let(:instance) { EmbedWorkflow::RetryActionRequest.new } + + describe 'test an instance of RetryActionRequest' do + it 'should create an instance of RetryActionRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::RetryActionRequest) + end + end + + describe 'test attribute "user_key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "hook_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/stop_executions_request_spec.rb b/spec/models/stop_executions_request_spec.rb new file mode 100644 index 0000000..df15b06 --- /dev/null +++ b/spec/models/stop_executions_request_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::StopExecutionsRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::StopExecutionsRequest do + let(:instance) { EmbedWorkflow::StopExecutionsRequest.new } + + describe 'test an instance of StopExecutionsRequest' do + it 'should create an instance of StopExecutionsRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::StopExecutionsRequest) + end + end + + describe 'test attribute "user_key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "filters"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/trigger_workflow_request_spec.rb b/spec/models/trigger_workflow_request_spec.rb new file mode 100644 index 0000000..3846269 --- /dev/null +++ b/spec/models/trigger_workflow_request_spec.rb @@ -0,0 +1,60 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::TriggerWorkflowRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::TriggerWorkflowRequest do + let(:instance) { EmbedWorkflow::TriggerWorkflowRequest.new } + + describe 'test an instance of TriggerWorkflowRequest' do + it 'should create an instance of TriggerWorkflowRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::TriggerWorkflowRequest) + end + end + + describe 'test attribute "user_key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "execution_data"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "event"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "workflow_ids"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "workflow_keys"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/update_account_request_action_type_categories_inner_icon_spec.rb b/spec/models/update_account_request_action_type_categories_inner_icon_spec.rb new file mode 100644 index 0000000..5302dc4 --- /dev/null +++ b/spec/models/update_account_request_action_type_categories_inner_icon_spec.rb @@ -0,0 +1,48 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInnerIcon +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInnerIcon do + let(:instance) { EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInnerIcon.new } + + describe 'test an instance of UpdateAccountRequestActionTypeCategoriesInnerIcon' do + it 'should create an instance of UpdateAccountRequestActionTypeCategoriesInnerIcon' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInnerIcon) + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "background_color"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "url"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/update_account_request_action_type_categories_inner_spec.rb b/spec/models/update_account_request_action_type_categories_inner_spec.rb new file mode 100644 index 0000000..a8fcb0d --- /dev/null +++ b/spec/models/update_account_request_action_type_categories_inner_spec.rb @@ -0,0 +1,54 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInner do + let(:instance) { EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInner.new } + + describe 'test an instance of UpdateAccountRequestActionTypeCategoriesInner' do + it 'should create an instance of UpdateAccountRequestActionTypeCategoriesInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::UpdateAccountRequestActionTypeCategoriesInner) + end + end + + describe 'test attribute "key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "icon"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/update_account_request_spec.rb b/spec/models/update_account_request_spec.rb new file mode 100644 index 0000000..cbabc00 --- /dev/null +++ b/spec/models/update_account_request_spec.rb @@ -0,0 +1,96 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::UpdateAccountRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::UpdateAccountRequest do + let(:instance) { EmbedWorkflow::UpdateAccountRequest.new } + + describe 'test an instance of UpdateAccountRequest' do + it 'should create an instance of UpdateAccountRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::UpdateAccountRequest) + end + end + + describe 'test attribute "company_name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "user_name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "theme"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "time_zone"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "custom_domain"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "action_type_categories_enabled"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "action_type_categories"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "user_data_schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "data_schema"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/update_account_request_user_data_schema_inner_spec.rb b/spec/models/update_account_request_user_data_schema_inner_spec.rb new file mode 100644 index 0000000..52ab1f5 --- /dev/null +++ b/spec/models/update_account_request_user_data_schema_inner_spec.rb @@ -0,0 +1,60 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::UpdateAccountRequestUserDataSchemaInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::UpdateAccountRequestUserDataSchemaInner do + let(:instance) { EmbedWorkflow::UpdateAccountRequestUserDataSchemaInner.new } + + describe 'test an instance of UpdateAccountRequestUserDataSchemaInner' do + it 'should create an instance of UpdateAccountRequestUserDataSchemaInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::UpdateAccountRequestUserDataSchemaInner) + end + end + + describe 'test attribute "variable"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "data_path"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "required"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/update_action_type_request_spec.rb b/spec/models/update_action_type_request_spec.rb new file mode 100644 index 0000000..c12de08 --- /dev/null +++ b/spec/models/update_action_type_request_spec.rb @@ -0,0 +1,132 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::UpdateActionTypeRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::UpdateActionTypeRequest do + let(:instance) { EmbedWorkflow::UpdateActionTypeRequest.new } + + describe 'test an instance of UpdateActionTypeRequest' do + it 'should create an instance of UpdateActionTypeRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::UpdateActionTypeRequest) + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "on"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "params_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "headers_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "url_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "http_method_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "code_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "form_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "response_data_schema_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "icon_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "primary_category"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "secondary_category"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "wait_for_callback"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "callback_timeout_n"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "callback_timeout_unit"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/update_installed_app_request_spec.rb b/spec/models/update_installed_app_request_spec.rb new file mode 100644 index 0000000..9ccb26f --- /dev/null +++ b/spec/models/update_installed_app_request_spec.rb @@ -0,0 +1,36 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::UpdateInstalledAppRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::UpdateInstalledAppRequest do + let(:instance) { EmbedWorkflow::UpdateInstalledAppRequest.new } + + describe 'test an instance of UpdateInstalledAppRequest' do + it 'should create an instance of UpdateInstalledAppRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::UpdateInstalledAppRequest) + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/update_trigger_request_spec.rb b/spec/models/update_trigger_request_spec.rb new file mode 100644 index 0000000..d96e258 --- /dev/null +++ b/spec/models/update_trigger_request_spec.rb @@ -0,0 +1,42 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::UpdateTriggerRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::UpdateTriggerRequest do + let(:instance) { EmbedWorkflow::UpdateTriggerRequest.new } + + describe 'test an instance of UpdateTriggerRequest' do + it 'should create an instance of UpdateTriggerRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::UpdateTriggerRequest) + end + end + + describe 'test attribute "event"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/update_workflow_request_spec.rb b/spec/models/update_workflow_request_spec.rb new file mode 100644 index 0000000..d4c3bdc --- /dev/null +++ b/spec/models/update_workflow_request_spec.rb @@ -0,0 +1,96 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::UpdateWorkflowRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::UpdateWorkflowRequest do + let(:instance) { EmbedWorkflow::UpdateWorkflowRequest.new } + + describe 'test an instance of UpdateWorkflowRequest' do + it 'should create an instance of UpdateWorkflowRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::UpdateWorkflowRequest) + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "auto_clone_for_new_users"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "is_template"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "on"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "details"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "template_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "trigger_conditions_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "event_trigger_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "match_conditions_draft"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/upsert_user_request_spec.rb b/spec/models/upsert_user_request_spec.rb new file mode 100644 index 0000000..b80b2b6 --- /dev/null +++ b/spec/models/upsert_user_request_spec.rb @@ -0,0 +1,60 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for EmbedWorkflow::UpsertUserRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe EmbedWorkflow::UpsertUserRequest do + let(:instance) { EmbedWorkflow::UpsertUserRequest.new } + + describe 'test an instance of UpsertUserRequest' do + it 'should create an instance of UpsertUserRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(EmbedWorkflow::UpsertUserRequest) + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "email"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "time_zone"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..afa2531 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,111 @@ +=begin +#API V1 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.2.0 + +=end + +# load the gem +require 'embed_workflow' + +# The following was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end diff --git a/spec/users_spec.rb b/spec/users_spec.rb deleted file mode 100644 index bf40f16..0000000 --- a/spec/users_spec.rb +++ /dev/null @@ -1,165 +0,0 @@ -# frozen_string_literal: true - -require_relative "../lib/embed_workflow" -require "net/http" - -describe "users" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:execute_request) - .with(instance_of(Net::HTTPRequest)) - .and_return("response") - end - - describe "#list" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:get_request) - .with({ path: "/api/v1/users", params: {} }) - .and_return("response") - end - - it "sends the correct parameters to the users API" do - EmbedWorkflow::Users.list - end - - context "with pagination parameters" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:get_request) - .with({ path: "/api/v1/users", params: { starting_after: "550e8400-e29b-41d4-a716-446655440000", limit: 10 } }) - .and_return("response") - end - - it "sends the correct pagination parameters" do - EmbedWorkflow::Users.list(starting_after: "550e8400-e29b-41d4-a716-446655440000", limit: 10) - end - end - end - - describe "#fetch" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:get_request) - .with({ path: "/api/v1/users/api-user-1" }) - .and_return("response") - end - - it "sends the correct parameters to the users API" do - EmbedWorkflow::Users.fetch(key: "api-user-1") - end - end - - describe "#delete" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:delete_request) - .with({ path: "/api/v1/users/api-user-1" }) - .and_return("response") - end - - it "sends the correct parameters to the users API" do - EmbedWorkflow::Users.delete(key: "api-user-1") - end - end - - describe "#upsert" do - context "with minimum parameters" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:put_request) - .with({ - path: "/api/v1/users/api-user-1", - body: { key: "api-user-1" } - }) - .and_return("response") - end - - it "sends the correct parameters to the users API" do - EmbedWorkflow::Users.upsert(key: "api-user-1") - end - end - - context "with all parameters" do - before do - data = { foo: "bar" } - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:put_request) - .with({ - path: "/api/v1/users/api-user-1", - body: { - key: "api-user-1", - name: "Jane Doe", - email: "jane@example.com", - time_zone: "America/New_York", - groups: ["admin", "users"], - data: data - } - }) - .and_return("response") - end - - it "sends the correct parameters to the users API" do - data = { foo: "bar" } - EmbedWorkflow::Users.upsert( - key: "api-user-1", - name: "Jane Doe", - email: "jane@example.com", - time_zone: "America/New_York", - groups: ["admin", "users"], - data: data - ) - end - end - - context "with nil values to unset fields" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:put_request) - .with({ - path: "/api/v1/users/api-user-1", - body: { - key: "api-user-1", - time_zone: nil, - groups: nil - } - }) - .and_return("response") - end - - it "sends nil values to unset time_zone and groups" do - EmbedWorkflow::Users.upsert( - key: "api-user-1", - time_zone: nil, - groups: nil - ) - end - end - - context "with mixed nil and provided values" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:put_request) - .with({ - path: "/api/v1/users/api-user-1", - body: { - key: "api-user-1", - name: "Jane Doe", - email: "jane@example.com", - groups: nil - } - }) - .and_return("response") - end - - it "sends both set and unset values correctly" do - EmbedWorkflow::Users.upsert( - key: "api-user-1", - name: "Jane Doe", - email: "jane@example.com", - groups: nil - ) - end - end - end -end diff --git a/spec/workflows_spec.rb b/spec/workflows_spec.rb deleted file mode 100644 index 0551ae3..0000000 --- a/spec/workflows_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -require_relative "../lib/embed_workflow" -require "net/http" - -describe "workflows" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:execute_request) - .with(instance_of(Net::HTTPRequest)) - .and_return("response") - end - - describe "#list" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:get_request) - .with({ path: "/api/v1/workflows", params: {} }) - .and_return("response") - end - - it "sends the correct parameters to the workflows API" do - EmbedWorkflow::Workflows.list - end - - context "with pagination parameters" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:get_request) - .with({ - path: "/api/v1/workflows", - params: { - starting_after: "550e8400-e29b-41d4-a716-446655440000", - limit: 10 - } - }) - .and_return("response") - end - - it "sends the correct pagination parameters" do - EmbedWorkflow::Workflows.list( - starting_after: "550e8400-e29b-41d4-a716-446655440000", - limit: 10 - ) - end - end - - context "with user_key parameter" do - before do - allow_any_instance_of(EmbedWorkflow::Client) - .to receive(:get_request) - .with({ - path: "/api/v1/workflows", - params: { user_key: "api-user-1" } - }) - .and_return("response") - end - - it "sends the correct user_key parameter" do - EmbedWorkflow::Workflows.list(user_key: "api-user-1") - end - end - end -end From a28a470471f151662a211b88e36fa44480abfb41 Mon Sep 17 00:00:00 2001 From: David Amrani Date: Thu, 25 Jun 2026 11:11:20 -0400 Subject: [PATCH 2/5] fix link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c71aa7..2d9fd4e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # EmbedWorkflow Ruby SDK -Ruby client library for the [EmbedWorkflow API](https://github.com/embedworkflow/embed-workflow-ruby). +Ruby client library for the [EmbedWorkflow API](https://docs.embedworkflow.com/reference). ## Installation From b45f69501b395d3b15e9839c235a6a5d8e960512 Mon Sep 17 00:00:00 2001 From: David Amrani Date: Thu, 25 Jun 2026 11:45:33 -0400 Subject: [PATCH 3/5] rubocop fix --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 0447114..cf9c21e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -49,7 +49,7 @@ Style/HashSyntax: # extra level of indentation. Layout/IndentationConsistency: Enabled: true - EnforcedStyle: indented_internal_methods + EnforcedStyle: rails # Two spaces, no tabs (for indentation). Layout/IndentationWidth: From 659bda7ce5bd1ec86f0f0b83eb8976249d8e5973 Mon Sep 17 00:00:00 2001 From: David Amrani Date: Thu, 25 Jun 2026 11:54:36 -0400 Subject: [PATCH 4/5] disable rubocop for now --- .rubocop.yml | 164 +++------------------------------------------------ 1 file changed, 7 insertions(+), 157 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index cf9c21e..a6ff121 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,161 +1,11 @@ +# Starter config. Cops disabled by default; opt in deliberately as the gem's +# style conventions get established. Most code in this repo is generated by +# OpenAPI Generator (https://github.com/embedworkflow/sdk-generator), so any +# cops enabled here should be ones the generator's output can satisfy — or +# the relevant files should be excluded. AllCops: - TargetRubyVersion: 2.6.8 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. DisabledByDefault: true + NewCops: disable + TargetRubyVersion: 2.6.8 Exclude: - - '**/templates/**/*' - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: true - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: true - EnforcedStyle: always - Exclude: - - 'actionview/test/**/*.builder' - - 'actionview/test/**/*.ruby' - - 'actionpack/test/**/*.builder' - - 'actionpack/test/**/*.ruby' - - 'activestorage/db/migrate/**/*.rb' - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -Style/StringLiterals: - Enabled: true - EnforcedStyle: double_quotes - -# Detect hard tabs, no hard tabs. -Layout/IndentationStyle: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingEmptyLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: true - -Layout/ExtraSpacing: - AllowForAlignment: true - ForceEqualSignAlignment: true - Enabled: true - -# Use quotes for string literals when they are enough. -Style/RedundantPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Layout/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true - -# Prefer Foo.method over Foo::method -Style/ColonMethodCall: - Enabled: true From 294778ea687719ddc487d7faabb17329ad9b8a68 Mon Sep 17 00:00:00 2001 From: David Amrani Date: Thu, 25 Jun 2026 14:11:44 -0400 Subject: [PATCH 5/5] publish command --- .DS_Store | Bin 6148 -> 0 bytes .github/workflows/publish.yml | 15 +++++++++------ .gitignore | 1 + spec/.DS_Store | Bin 6148 -> 0 bytes 4 files changed, 10 insertions(+), 6 deletions(-) delete mode 100644 .DS_Store delete mode 100644 spec/.DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index a3115c08d32c1fe8648c02895c010f17fbb8b140..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKzl#$=7=4qhm-quY8?jK>$}(`^9}v$Ca-brYKR``3mjpL#@I0=t*Gt0{d zvE&mWMUEj3_p*Fw=PDmYnP=yhHleL~UdB!J-u1b;zJ0T}F<$Cr$8fW(^LzPieUNc4 zV}uz7tW!L|F>`%_$2dU7r(><9_zy8BV_2HQ3FF;4v~XMZcEEMdF!I^zT8Z5xXNp0I z^}L?tsdC}uD_J())#Uq^l_o3idflpCPmhZWcFO&82Ya}M9`2!!UMahuWVkbKV;_&G z*NBSM%(*cx@z0XqoI*mcEtW{b7Y8w_<&ASe(NSScXihnPjMYq2n>KOL;}6@VDASsS0_$ds7a zV%K6}kRF;cp+pm^>=i?qaJI*m*R@y}G~rP8@}ca=%HB|v9-aNinhw=980w%vP{3E9 zX?||Y`QPI^yy5=u2ZdijfuO*DrGSc(ezMCc*|W7WIXP=%mWM22!Yd5w5LWg$)(>(N dUt!TkUn~#AuEoM2TWH~rfR-UtL4m)jz;9;{3}yfT diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fedec69..e8eff33 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,10 +8,13 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Release Gem - uses: cadwallion/publish-rubygems-action@master + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Build gem + run: gem build embed_workflow.gemspec + - name: Publish to RubyGems env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}} - RELEASE_COMMAND: ./bin/publish + GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} + run: gem push embed_workflow-*.gem diff --git a/.gitignore b/.gitignore index 2b17855..a83f52c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.gem *.rbc +.DS_Store /.config /coverage/ /InstalledFiles diff --git a/spec/.DS_Store b/spec/.DS_Store deleted file mode 100644 index a0c3517b4a5bf89f76d43c54ee87179ade4c624b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKOHRWu5S?iwREbR&ELb65p%QyS6;99#KnZG*5+xF1p98=JxDZ!h*(0!G%^S~@ z#t>K{RAwam+4HmWq}U!J;`x0!BbpM?1Wk}-Fd(8HG>yzzj4U~3i|eLt2U7f9mF#^? zSJcvNwd(Kx>11cAo1$1&%@Uf)(c|WH_4a(;x0XLx+jT$dE5hi2YHFyY8>;9oS#?xC ze75)3K3l(R*G_WO&29(Z`6T9s z6U+@e#dvg}izNUsgE|VvQcFloFw6}*MOYxLp+F5~D=}EZp%3Pl8+M8sPHe>o+sfPG zh2!eTAEG;PuIRlp;0&Y;jCDGd`~L#J%wUn9hWN}Ga0d2_0nUm=F~>*Q-TLM8