vgen-apimatic-sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +152 -0
  4. data/bin/console +15 -0
  5. data/lib/videogen/api_helper.rb +10 -0
  6. data/lib/videogen/apis/account_api.rb +31 -0
  7. data/lib/videogen/apis/assistant_api.rb +191 -0
  8. data/lib/videogen/apis/base_api.rb +67 -0
  9. data/lib/videogen/apis/entities_api.rb +230 -0
  10. data/lib/videogen/apis/files_api.rb +263 -0
  11. data/lib/videogen/apis/projects_api.rb +355 -0
  12. data/lib/videogen/apis/resources_api.rb +81 -0
  13. data/lib/videogen/apis/text_api.rb +39 -0
  14. data/lib/videogen/apis/tools_api.rb +494 -0
  15. data/lib/videogen/apis/webhooks_api.rb +94 -0
  16. data/lib/videogen/apis/workflows_api.rb +217 -0
  17. data/lib/videogen/client.rb +127 -0
  18. data/lib/videogen/configuration.rb +166 -0
  19. data/lib/videogen/exceptions/api_exception.rb +21 -0
  20. data/lib/videogen/http/api_response.rb +19 -0
  21. data/lib/videogen/http/auth/oauth_2.rb +53 -0
  22. data/lib/videogen/http/http_call_back.rb +10 -0
  23. data/lib/videogen/http/http_method_enum.rb +10 -0
  24. data/lib/videogen/http/http_request.rb +10 -0
  25. data/lib/videogen/http/http_response.rb +10 -0
  26. data/lib/videogen/http/proxy_settings.rb +22 -0
  27. data/lib/videogen/logging/configuration/api_logging_configuration.rb +186 -0
  28. data/lib/videogen/logging/sdk_logger.rb +17 -0
  29. data/lib/videogen/models/act_on_assistant_action_request.rb +77 -0
  30. data/lib/videogen/models/act_on_assistant_action_request_decision.rb +36 -0
  31. data/lib/videogen/models/act_on_assistant_action_response.rb +77 -0
  32. data/lib/videogen/models/add_entity_reference_request.rb +95 -0
  33. data/lib/videogen/models/api_error.rb +137 -0
  34. data/lib/videogen/models/aspect_ratio.rb +105 -0
  35. data/lib/videogen/models/aspect_ratio1.rb +82 -0
  36. data/lib/videogen/models/aspect_ratio2.rb +82 -0
  37. data/lib/videogen/models/aspect_ratio4.rb +83 -0
  38. data/lib/videogen/models/assistant_action.rb +148 -0
  39. data/lib/videogen/models/assistant_action_detail.rb +108 -0
  40. data/lib/videogen/models/assistant_action_detail1.rb +117 -0
  41. data/lib/videogen/models/assistant_action_kind.rb +52 -0
  42. data/lib/videogen/models/assistant_message.rb +167 -0
  43. data/lib/videogen/models/assistant_message1.rb +259 -0
  44. data/lib/videogen/models/assistant_message_attachment.rb +101 -0
  45. data/lib/videogen/models/assistant_message_status.rb +49 -0
  46. data/lib/videogen/models/assistant_workflow_suggestion.rb +133 -0
  47. data/lib/videogen/models/base_model.rb +110 -0
  48. data/lib/videogen/models/content_policy_config.rb +80 -0
  49. data/lib/videogen/models/create_entity_request.rb +96 -0
  50. data/lib/videogen/models/create_entity_request_entity_type.rb +47 -0
  51. data/lib/videogen/models/create_file_upload_request.rb +125 -0
  52. data/lib/videogen/models/create_timeline_interchange_request.rb +93 -0
  53. data/lib/videogen/models/create_timeline_interchange_response.rb +76 -0
  54. data/lib/videogen/models/create_webhook_endpoint_request.rb +94 -0
  55. data/lib/videogen/models/end_screen_mode.rb +43 -0
  56. data/lib/videogen/models/entity.rb +166 -0
  57. data/lib/videogen/models/entity_actor_config.rb +101 -0
  58. data/lib/videogen/models/entity_archive_response.rb +82 -0
  59. data/lib/videogen/models/entity_entity_type.rb +47 -0
  60. data/lib/videogen/models/entity_reference.rb +93 -0
  61. data/lib/videogen/models/error_requirement.rb +101 -0
  62. data/lib/videogen/models/executed_tool.rb +148 -0
  63. data/lib/videogen/models/export_delivery_destination.rb +110 -0
  64. data/lib/videogen/models/export_delivery_destination_type.rb +36 -0
  65. data/lib/videogen/models/export_project_quality.rb +44 -0
  66. data/lib/videogen/models/export_project_request.rb +124 -0
  67. data/lib/videogen/models/export_project_response.rb +76 -0
  68. data/lib/videogen/models/file_analysis_metadata.rb +112 -0
  69. data/lib/videogen/models/file_analysis_metadata1.rb +112 -0
  70. data/lib/videogen/models/file_analysis_metadata_analysis_loading_state.rb +48 -0
  71. data/lib/videogen/models/file_info.rb +386 -0
  72. data/lib/videogen/models/file_info1.rb +387 -0
  73. data/lib/videogen/models/file_info_scope.rb +54 -0
  74. data/lib/videogen/models/file_source.rb +134 -0
  75. data/lib/videogen/models/file_source_status.rb +46 -0
  76. data/lib/videogen/models/file_type.rb +57 -0
  77. data/lib/videogen/models/file_type1.rb +56 -0
  78. data/lib/videogen/models/file_type2.rb +57 -0
  79. data/lib/videogen/models/file_upload_response.rb +82 -0
  80. data/lib/videogen/models/generate_avatar_request.rb +149 -0
  81. data/lib/videogen/models/generate_image_request.rb +187 -0
  82. data/lib/videogen/models/generate_motion_graphic_request.rb +193 -0
  83. data/lib/videogen/models/generate_music_request.rb +111 -0
  84. data/lib/videogen/models/generate_sound_effect_request.rb +139 -0
  85. data/lib/videogen/models/generate_text_request.rb +120 -0
  86. data/lib/videogen/models/generate_text_response.rb +72 -0
  87. data/lib/videogen/models/generate_video_clip_request.rb +297 -0
  88. data/lib/videogen/models/get_assistant_response.rb +135 -0
  89. data/lib/videogen/models/get_files_response.rb +102 -0
  90. data/lib/videogen/models/image_asset_request.rb +125 -0
  91. data/lib/videogen/models/job_status.rb +51 -0
  92. data/lib/videogen/models/language.rb +83 -0
  93. data/lib/videogen/models/language_list_response.rb +83 -0
  94. data/lib/videogen/models/list_entities_response.rb +103 -0
  95. data/lib/videogen/models/list_project_exports_response.rb +104 -0
  96. data/lib/videogen/models/list_projects_response.rb +105 -0
  97. data/lib/videogen/models/list_remix_actions_response.rb +103 -0
  98. data/lib/videogen/models/me_response.rb +114 -0
  99. data/lib/videogen/models/model_quality.rb +51 -0
  100. data/lib/videogen/models/model_quality1.rb +47 -0
  101. data/lib/videogen/models/model_quality10.rb +46 -0
  102. data/lib/videogen/models/model_quality11.rb +46 -0
  103. data/lib/videogen/models/model_quality12.rb +45 -0
  104. data/lib/videogen/models/model_quality13.rb +46 -0
  105. data/lib/videogen/models/model_quality2.rb +46 -0
  106. data/lib/videogen/models/model_quality3.rb +46 -0
  107. data/lib/videogen/models/model_quality4.rb +48 -0
  108. data/lib/videogen/models/model_quality9.rb +47 -0
  109. data/lib/videogen/models/motion_graphic_sub_tool_mode.rb +44 -0
  110. data/lib/videogen/models/motion_graphic_sub_tool_mode1.rb +40 -0
  111. data/lib/videogen/models/motion_graphic_sub_tool_mode2.rb +41 -0
  112. data/lib/videogen/models/motion_graphic_sub_tool_mode3.rb +40 -0
  113. data/lib/videogen/models/motion_graphic_sub_tool_mode4.rb +40 -0
  114. data/lib/videogen/models/motion_graphic_sub_tool_modes.rb +114 -0
  115. data/lib/videogen/models/motion_graphic_sub_tool_modes1.rb +116 -0
  116. data/lib/videogen/models/project_export.rb +207 -0
  117. data/lib/videogen/models/project_response.rb +151 -0
  118. data/lib/videogen/models/project_response_status.rb +36 -0
  119. data/lib/videogen/models/prompt_to_video_clip_request.rb +155 -0
  120. data/lib/videogen/models/pronunciation_replacement.rb +82 -0
  121. data/lib/videogen/models/remix_action.rb +111 -0
  122. data/lib/videogen/models/remix_action1.rb +123 -0
  123. data/lib/videogen/models/remix_action10.rb +115 -0
  124. data/lib/videogen/models/remix_action11.rb +148 -0
  125. data/lib/videogen/models/remix_action12.rb +89 -0
  126. data/lib/videogen/models/remix_action13.rb +105 -0
  127. data/lib/videogen/models/remix_action14.rb +138 -0
  128. data/lib/videogen/models/remix_action2.rb +101 -0
  129. data/lib/videogen/models/remix_action3.rb +85 -0
  130. data/lib/videogen/models/remix_action4.rb +120 -0
  131. data/lib/videogen/models/remix_action5.rb +88 -0
  132. data/lib/videogen/models/remix_action6.rb +106 -0
  133. data/lib/videogen/models/remix_action7.rb +137 -0
  134. data/lib/videogen/models/remix_action8.rb +131 -0
  135. data/lib/videogen/models/remix_action9.rb +120 -0
  136. data/lib/videogen/models/remix_action_discriminator_mapping_set_logo_position.rb +53 -0
  137. data/lib/videogen/models/remix_action_run.rb +150 -0
  138. data/lib/videogen/models/remix_action_type.rb +88 -0
  139. data/lib/videogen/models/remix_project_request.rb +105 -0
  140. data/lib/videogen/models/remix_project_response.rb +101 -0
  141. data/lib/videogen/models/remix_transition_style.rb +58 -0
  142. data/lib/videogen/models/remove_entity_reference_request.rb +73 -0
  143. data/lib/videogen/models/scene_description_range.rb +121 -0
  144. data/lib/videogen/models/script_to_video_request.rb +309 -0
  145. data/lib/videogen/models/search_files_request.rb +96 -0
  146. data/lib/videogen/models/search_files_response.rb +82 -0
  147. data/lib/videogen/models/search_files_result.rb +85 -0
  148. data/lib/videogen/models/send_assistant_message_request.rb +73 -0
  149. data/lib/videogen/models/send_assistant_message_response.rb +76 -0
  150. data/lib/videogen/models/slideshow_to_video_request.rb +276 -0
  151. data/lib/videogen/models/start_assistant_chat_request.rb +88 -0
  152. data/lib/videogen/models/start_assistant_chat_response.rb +105 -0
  153. data/lib/videogen/models/start_tool_execution_response.rb +76 -0
  154. data/lib/videogen/models/start_workflow_run_response.rb +141 -0
  155. data/lib/videogen/models/text_to_speech_request.rb +191 -0
  156. data/lib/videogen/models/timeline_interchange.rb +210 -0
  157. data/lib/videogen/models/timeline_interchange_format.rb +47 -0
  158. data/lib/videogen/models/timeline_interchange_media_delivery.rb +39 -0
  159. data/lib/videogen/models/tool_execution_list_response.rb +104 -0
  160. data/lib/videogen/models/tool_success_result.rb +152 -0
  161. data/lib/videogen/models/transcript.rb +97 -0
  162. data/lib/videogen/models/transcript_word.rb +93 -0
  163. data/lib/videogen/models/tts_voice.rb +162 -0
  164. data/lib/videogen/models/tts_voice_display_gender.rb +40 -0
  165. data/lib/videogen/models/tts_voice_list_response.rb +103 -0
  166. data/lib/videogen/models/update_entity_request.rb +88 -0
  167. data/lib/videogen/models/v1_entities_get_parameters_entity_type.rb +44 -0
  168. data/lib/videogen/models/video_asset_request.rb +125 -0
  169. data/lib/videogen/models/visual_pacing.rb +41 -0
  170. data/lib/videogen/models/voiceover_to_video_request.rb +297 -0
  171. data/lib/videogen/models/watermark_mode.rb +43 -0
  172. data/lib/videogen/models/webhook_endpoint.rb +137 -0
  173. data/lib/videogen/models/webhook_endpoint_list_response.rb +103 -0
  174. data/lib/videogen/models/webhook_event_name.rb +100 -0
  175. data/lib/videogen/models/workflow_caption_background_style.rb +133 -0
  176. data/lib/videogen/models/workflow_caption_background_style_type.rb +41 -0
  177. data/lib/videogen/models/workflow_caption_style.rb +220 -0
  178. data/lib/videogen/models/workflow_caption_style_font_weight.rb +64 -0
  179. data/lib/videogen/models/workflow_caption_style_text_justification.rb +40 -0
  180. data/lib/videogen/models/workflow_caption_style_vertical_alignment.rb +40 -0
  181. data/lib/videogen/models/workflow_rgb_color.rb +116 -0
  182. data/lib/videogen/models/workflow_run.rb +150 -0
  183. data/lib/videogen/models/workflow_run_list_response.rb +103 -0
  184. data/lib/videogen/models/workflow_type.rb +52 -0
  185. data/lib/videogen/models/workflow_type1.rb +52 -0
  186. data/lib/videogen/models/workflow_visual_style.rb +136 -0
  187. data/lib/videogen/models/workflow_visual_style_type.rb +38 -0
  188. data/lib/videogen/utilities/date_time_helper.rb +11 -0
  189. data/lib/videogen/utilities/file_wrapper.rb +28 -0
  190. data/lib/videogen/utilities/union_type_lookup.rb +188 -0
  191. data/lib/videogen.rb +213 -0
  192. metadata +275 -0
