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,124 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # ExportProjectRequest Model.
8
+ class ExportProjectRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Vertical resolution tier for the rendered MP4.
13
+ # @return [ExportProjectQuality]
14
+ attr_accessor :quality
15
+
16
+ # Controls whether the VideoGen watermark is applied to the output. `AUTO`
17
+ # applies the watermark unless you have a Pro plan. `VIDEO_GEN` always
18
+ # applies it. `NONE` removes the watermark (requires Pro; returns an error
19
+ # if you don't have it).
20
+ # @return [WatermarkMode]
21
+ attr_accessor :watermark_mode
22
+
23
+ # Controls whether a short 'Made with VideoGen' end screen is appended to
24
+ # the output. `AUTO` appends it unless you have a Pro plan. `VIDEO_GEN`
25
+ # always appends it. `NONE` removes it (requires Pro; returns an error if
26
+ # you don't have it).
27
+ # @return [EndScreenMode]
28
+ attr_accessor :end_screen_mode
29
+
30
+ # Destinations to deliver the finished export to when it completes, in
31
+ # addition to any delivery destinations already saved for the team. Each
32
+ # destination references a connected integration.
33
+ # @return [Array[ExportDeliveryDestination]]
34
+ attr_accessor :delivery_destinations
35
+
36
+ # A mapping from model property names to API property names.
37
+ def self.names
38
+ @_hash = {} if @_hash.nil?
39
+ @_hash['quality'] = 'quality'
40
+ @_hash['watermark_mode'] = 'watermarkMode'
41
+ @_hash['end_screen_mode'] = 'endScreenMode'
42
+ @_hash['delivery_destinations'] = 'deliveryDestinations'
43
+ @_hash
44
+ end
45
+
46
+ # An array for optional fields
47
+ def self.optionals
48
+ %w[
49
+ quality
50
+ watermark_mode
51
+ end_screen_mode
52
+ delivery_destinations
53
+ ]
54
+ end
55
+
56
+ # An array for nullable fields
57
+ def self.nullables
58
+ []
59
+ end
60
+
61
+ def initialize(quality: SKIP, watermark_mode: WatermarkMode::AUTO,
62
+ end_screen_mode: EndScreenMode::AUTO,
63
+ delivery_destinations: SKIP, additional_properties: nil)
64
+ # Add additional model properties to the instance
65
+ additional_properties = {} if additional_properties.nil?
66
+
67
+ @quality = quality unless quality == SKIP
68
+ @watermark_mode = watermark_mode unless watermark_mode == SKIP
69
+ @end_screen_mode = end_screen_mode unless end_screen_mode == SKIP
70
+ @delivery_destinations = delivery_destinations unless delivery_destinations == SKIP
71
+ @additional_properties = additional_properties
72
+ end
73
+
74
+ # Creates an instance of the object from a hash.
75
+ def self.from_hash(hash)
76
+ return nil unless hash
77
+
78
+ # Extract variables from the hash.
79
+ quality = hash.key?('quality') ? hash['quality'] : SKIP
80
+ watermark_mode = hash['watermarkMode'] ||= WatermarkMode::AUTO
81
+ end_screen_mode = hash['endScreenMode'] ||= EndScreenMode::AUTO
82
+ # Parameter is an array, so we need to iterate through it
83
+ delivery_destinations = nil
84
+ unless hash['deliveryDestinations'].nil?
85
+ delivery_destinations = []
86
+ hash['deliveryDestinations'].each do |structure|
87
+ delivery_destinations << (ExportDeliveryDestination.from_hash(structure) if structure)
88
+ end
89
+ end
90
+
91
+ delivery_destinations = SKIP unless hash.key?('deliveryDestinations')
92
+
93
+ # Create a new hash for additional properties, removing known properties.
94
+ new_hash = hash.reject { |k, _| names.value?(k) }
95
+
96
+ additional_properties = APIHelper.get_additional_properties(
97
+ new_hash, proc { |value| value }
98
+ )
99
+
100
+ # Create object from extracted values.
101
+ ExportProjectRequest.new(quality: quality,
102
+ watermark_mode: watermark_mode,
103
+ end_screen_mode: end_screen_mode,
104
+ delivery_destinations: delivery_destinations,
105
+ additional_properties: additional_properties)
106
+ end
107
+
108
+ # Provides a human-readable string representation of the object.
109
+ def to_s
110
+ class_name = self.class.name.split('::').last
111
+ "<#{class_name} quality: #{@quality}, watermark_mode: #{@watermark_mode}, end_screen_mode:"\
112
+ " #{@end_screen_mode}, delivery_destinations: #{@delivery_destinations},"\
113
+ " additional_properties: #{@additional_properties}>"
114
+ end
115
+
116
+ # Provides a debugging-friendly string with detailed object information.
117
+ def inspect
118
+ class_name = self.class.name.split('::').last
119
+ "<#{class_name} quality: #{@quality.inspect}, watermark_mode: #{@watermark_mode.inspect},"\
120
+ " end_screen_mode: #{@end_screen_mode.inspect}, delivery_destinations:"\
121
+ " #{@delivery_destinations.inspect}, additional_properties: #{@additional_properties}>"
122
+ end
123
+ end
124
+ end
@@ -0,0 +1,76 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # ExportProjectResponse Model.
8
+ class ExportProjectResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Opaque export id (e.g. `vg_expo_...`). Poll `GET
13
+ # /v1/projects/{projectId}/exports/{exportId}` or subscribe to webhooks for
14
+ # completion.
15
+ # @return [String]
16
+ attr_accessor :export_id
17
+
18
+ # A mapping from model property names to API property names.
19
+ def self.names
20
+ @_hash = {} if @_hash.nil?
21
+ @_hash['export_id'] = 'exportId'
22
+ @_hash
23
+ end
24
+
25
+ # An array for optional fields
26
+ def self.optionals
27
+ []
28
+ end
29
+
30
+ # An array for nullable fields
31
+ def self.nullables
32
+ []
33
+ end
34
+
35
+ def initialize(export_id:, additional_properties: nil)
36
+ # Add additional model properties to the instance
37
+ additional_properties = {} if additional_properties.nil?
38
+
39
+ @export_id = export_id
40
+ @additional_properties = additional_properties
41
+ end
42
+
43
+ # Creates an instance of the object from a hash.
44
+ def self.from_hash(hash)
45
+ return nil unless hash
46
+
47
+ # Extract variables from the hash.
48
+ export_id = hash.key?('exportId') ? hash['exportId'] : nil
49
+
50
+ # Create a new hash for additional properties, removing known properties.
51
+ new_hash = hash.reject { |k, _| names.value?(k) }
52
+
53
+ additional_properties = APIHelper.get_additional_properties(
54
+ new_hash, proc { |value| value }
55
+ )
56
+
57
+ # Create object from extracted values.
58
+ ExportProjectResponse.new(export_id: export_id,
59
+ additional_properties: additional_properties)
60
+ end
61
+
62
+ # Provides a human-readable string representation of the object.
63
+ def to_s
64
+ class_name = self.class.name.split('::').last
65
+ "<#{class_name} export_id: #{@export_id}, additional_properties:"\
66
+ " #{@additional_properties}>"
67
+ end
68
+
69
+ # Provides a debugging-friendly string with detailed object information.
70
+ def inspect
71
+ class_name = self.class.name.split('::').last
72
+ "<#{class_name} export_id: #{@export_id.inspect}, additional_properties:"\
73
+ " #{@additional_properties}>"
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,112 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # Background analysis state for a file. Background analysis populates
8
+ # `description`, `transcript`, `durationSeconds`, and the search embedding
9
+ # after a file is uploaded or generated; this object lets you render a
10
+ # progress indicator while it runs (and skip rendering once it's done).
11
+ class FileAnalysisMetadata < BaseModel
12
+ SKIP = Object.new
13
+ private_constant :SKIP
14
+
15
+ # Coarse-grained analysis state.
16
+ # - `UNATTEMPTED`: analysis has not started yet.
17
+ # - `LOADING`: analysis is in progress.
18
+ # - `FULFILLED`: analysis completed successfully. `description`,
19
+ # `transcript`, and `durationSeconds` are now populated where applicable for
20
+ # the file's type.
21
+ # - `REJECTED`: analysis failed permanently and will not be retried.
22
+ # @return [FileAnalysisMetadataAnalysisLoadingState]
23
+ attr_accessor :analysis_loading_state
24
+
25
+ # Progress in `[0, 100]`. Always `100` when `analysisLoadingState` is
26
+ # `FULFILLED`. Otherwise the most recent in-flight progress reported by the
27
+ # analysis task (or `0` if no progress has been reported yet).
28
+ # @return [Float]
29
+ attr_accessor :analysis_progress_percentage
30
+
31
+ # Zero-based index of the current analysis task attempt. Only present while
32
+ # analysis is still loading (`UNATTEMPTED` or `LOADING`); omitted once
33
+ # analysis reaches a terminal state.
34
+ # @return [Integer]
35
+ attr_accessor :analysis_attempt_index
36
+
37
+ # A mapping from model property names to API property names.
38
+ def self.names
39
+ @_hash = {} if @_hash.nil?
40
+ @_hash['analysis_loading_state'] = 'analysisLoadingState'
41
+ @_hash['analysis_progress_percentage'] = 'analysisProgressPercentage'
42
+ @_hash['analysis_attempt_index'] = 'analysisAttemptIndex'
43
+ @_hash
44
+ end
45
+
46
+ # An array for optional fields
47
+ def self.optionals
48
+ %w[
49
+ analysis_attempt_index
50
+ ]
51
+ end
52
+
53
+ # An array for nullable fields
54
+ def self.nullables
55
+ []
56
+ end
57
+
58
+ def initialize(analysis_loading_state:, analysis_progress_percentage:,
59
+ analysis_attempt_index: SKIP, additional_properties: nil)
60
+ # Add additional model properties to the instance
61
+ additional_properties = {} if additional_properties.nil?
62
+
63
+ @analysis_loading_state = analysis_loading_state
64
+ @analysis_progress_percentage = analysis_progress_percentage
65
+ @analysis_attempt_index = analysis_attempt_index unless analysis_attempt_index == SKIP
66
+ @additional_properties = additional_properties
67
+ end
68
+
69
+ # Creates an instance of the object from a hash.
70
+ def self.from_hash(hash)
71
+ return nil unless hash
72
+
73
+ # Extract variables from the hash.
74
+ analysis_loading_state =
75
+ hash.key?('analysisLoadingState') ? hash['analysisLoadingState'] : nil
76
+ analysis_progress_percentage =
77
+ hash.key?('analysisProgressPercentage') ? hash['analysisProgressPercentage'] : nil
78
+ analysis_attempt_index =
79
+ hash.key?('analysisAttemptIndex') ? hash['analysisAttemptIndex'] : SKIP
80
+
81
+ # Create a new hash for additional properties, removing known properties.
82
+ new_hash = hash.reject { |k, _| names.value?(k) }
83
+
84
+ additional_properties = APIHelper.get_additional_properties(
85
+ new_hash, proc { |value| value }
86
+ )
87
+
88
+ # Create object from extracted values.
89
+ FileAnalysisMetadata.new(analysis_loading_state: analysis_loading_state,
90
+ analysis_progress_percentage: analysis_progress_percentage,
91
+ analysis_attempt_index: analysis_attempt_index,
92
+ additional_properties: additional_properties)
93
+ end
94
+
95
+ # Provides a human-readable string representation of the object.
96
+ def to_s
97
+ class_name = self.class.name.split('::').last
98
+ "<#{class_name} analysis_loading_state: #{@analysis_loading_state},"\
99
+ " analysis_progress_percentage: #{@analysis_progress_percentage}, analysis_attempt_index:"\
100
+ " #{@analysis_attempt_index}, additional_properties: #{@additional_properties}>"
101
+ end
102
+
103
+ # Provides a debugging-friendly string with detailed object information.
104
+ def inspect
105
+ class_name = self.class.name.split('::').last
106
+ "<#{class_name} analysis_loading_state: #{@analysis_loading_state.inspect},"\
107
+ " analysis_progress_percentage: #{@analysis_progress_percentage.inspect},"\
108
+ " analysis_attempt_index: #{@analysis_attempt_index.inspect}, additional_properties:"\
109
+ " #{@additional_properties}>"
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,112 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # Background analysis state for the file (used to populate `description`,
8
+ # `transcript`, `durationSeconds`, and the search embedding). Omitted when the
9
+ # file was returned via a path that does not check analysis progress (e.g.
10
+ # tool-result inline files and webhook payloads).
11
+ class FileAnalysisMetadata1 < BaseModel
12
+ SKIP = Object.new
13
+ private_constant :SKIP
14
+
15
+ # Coarse-grained analysis state.
16
+ # - `UNATTEMPTED`: analysis has not started yet.
17
+ # - `LOADING`: analysis is in progress.
18
+ # - `FULFILLED`: analysis completed successfully. `description`,
19
+ # `transcript`, and `durationSeconds` are now populated where applicable for
20
+ # the file's type.
21
+ # - `REJECTED`: analysis failed permanently and will not be retried.
22
+ # @return [FileAnalysisMetadataAnalysisLoadingState]
23
+ attr_accessor :analysis_loading_state
24
+
25
+ # Progress in `[0, 100]`. Always `100` when `analysisLoadingState` is
26
+ # `FULFILLED`. Otherwise the most recent in-flight progress reported by the
27
+ # analysis task (or `0` if no progress has been reported yet).
28
+ # @return [Float]
29
+ attr_accessor :analysis_progress_percentage
30
+
31
+ # Zero-based index of the current analysis task attempt. Only present while
32
+ # analysis is still loading (`UNATTEMPTED` or `LOADING`); omitted once
33
+ # analysis reaches a terminal state.
34
+ # @return [Integer]
35
+ attr_accessor :analysis_attempt_index
36
+
37
+ # A mapping from model property names to API property names.
38
+ def self.names
39
+ @_hash = {} if @_hash.nil?
40
+ @_hash['analysis_loading_state'] = 'analysisLoadingState'
41
+ @_hash['analysis_progress_percentage'] = 'analysisProgressPercentage'
42
+ @_hash['analysis_attempt_index'] = 'analysisAttemptIndex'
43
+ @_hash
44
+ end
45
+
46
+ # An array for optional fields
47
+ def self.optionals
48
+ %w[
49
+ analysis_attempt_index
50
+ ]
51
+ end
52
+
53
+ # An array for nullable fields
54
+ def self.nullables
55
+ []
56
+ end
57
+
58
+ def initialize(analysis_loading_state:, analysis_progress_percentage:,
59
+ analysis_attempt_index: SKIP, additional_properties: nil)
60
+ # Add additional model properties to the instance
61
+ additional_properties = {} if additional_properties.nil?
62
+
63
+ @analysis_loading_state = analysis_loading_state
64
+ @analysis_progress_percentage = analysis_progress_percentage
65
+ @analysis_attempt_index = analysis_attempt_index unless analysis_attempt_index == SKIP
66
+ @additional_properties = additional_properties
67
+ end
68
+
69
+ # Creates an instance of the object from a hash.
70
+ def self.from_hash(hash)
71
+ return nil unless hash
72
+
73
+ # Extract variables from the hash.
74
+ analysis_loading_state =
75
+ hash.key?('analysisLoadingState') ? hash['analysisLoadingState'] : nil
76
+ analysis_progress_percentage =
77
+ hash.key?('analysisProgressPercentage') ? hash['analysisProgressPercentage'] : nil
78
+ analysis_attempt_index =
79
+ hash.key?('analysisAttemptIndex') ? hash['analysisAttemptIndex'] : SKIP
80
+
81
+ # Create a new hash for additional properties, removing known properties.
82
+ new_hash = hash.reject { |k, _| names.value?(k) }
83
+
84
+ additional_properties = APIHelper.get_additional_properties(
85
+ new_hash, proc { |value| value }
86
+ )
87
+
88
+ # Create object from extracted values.
89
+ FileAnalysisMetadata1.new(analysis_loading_state: analysis_loading_state,
90
+ analysis_progress_percentage: analysis_progress_percentage,
91
+ analysis_attempt_index: analysis_attempt_index,
92
+ additional_properties: additional_properties)
93
+ end
94
+
95
+ # Provides a human-readable string representation of the object.
96
+ def to_s
97
+ class_name = self.class.name.split('::').last
98
+ "<#{class_name} analysis_loading_state: #{@analysis_loading_state},"\
99
+ " analysis_progress_percentage: #{@analysis_progress_percentage}, analysis_attempt_index:"\
100
+ " #{@analysis_attempt_index}, additional_properties: #{@additional_properties}>"
101
+ end
102
+
103
+ # Provides a debugging-friendly string with detailed object information.
104
+ def inspect
105
+ class_name = self.class.name.split('::').last
106
+ "<#{class_name} analysis_loading_state: #{@analysis_loading_state.inspect},"\
107
+ " analysis_progress_percentage: #{@analysis_progress_percentage.inspect},"\
108
+ " analysis_attempt_index: #{@analysis_attempt_index.inspect}, additional_properties:"\
109
+ " #{@additional_properties}>"
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,48 @@
1
+ # videogen
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Videogen
7
+ # Coarse-grained analysis state. - `UNATTEMPTED`: analysis has not started
8
+ # yet. - `LOADING`: analysis is in progress. - `FULFILLED`: analysis completed
9
+ # successfully. `description`, `transcript`, and `durationSeconds` are now
10
+ # populated where applicable for the file's type. - `REJECTED`: analysis
11
+ # failed permanently and will not be retried.
12
+ class FileAnalysisMetadataAnalysisLoadingState
13
+ FILE_ANALYSIS_METADATA_ANALYSIS_LOADING_STATE = [
14
+ # TODO: Write general description for UNATTEMPTED
15
+ UNATTEMPTED = 'UNATTEMPTED'.freeze,
16
+
17
+ # TODO: Write general description for LOADING
18
+ LOADING = 'LOADING'.freeze,
19
+
20
+ # TODO: Write general description for FULFILLED
21
+ FULFILLED = 'FULFILLED'.freeze,
22
+
23
+ # TODO: Write general description for REJECTED
24
+ REJECTED = 'REJECTED'.freeze
25
+ ].freeze
26
+
27
+ def self.validate(value)
28
+ return false if value.nil?
29
+
30
+ FILE_ANALYSIS_METADATA_ANALYSIS_LOADING_STATE.include?(value)
31
+ end
32
+
33
+ def self.from_value(value, default_value = UNATTEMPTED)
34
+ return default_value if value.nil?
35
+
36
+ str = value.to_s.strip
37
+
38
+ case str.downcase
39
+ when 'unattempted' then UNATTEMPTED
40
+ when 'loading' then LOADING
41
+ when 'fulfilled' then FULFILLED
42
+ when 'rejected' then REJECTED
43
+ else
44
+ default_value
45
+ end
46
+ end
47
+ end
48
+ end