@@ -0,0 +1,217 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # WorkflowsApi
8
+ class WorkflowsApi < BaseApi
9
+ # Creates a project and generates a narrated video from a prompt or script.
10
+ # Returns immediately with a workflow run id; poll or subscribe to webhooks
11
+ # for completion.
12
+ # @param [String] authorization Required parameter: API key from
13
+ # [app.videogen.io/api](https://app.videogen.io/api). The full key is only
14
+ # shown once when you create it.
15
+ # @param [ScriptToVideoRequest] body Optional parameter: TODO: type
16
+ # description here
17
+ # @return [ApiResponse] Complete http response with raw body and status code.
18
+ def script_to_video(authorization,
19
+ body: nil)
20
+ @api_call
21
+ .request(new_request_builder(HttpMethodEnum::POST,
22
+ '/v1/workflows/script-to-video',
23
+ Server::DEFAULT)
24
+ .header_param(new_parameter(authorization, key: 'Authorization')
25
+ .is_required(true))
26
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
27
+ .body_param(new_parameter(body))
28
+ .header_param(new_parameter('application/json', key: 'accept'))
29
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
30
+ .response(new_response_handler
31
+ .deserializer(APIHelper.method(:custom_type_deserializer))
32
+ .deserialize_into(StartWorkflowRunResponse.method(:from_hash))
33
+ .is_api_response(true))
34
+ .execute
35
+ end
36
+
37
+ # Creates a project from an uploaded voiceover file and generates a video
38
+ # with matching b-roll. Upload the voiceover via the files API first.
39
+ # @param [String] authorization Required parameter: API key from
40
+ # [app.videogen.io/api](https://app.videogen.io/api). The full key is only
41
+ # shown once when you create it.
42
+ # @param [VoiceoverToVideoRequest] body Optional parameter: TODO: type
43
+ # description here
44
+ # @return [ApiResponse] Complete http response with raw body and status code.
45
+ def voiceover_to_video(authorization,
46
+ body: nil)
47
+ @api_call
48
+ .request(new_request_builder(HttpMethodEnum::POST,
49
+ '/v1/workflows/voiceover-to-video',
50
+ Server::DEFAULT)
51
+ .header_param(new_parameter(authorization, key: 'Authorization')
52
+ .is_required(true))
53
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
54
+ .body_param(new_parameter(body))
55
+ .header_param(new_parameter('application/json', key: 'accept'))
56
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
57
+ .response(new_response_handler
58
+ .deserializer(APIHelper.method(:custom_type_deserializer))
59
+ .deserialize_into(StartWorkflowRunResponse.method(:from_hash))
60
+ .is_api_response(true))
61
+ .execute
62
+ end
63
+
64
+ # Creates a project from an uploaded PDF or PowerPoint file and generates an
65
+ # AI-narrated video walking through each slide. Upload the file via `POST
66
+ # /v1/files/upload` first.
67
+ # @param [String] authorization Required parameter: API key from
68
+ # [app.videogen.io/api](https://app.videogen.io/api). The full key is only
69
+ # shown once when you create it.
70
+ # @param [SlideshowToVideoRequest] body Optional parameter: TODO: type
71
+ # description here
72
+ # @return [ApiResponse] Complete http response with raw body and status code.
73
+ def slideshow_to_video(authorization,
74
+ body: nil)
75
+ @api_call
76
+ .request(new_request_builder(HttpMethodEnum::POST,
77
+ '/v1/workflows/slideshow-to-video',
78
+ Server::DEFAULT)
79
+ .header_param(new_parameter(authorization, key: 'Authorization')
80
+ .is_required(true))
81
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
82
+ .body_param(new_parameter(body))
83
+ .header_param(new_parameter('application/json', key: 'accept'))
84
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
85
+ .response(new_response_handler
86
+ .deserializer(APIHelper.method(:custom_type_deserializer))
87
+ .deserialize_into(StartWorkflowRunResponse.method(:from_hash))
88
+ .is_api_response(true))
89
+ .execute
90
+ end
91
+
92
+ # Creates a project from a text prompt and generates one short AI video clip
93
+ # (up to 30 seconds). VideoGen first generates an opening frame from the
94
+ # prompt (optionally guided by reference images), then animates that frame
95
+ # into a video. Returns immediately with a workflow run id; poll or
96
+ # subscribe to webhooks for completion. For a standalone clip without an
97
+ # editable project, use `POST /v1/tools/generate-video-clip` instead. For
98
+ # longer narrated multi-scene videos, use `POST
99
+ # /v1/workflows/script-to-video`. The generated clip is clamped to the
100
+ # selected quality's supported range.
101
+ # @param [String] authorization Required parameter: API key from
102
+ # [app.videogen.io/api](https://app.videogen.io/api). The full key is only
103
+ # shown once when you create it.
104
+ # @param [PromptToVideoClipRequest] body Optional parameter: TODO: type
105
+ # description here
106
+ # @return [ApiResponse] Complete http response with raw body and status code.
107
+ def prompt_to_video_clip(authorization,
108
+ body: nil)
109
+ @api_call
110
+ .request(new_request_builder(HttpMethodEnum::POST,
111
+ '/v1/workflows/prompt-to-video-clip',
112
+ Server::DEFAULT)
113
+ .header_param(new_parameter(authorization, key: 'Authorization')
114
+ .is_required(true))
115
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
116
+ .body_param(new_parameter(body))
117
+ .header_param(new_parameter('application/json', key: 'accept'))
118
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
119
+ .response(new_response_handler
120
+ .deserializer(APIHelper.method(:custom_type_deserializer))
121
+ .deserialize_into(StartWorkflowRunResponse.method(:from_hash))
122
+ .is_api_response(true))
123
+ .execute
124
+ end
125
+
126
+ # List workflow runs started via the API, most recently created first. Use
127
+ # `selfOnly=true` to restrict results to the calling API key's user;
128
+ # otherwise all runs for the team are returned. Cursor-paginated; see the
129
+ # [Pagination](/pagination) guide.
130
+ # @param [String] authorization Required parameter: API key from
131
+ # [app.videogen.io/api](https://app.videogen.io/api). The full key is only
132
+ # shown once when you create it.
133
+ # @param [Integer] limit Optional parameter: Maximum number of items to
134
+ # return in the page. Defaults to 50; capped at 200. See
135
+ # [Pagination](/pagination).
136
+ # @param [String] cursor Optional parameter: Opaque pagination cursor
137
+ # returned as `nextCursor` by the previous page. Omit on the first request.
138
+ # Cursors are tied to the endpoint that produced them and must be passed
139
+ # unmodified. See [Pagination](/pagination).
140
+ # @param [TrueClass | FalseClass] self_only Optional parameter: When true,
141
+ # returns only items created by the API key's owner. When false (default),
142
+ # returns all items accessible to the team.
143
+ # @return [ApiResponse] Complete http response with raw body and status code.
144
+ def list_workflow_runs(authorization,
145
+ limit: 50,
146
+ cursor: nil,
147
+ self_only: false)
148
+ @api_call
149
+ .request(new_request_builder(HttpMethodEnum::GET,
150
+ '/v1/workflows/runs',
151
+ Server::DEFAULT)
152
+ .header_param(new_parameter(authorization, key: 'Authorization')
153
+ .is_required(true))
154
+ .query_param(new_parameter(limit, key: 'limit'))
155
+ .query_param(new_parameter(cursor, key: 'cursor'))
156
+ .query_param(new_parameter(self_only, key: 'selfOnly'))
157
+ .header_param(new_parameter('application/json', key: 'accept')))
158
+ .response(new_response_handler
159
+ .deserializer(APIHelper.method(:custom_type_deserializer))
160
+ .deserialize_into(WorkflowRunListResponse.method(:from_hash))
161
+ .is_api_response(true))
162
+ .execute
163
+ end
164
+
165
+ # TODO: type endpoint description here
166
+ # @param [String] workflow_run_id Required parameter: The workflow run id
167
+ # returned when the workflow was started.
168
+ # @param [String] authorization Required parameter: API key from
169
+ # [app.videogen.io/api](https://app.videogen.io/api). The full key is only
170
+ # shown once when you create it.
171
+ # @return [ApiResponse] Complete http response with raw body and status code.
172
+ def get_workflow_run(workflow_run_id,
173
+ authorization)
174
+ @api_call
175
+ .request(new_request_builder(HttpMethodEnum::GET,
176
+ '/v1/workflows/runs/{workflowRunId}',
177
+ Server::DEFAULT)
178
+ .template_param(new_parameter(workflow_run_id, key: 'workflowRunId')
179
+ .is_required(true)
180
+ .should_encode(true))
181
+ .header_param(new_parameter(authorization, key: 'Authorization')
182
+ .is_required(true))
183
+ .header_param(new_parameter('application/json', key: 'accept')))
184
+ .response(new_response_handler
185
+ .deserializer(APIHelper.method(:custom_type_deserializer))
186
+ .deserialize_into(WorkflowRun.method(:from_hash))
187
+ .is_api_response(true))
188
+ .execute
189
+ end
190
+
191
+ # TODO: type endpoint description here
192
+ # @param [String] workflow_run_id Required parameter: The workflow run id
193
+ # returned when the workflow was started.
194
+ # @param [String] authorization Required parameter: API key from
195
+ # [app.videogen.io/api](https://app.videogen.io/api). The full key is only
196
+ # shown once when you create it.
197
+ # @return [ApiResponse] Complete http response with raw body and status code.
198
+ def cancel_workflow_run(workflow_run_id,
199
+ authorization)
200
+ @api_call
201
+ .request(new_request_builder(HttpMethodEnum::POST,
202
+ '/v1/workflows/runs/{workflowRunId}/cancel',
203
+ Server::DEFAULT)
204
+ .template_param(new_parameter(workflow_run_id, key: 'workflowRunId')
205
+ .is_required(true)
206
+ .should_encode(true))
207
+ .header_param(new_parameter(authorization, key: 'Authorization')
208
+ .is_required(true))
209
+ .header_param(new_parameter('application/json', key: 'accept')))
210
+ .response(new_response_handler
211
+ .deserializer(APIHelper.method(:custom_type_deserializer))
212
+ .deserialize_into(StartWorkflowRunResponse.method(:from_hash))
213
+ .is_api_response(true))
214
+ .execute
215
+ end
216
+ end
217
+ end
@@ -0,0 +1,127 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # videogen client class.
8
+ class Client
9
+ include CoreLibrary
10
+ attr_reader :config, :auth_managers
11
+
12
+ def user_agent_detail
13
+ config.user_agent_detail
14
+ end
15
+
16
+ # Access to workflows controller.
17
+ # @return [WorkflowsApi] Returns the controller instance.
18
+ def workflows
19
+ @workflows ||= WorkflowsApi.new @global_configuration
20
+ end
21
+
22
+ # Access to projects controller.
23
+ # @return [ProjectsApi] Returns the controller instance.
24
+ def projects
25
+ @projects ||= ProjectsApi.new @global_configuration
26
+ end
27
+
28
+ # Access to assistant controller.
29
+ # @return [AssistantApi] Returns the controller instance.
30
+ def assistant
31
+ @assistant ||= AssistantApi.new @global_configuration
32
+ end
33
+
34
+ # Access to tools controller.
35
+ # @return [ToolsApi] Returns the controller instance.
36
+ def tools
37
+ @tools ||= ToolsApi.new @global_configuration
38
+ end
39
+
40
+ # Access to text controller.
41
+ # @return [TextApi] Returns the controller instance.
42
+ def text
43
+ @text ||= TextApi.new @global_configuration
44
+ end
45
+
46
+ # Access to files controller.
47
+ # @return [FilesApi] Returns the controller instance.
48
+ def files
49
+ @files ||= FilesApi.new @global_configuration
50
+ end
51
+
52
+ # Access to entities controller.
53
+ # @return [EntitiesApi] Returns the controller instance.
54
+ def entities
55
+ @entities ||= EntitiesApi.new @global_configuration
56
+ end
57
+
58
+ # Access to resources controller.
59
+ # @return [ResourcesApi] Returns the controller instance.
60
+ def resources
61
+ @resources ||= ResourcesApi.new @global_configuration
62
+ end
63
+
64
+ # Access to webhooks controller.
65
+ # @return [WebhooksApi] Returns the controller instance.
66
+ def webhooks
67
+ @webhooks ||= WebhooksApi.new @global_configuration
68
+ end
69
+
70
+ # Access to account controller.
71
+ # @return [AccountApi] Returns the controller instance.
72
+ def account
73
+ @account ||= AccountApi.new @global_configuration
74
+ end
75
+
76
+ def initialize(
77
+ connection: nil, adapter: :net_http_persistent, timeout: 30,
78
+ max_retries: 0, retry_interval: 1, backoff_factor: 2,
79
+ retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
80
+ retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
81
+ logging_configuration: nil, environment: Environment::PRODUCTION,
82
+ bearer_auth_credentials: nil, config: nil
83
+ )
84
+ @config = if config.nil?
85
+ Configuration.new(
86
+ connection: connection, adapter: adapter, timeout: timeout,
87
+ max_retries: max_retries, retry_interval: retry_interval,
88
+ backoff_factor: backoff_factor,
89
+ retry_statuses: retry_statuses,
90
+ retry_methods: retry_methods, http_callback: http_callback,
91
+ proxy_settings: proxy_settings,
92
+ logging_configuration: logging_configuration,
93
+ environment: environment,
94
+ bearer_auth_credentials: bearer_auth_credentials
95
+ )
96
+ else
97
+ config
98
+ end
99
+ user_agent_params = BaseApi.user_agent_parameters
100
+
101
+ @global_configuration = GlobalConfiguration.new(client_configuration: @config)
102
+ .base_uri_executor(@config.method(:get_base_uri))
103
+ .global_errors(BaseApi::GLOBAL_ERRORS)
104
+ .user_agent(BaseApi.user_agent,
105
+ agent_parameters: user_agent_params)
106
+
107
+ initialize_auth_managers(@global_configuration)
108
+ @global_configuration = @global_configuration.auth_managers(@auth_managers)
109
+ end
110
+
111
+ # Initializes the auth managers hash used for authenticating API calls.
112
+ # @param [GlobalConfiguration] global_config The global configuration of the SDK)
113
+ def initialize_auth_managers(global_config)
114
+ @auth_managers = {}
115
+ http_client_config = global_config.client_configuration
116
+ %w[bearerAuth].each { |auth| @auth_managers[auth] = nil }
117
+ @auth_managers['bearerAuth'] = Oauth2.new(http_client_config.bearer_auth_credentials)
118
+ end
119
+
120
+ # Creates a client directly from environment variables.
121
+ def self.from_env(**overrides)
122
+ default_config = Configuration.build_default_config_from_env
123
+ new_config = default_config.clone_with(**overrides)
124
+ new(config: new_config)
125
+ end
126
+ end
127
+ end
@@ -0,0 +1,166 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # An enum for SDK environments.
8
+ class Environment
9
+ # PRODUCTION: Production
10
+ ENVIRONMENT = [
11
+ PRODUCTION = 'production'.freeze
12
+ ].freeze
13
+
14
+ # Converts a string or symbol into a valid Environment constant.
15
+ def self.from_value(value, default_value = PRODUCTION)
16
+ return default_value if value.nil?
17
+
18
+ default_value
19
+ end
20
+ end
21
+
22
+ # An enum for API servers.
23
+ class Server
24
+ SERVER = [
25
+ DEFAULT = 'default'.freeze
26
+ ].freeze
27
+
28
+ # Converts a string or symbol into a valid Server constant.
29
+ def self.from_value(value, default_value = DEFAULT)
30
+ return default_value if value.nil?
31
+
32
+ default_value
33
+ end
34
+ end
35
+
36
+ # All configuration including auth info and base URI for the API access
37
+ # are configured in this class.
38
+ class Configuration < CoreLibrary::HttpClientConfiguration
39
+ # The attribute readers for properties.
40
+ attr_reader :environment, :bearer_auth_credentials
41
+
42
+ class << self
43
+ attr_reader :environments
44
+ end
45
+
46
+ def initialize(
47
+ connection: nil, adapter: :net_http_persistent, timeout: 30,
48
+ max_retries: 0, retry_interval: 1, backoff_factor: 2,
49
+ retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
50
+ retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
51
+ logging_configuration: nil, environment: Environment::PRODUCTION,
52
+ bearer_auth_credentials: nil
53
+ )
54
+ super connection: connection, adapter: adapter, timeout: timeout,
55
+ max_retries: max_retries, retry_interval: retry_interval,
56
+ backoff_factor: backoff_factor, retry_statuses: retry_statuses,
57
+ retry_methods: retry_methods, http_callback: http_callback,
58
+ proxy_settings: proxy_settings,
59
+ logging_configuration: logging_configuration
60
+
61
+ # Current API environment
62
+ @environment = String(environment)
63
+
64
+ # The object holding OAuth 2 Bearer token credentials
65
+ @bearer_auth_credentials = bearer_auth_credentials
66
+
67
+ # Initializing OAuth 2 Bearer token credentials with the provided auth parameters
68
+ @bearer_auth_credentials = bearer_auth_credentials
69
+
70
+ # The Http Client to use for making requests.
71
+ set_http_client CoreLibrary::FaradayClient.new(self)
72
+ end
73
+
74
+ def clone_with(connection: nil, adapter: nil, timeout: nil,
75
+ max_retries: nil, retry_interval: nil, backoff_factor: nil,
76
+ retry_statuses: nil, retry_methods: nil, http_callback: nil,
77
+ proxy_settings: nil, logging_configuration: nil,
78
+ environment: nil, bearer_auth_credentials: nil)
79
+ connection ||= self.connection
80
+ adapter ||= self.adapter
81
+ timeout ||= self.timeout
82
+ max_retries ||= self.max_retries
83
+ retry_interval ||= self.retry_interval
84
+ backoff_factor ||= self.backoff_factor
85
+ retry_statuses ||= self.retry_statuses
86
+ retry_methods ||= self.retry_methods
87
+ http_callback ||= self.http_callback
88
+ proxy_settings ||= self.proxy_settings
89
+ logging_configuration ||= self.logging_configuration
90
+ environment ||= self.environment
91
+ bearer_auth_credentials ||= self.bearer_auth_credentials
92
+
93
+ Configuration.new(connection: connection, adapter: adapter,
94
+ timeout: timeout, max_retries: max_retries,
95
+ retry_interval: retry_interval,
96
+ backoff_factor: backoff_factor,
97
+ retry_statuses: retry_statuses,
98
+ retry_methods: retry_methods,
99
+ http_callback: http_callback,
100
+ proxy_settings: proxy_settings,
101
+ logging_configuration: logging_configuration,
102
+ environment: environment,
103
+ bearer_auth_credentials: bearer_auth_credentials)
104
+ end
105
+
106
+
107
+ # All the environments the SDK can run in.
108
+ ENVIRONMENTS = {
109
+ Environment::PRODUCTION => {
110
+ Server::DEFAULT => 'https://api.videogen.io'
111
+ }
112
+ }.freeze
113
+
114
+ # Generates the appropriate base URI for the environment and the server.
115
+ # @param [Configuration::Server] server The server enum for which the base URI is
116
+ # required.
117
+ # @return [String] The base URI.
118
+ def get_base_uri(server = Server::DEFAULT)
119
+ ENVIRONMENTS[environment][server].clone
120
+ end
121
+
122
+ # Builds a Configuration instance using environment variables.
123
+ def self.build_default_config_from_env
124
+ # === Core environment ===
125
+ environment = Environment.from_value(ENV.fetch('ENVIRONMENT', 'production'))
126
+ timeout = (ENV['TIMEOUT'] || 30).to_f
127
+ max_retries = (ENV['MAX_RETRIES'] || 0).to_i
128
+ retry_interval = (ENV['RETRY_INTERVAL'] || 1).to_f
129
+ backoff_factor = (ENV['BACKOFF_FACTOR'] || 2).to_f
130
+ retry_statuses = ENV.fetch('RETRY_STATUSES',
131
+ '[408, 413, 429, 500, 502, 503, 504, 521, 522, 524]').gsub(/[\[\]]/, '')
132
+ .split(',')
133
+ .map(&:strip)
134
+ .map do |item|
135
+ item.match?(/\A\d+\z/) ? item.to_i : item.downcase
136
+ end
137
+ retry_methods = ENV.fetch('RETRY_METHODS', '%i[get put]').gsub(/[\[\]]/, '')
138
+ .split(',')
139
+ .map(&:strip)
140
+ .map do |item|
141
+ item.match?(/\A\d+\z/) ? item.to_i : item.downcase
142
+ end
143
+
144
+ # === Authentication credentials ===
145
+ bearer_auth_credentials = BearerAuthCredentials.from_env
146
+
147
+ # === Proxy settings ===
148
+ proxy_settings = ProxySettings.from_env
149
+ # === Logging Configuration ===
150
+ logging_configuration = LoggingConfiguration.from_env if LoggingConfiguration.any_logging_configured?
151
+
152
+ Configuration.new(
153
+ environment: environment,
154
+ timeout: timeout,
155
+ max_retries: max_retries,
156
+ retry_interval: retry_interval,
157
+ backoff_factor: backoff_factor,
158
+ retry_statuses: retry_statuses,
159
+ retry_methods: retry_methods,
160
+ bearer_auth_credentials: bearer_auth_credentials,
161
+ proxy_settings: proxy_settings,
162
+ logging_configuration: logging_configuration
163
+ )
164
+ end
165
+ end
166
+ end
@@ -0,0 +1,21 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # Class for exceptions when there is a network error, status code error, etc.
8
+ class APIException < CoreLibrary::ApiException
9
+ # Provides a human-readable string representation of the object.
10
+ def to_s
11
+ class_name = self.class.name.split('::').last
12
+ "<#{class_name} status_code: #{@response_code}, reason: #{@reason}>"
13
+ end
14
+
15
+ # Provides a debugging-friendly string with detailed object information.
16
+ def inspect
17
+ class_name = self.class.name.split('::').last
18
+ "<#{class_name} status_code: #{@response_code.inspect}, reason: #{@reason.inspect}>"
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,19 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # Http response received.
8
+ class ApiResponse < CoreLibrary::ApiResponse
9
+ # The constructor
10
+ # @param [HttpResponse] http_response The original, raw response from the api.
11
+ # @param [Object] data The data field specified for the response.
12
+ # @param [Array<String>] errors Any errors returned by the server.
13
+ def initialize(http_response,
14
+ data: nil,
15
+ errors: nil)
16
+ super
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,53 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # Utility class for OAuth 2 authorization and token management.
8
+ class Oauth2 < CoreLibrary::HeaderAuth
9
+ include CoreLibrary
10
+ # Display error message on occurrence of authentication failure.
11
+ # @returns [String] The oAuth error message.
12
+ def error_message
13
+ 'BearerAuth: access_token is undefined.'
14
+ end
15
+
16
+ # Initialization constructor.
17
+ def initialize(bearer_auth_credentials)
18
+ auth_params = {}
19
+ @_access_token = bearer_auth_credentials.access_token unless
20
+ bearer_auth_credentials.nil? || bearer_auth_credentials.access_token.nil?
21
+ auth_params[:Authorization] = "Bearer #{@_access_token}" unless @_access_token.nil?
22
+
23
+ super auth_params
24
+ end
25
+ end
26
+
27
+ # Data class for BearerAuthCredentials.
28
+ class BearerAuthCredentials
29
+ attr_reader :access_token
30
+
31
+ def initialize(access_token:)
32
+ raise ArgumentError, 'access_token cannot be nil' if access_token.nil?
33
+
34
+ @access_token = access_token
35
+ end
36
+
37
+ def self.from_env
38
+ access_token = ENV['ACCESS_TOKEN']
39
+ all_nil = [
40
+ access_token
41
+ ].all?(&:nil?)
42
+ return nil if all_nil
43
+
44
+ new(access_token: access_token)
45
+ end
46
+
47
+ def clone_with(access_token: nil)
48
+ access_token ||= self.access_token
49
+
50
+ BearerAuthCredentials.new(access_token: access_token)
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,10 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # HttpCallBack allows defining callables for pre and post API calls.
8
+ class HttpCallBack < CoreLibrary::HttpCallback
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # HTTP Methods Enumeration.
8
+ class HttpMethodEnum < CoreLibrary::HttpMethod
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # Represents a single Http Request.
8
+ class HttpRequest < CoreLibrary::HttpRequest
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # Http response received.
8
+ class HttpResponse < CoreLibrary::HttpResponse
9
+ end
10
+ end
@@ -0,0 +1,22 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ ##
8
+ # ProxySettings encapsulates HTTP proxy configuration for Faraday,
9
+ # including optional basic authentication.
10
+ #
11
+ class ProxySettings < CoreLibrary::ProxySettings
12
+ def self.from_env
13
+ address = ENV['PROXY_ADDRESS']
14
+ port = ENV['PROXY_PORT']
15
+ username = ENV['PROXY_USERNAME']
16
+ password = ENV['PROXY_PASSWORD']
17
+ return nil if address.nil? || address.strip.empty?
18
+
19
+ new(address: address, port: port, username: username, password: password)
20
+ end
21
+ end
22
+ end