ittybit 0.8.14 → 1.0.0

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 (187) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ittybit/automations/client.rb +80 -60
  3. data/lib/ittybit/automations/types/automations_create_request_workflow_item.rb +81 -0
  4. data/lib/ittybit/automations/types/automations_create_request_workflow_item_kind.rb +20 -0
  5. data/lib/ittybit/automations/types/automations_create_request_workflow_item_next_item.rb +71 -0
  6. data/lib/ittybit/automations/types/automations_create_response.rb +133 -0
  7. data/lib/ittybit/automations/types/automations_create_response_status.rb +10 -0
  8. data/lib/ittybit/automations/types/automations_create_response_trigger.rb +67 -0
  9. data/lib/ittybit/automations/types/automations_create_response_workflow_item.rb +61 -0
  10. data/lib/ittybit/automations/types/automations_create_response_workflow_item_conditions.rb +86 -0
  11. data/lib/ittybit/automations/types/automations_create_response_workflow_item_conditions_conditions_item.rb +71 -0
  12. data/lib/ittybit/automations/types/automations_create_response_workflow_item_conditions_next_item.rb +71 -0
  13. data/lib/ittybit/automations/types/automations_create_response_workflow_item_ref.rb +83 -0
  14. data/lib/ittybit/automations/types/automations_create_response_workflow_item_ref_kind.rb +20 -0
  15. data/lib/ittybit/automations/types/automations_create_response_workflow_item_ref_next_item.rb +71 -0
  16. data/lib/ittybit/automations/types/automations_delete_response.rb +59 -0
  17. data/lib/ittybit/automations/types/automations_get_response.rb +133 -0
  18. data/lib/ittybit/automations/types/automations_get_response_status.rb +10 -0
  19. data/lib/ittybit/automations/types/automations_get_response_trigger.rb +67 -0
  20. data/lib/ittybit/automations/types/automations_get_response_workflow_item.rb +60 -0
  21. data/lib/ittybit/automations/types/automations_get_response_workflow_item_conditions.rb +86 -0
  22. data/lib/ittybit/automations/types/automations_get_response_workflow_item_conditions_conditions_item.rb +71 -0
  23. data/lib/ittybit/automations/types/automations_get_response_workflow_item_conditions_next_item.rb +71 -0
  24. data/lib/ittybit/automations/types/automations_get_response_workflow_item_ref.rb +82 -0
  25. data/lib/ittybit/automations/types/automations_get_response_workflow_item_ref_kind.rb +20 -0
  26. data/lib/ittybit/automations/types/automations_get_response_workflow_item_ref_next_item.rb +71 -0
  27. data/lib/ittybit/automations/types/automations_list_response_item.rb +133 -0
  28. data/lib/ittybit/automations/types/automations_list_response_item_status.rb +10 -0
  29. data/lib/ittybit/automations/types/automations_list_response_item_trigger.rb +67 -0
  30. data/lib/ittybit/automations/types/automations_list_response_item_workflow_item.rb +61 -0
  31. data/lib/ittybit/automations/types/automations_list_response_item_workflow_item_conditions.rb +86 -0
  32. data/lib/ittybit/automations/types/automations_list_response_item_workflow_item_conditions_conditions_item.rb +71 -0
  33. data/lib/ittybit/automations/types/automations_list_response_item_workflow_item_conditions_next_item.rb +71 -0
  34. data/lib/ittybit/automations/types/automations_list_response_item_workflow_item_ref.rb +83 -0
  35. data/lib/ittybit/automations/types/automations_list_response_item_workflow_item_ref_kind.rb +20 -0
  36. data/lib/ittybit/automations/types/automations_list_response_item_workflow_item_ref_next_item.rb +71 -0
  37. data/lib/ittybit/automations/types/automations_update_request_workflow_item.rb +81 -0
  38. data/lib/ittybit/automations/types/automations_update_request_workflow_item_kind.rb +20 -0
  39. data/lib/ittybit/automations/types/automations_update_request_workflow_item_next_item.rb +71 -0
  40. data/lib/ittybit/automations/types/automations_update_response.rb +133 -0
  41. data/lib/ittybit/automations/types/automations_update_response_status.rb +10 -0
  42. data/lib/ittybit/automations/types/automations_update_response_trigger.rb +67 -0
  43. data/lib/ittybit/automations/types/automations_update_response_workflow_item.rb +61 -0
  44. data/lib/ittybit/automations/types/automations_update_response_workflow_item_conditions.rb +86 -0
  45. data/lib/ittybit/automations/types/automations_update_response_workflow_item_conditions_conditions_item.rb +71 -0
  46. data/lib/ittybit/automations/types/automations_update_response_workflow_item_conditions_next_item.rb +71 -0
  47. data/lib/ittybit/automations/types/automations_update_response_workflow_item_ref.rb +83 -0
  48. data/lib/ittybit/automations/types/automations_update_response_workflow_item_ref_kind.rb +20 -0
  49. data/lib/ittybit/automations/types/automations_update_response_workflow_item_ref_next_item.rb +71 -0
  50. data/lib/ittybit/files/client.rb +76 -55
  51. data/lib/ittybit/files/types/files_create_response.rb +317 -0
  52. data/lib/ittybit/files/types/files_create_response_kind.rb +11 -0
  53. data/lib/ittybit/files/types/files_create_response_object.rb +11 -0
  54. data/lib/ittybit/files/types/files_create_response_status.rb +12 -0
  55. data/lib/ittybit/files/types/files_delete_response.rb +59 -0
  56. data/lib/ittybit/files/types/files_get_response.rb +317 -0
  57. data/lib/ittybit/files/types/files_get_response_kind.rb +11 -0
  58. data/lib/ittybit/files/types/files_get_response_object.rb +11 -0
  59. data/lib/ittybit/files/types/files_get_response_status.rb +12 -0
  60. data/lib/ittybit/files/types/files_list_response_item.rb +317 -0
  61. data/lib/ittybit/files/types/files_list_response_item_kind.rb +11 -0
  62. data/lib/ittybit/files/types/files_list_response_item_object.rb +11 -0
  63. data/lib/ittybit/files/types/files_list_response_item_status.rb +12 -0
  64. data/lib/ittybit/files/types/files_update_response.rb +317 -0
  65. data/lib/ittybit/files/types/files_update_response_kind.rb +11 -0
  66. data/lib/ittybit/files/types/files_update_response_object.rb +11 -0
  67. data/lib/ittybit/files/types/files_update_response_status.rb +12 -0
  68. data/lib/ittybit/media/client.rb +77 -56
  69. data/lib/ittybit/media/types/media_create_response.rb +175 -0
  70. data/lib/ittybit/media/types/media_create_response_files_item.rb +262 -0
  71. data/lib/ittybit/media/types/media_create_response_files_item_kind.rb +11 -0
  72. data/lib/ittybit/media/types/media_create_response_files_item_object.rb +11 -0
  73. data/lib/ittybit/media/types/media_create_response_files_item_orientation.rb +11 -0
  74. data/lib/ittybit/media/types/media_create_response_files_item_status.rb +12 -0
  75. data/lib/ittybit/media/types/media_create_response_kind.rb +11 -0
  76. data/lib/ittybit/media/types/media_delete_response.rb +59 -0
  77. data/lib/ittybit/media/types/media_get_response.rb +175 -0
  78. data/lib/ittybit/media/types/media_get_response_files_item.rb +262 -0
  79. data/lib/ittybit/media/types/media_get_response_files_item_kind.rb +11 -0
  80. data/lib/ittybit/media/types/media_get_response_files_item_object.rb +11 -0
  81. data/lib/ittybit/media/types/media_get_response_files_item_orientation.rb +11 -0
  82. data/lib/ittybit/media/types/media_get_response_files_item_status.rb +12 -0
  83. data/lib/ittybit/media/types/media_get_response_kind.rb +11 -0
  84. data/lib/ittybit/media/types/media_update_response.rb +175 -0
  85. data/lib/ittybit/media/types/media_update_response_files_item.rb +262 -0
  86. data/lib/ittybit/media/types/media_update_response_files_item_kind.rb +11 -0
  87. data/lib/ittybit/media/types/media_update_response_files_item_object.rb +11 -0
  88. data/lib/ittybit/media/types/media_update_response_files_item_orientation.rb +11 -0
  89. data/lib/ittybit/media/types/media_update_response_files_item_status.rb +12 -0
  90. data/lib/ittybit/media/types/media_update_response_kind.rb +11 -0
  91. data/lib/ittybit/signatures/client.rb +13 -11
  92. data/lib/ittybit/signatures/types/signatures_create_response.rb +112 -0
  93. data/lib/ittybit/tasks/client.rb +47 -99
  94. data/lib/ittybit/tasks/types/tasks_create_response.rb +186 -0
  95. data/lib/ittybit/tasks/types/tasks_create_response_kind.rb +23 -0
  96. data/lib/ittybit/tasks/types/tasks_create_response_results.rb +76 -0
  97. data/lib/ittybit/tasks/types/tasks_create_response_status.rb +16 -0
  98. data/lib/ittybit/tasks/types/tasks_get_response.rb +186 -0
  99. data/lib/ittybit/tasks/types/tasks_get_response_kind.rb +23 -0
  100. data/lib/ittybit/tasks/types/tasks_get_response_results.rb +76 -0
  101. data/lib/ittybit/tasks/types/tasks_get_response_status.rb +16 -0
  102. data/lib/ittybit/tasks/types/tasks_list_response_item.rb +186 -0
  103. data/lib/ittybit/tasks/types/tasks_list_response_item_kind.rb +23 -0
  104. data/lib/ittybit/tasks/types/tasks_list_response_item_results.rb +76 -0
  105. data/lib/ittybit/tasks/types/tasks_list_response_item_status.rb +16 -0
  106. data/lib/ittybit/types/automation_list_response.rb +2 -98
  107. data/lib/ittybit/types/automation_list_response_item.rb +131 -0
  108. data/lib/ittybit/types/automation_list_response_item_status.rb +8 -0
  109. data/lib/ittybit/types/automation_list_response_item_trigger.rb +65 -0
  110. data/lib/ittybit/types/automation_list_response_item_workflow_item.rb +57 -0
  111. data/lib/ittybit/types/automation_list_response_item_workflow_item_conditions.rb +84 -0
  112. data/lib/ittybit/types/automation_list_response_item_workflow_item_conditions_conditions_item.rb +69 -0
  113. data/lib/ittybit/types/automation_list_response_item_workflow_item_conditions_next_item.rb +69 -0
  114. data/lib/ittybit/types/automation_list_response_item_workflow_item_ref.rb +81 -0
  115. data/lib/ittybit/types/automation_list_response_item_workflow_item_ref_kind.rb +18 -0
  116. data/lib/ittybit/types/automation_list_response_item_workflow_item_ref_next_item.rb +69 -0
  117. data/lib/ittybit/types/automation_response.rb +77 -46
  118. data/lib/ittybit/types/automation_response_status.rb +8 -0
  119. data/lib/ittybit/types/automation_response_trigger.rb +65 -0
  120. data/lib/ittybit/types/automation_response_workflow_item.rb +54 -0
  121. data/lib/ittybit/types/automation_response_workflow_item_conditions.rb +84 -0
  122. data/lib/ittybit/types/automation_response_workflow_item_conditions_conditions_item.rb +69 -0
  123. data/lib/ittybit/types/automation_response_workflow_item_conditions_next_item.rb +69 -0
  124. data/lib/ittybit/types/automation_response_workflow_item_ref.rb +79 -0
  125. data/lib/ittybit/types/automation_response_workflow_item_ref_kind.rb +18 -0
  126. data/lib/ittybit/types/automation_response_workflow_item_ref_next_item.rb +69 -0
  127. data/lib/ittybit/types/automation_workflow_item.rb +8 -8
  128. data/lib/ittybit/types/automation_workflow_item_conditions.rb +82 -0
  129. data/lib/ittybit/types/automation_workflow_item_conditions_conditions_item.rb +69 -0
  130. data/lib/ittybit/types/automation_workflow_item_conditions_next_item.rb +69 -0
  131. data/lib/ittybit/types/automation_workflow_item_ref.rb +79 -0
  132. data/lib/ittybit/types/automation_workflow_item_ref_kind.rb +18 -0
  133. data/lib/ittybit/types/automation_workflow_item_ref_next_item.rb +67 -0
  134. data/lib/ittybit/types/confirmation_response.rb +9 -52
  135. data/lib/ittybit/types/created_by.rb +5 -0
  136. data/lib/ittybit/types/error.rb +1 -53
  137. data/lib/ittybit/types/file_list_response.rb +2 -98
  138. data/lib/ittybit/types/file_list_response_item.rb +315 -0
  139. data/lib/ittybit/types/file_list_response_item_kind.rb +9 -0
  140. data/lib/ittybit/types/file_list_response_item_object.rb +9 -0
  141. data/lib/ittybit/types/file_list_response_item_status.rb +10 -0
  142. data/lib/ittybit/types/file_response.rb +264 -49
  143. data/lib/ittybit/types/file_response_kind.rb +9 -0
  144. data/lib/ittybit/types/file_response_object.rb +9 -0
  145. data/lib/ittybit/types/file_response_status.rb +10 -0
  146. data/lib/ittybit/types/kind.rb +21 -0
  147. data/lib/ittybit/types/links.rb +1 -63
  148. data/lib/ittybit/types/media.rb +4 -4
  149. data/lib/ittybit/types/media_files_item.rb +260 -0
  150. data/lib/ittybit/types/media_files_item_kind.rb +9 -0
  151. data/lib/ittybit/types/media_files_item_object.rb +9 -0
  152. data/lib/ittybit/types/media_files_item_orientation.rb +9 -0
  153. data/lib/ittybit/types/media_files_item_status.rb +10 -0
  154. data/lib/ittybit/types/media_list_response.rb +2 -98
  155. data/lib/ittybit/types/media_list_response_item.rb +173 -0
  156. data/lib/ittybit/types/media_list_response_item_files_item.rb +260 -0
  157. data/lib/ittybit/types/media_list_response_item_files_item_kind.rb +9 -0
  158. data/lib/ittybit/types/media_list_response_item_files_item_object.rb +9 -0
  159. data/lib/ittybit/types/media_list_response_item_files_item_orientation.rb +9 -0
  160. data/lib/ittybit/types/media_list_response_item_files_item_status.rb +10 -0
  161. data/lib/ittybit/types/media_list_response_item_kind.rb +9 -0
  162. data/lib/ittybit/types/media_response.rb +121 -48
  163. data/lib/ittybit/types/media_response_files_item.rb +260 -0
  164. data/lib/ittybit/types/media_response_files_item_kind.rb +9 -0
  165. data/lib/ittybit/types/media_response_files_item_object.rb +9 -0
  166. data/lib/ittybit/types/media_response_files_item_orientation.rb +9 -0
  167. data/lib/ittybit/types/media_response_files_item_status.rb +10 -0
  168. data/lib/ittybit/types/media_response_kind.rb +9 -0
  169. data/lib/ittybit/types/parent_id.rb +5 -0
  170. data/lib/ittybit/types/progress.rb +5 -0
  171. data/lib/ittybit/types/signature_response.rb +59 -49
  172. data/lib/ittybit/types/status.rb +14 -0
  173. data/lib/ittybit/types/task_list_response.rb +2 -98
  174. data/lib/ittybit/types/task_list_response_item.rb +184 -0
  175. data/lib/ittybit/types/task_list_response_item_kind.rb +21 -0
  176. data/lib/ittybit/types/task_list_response_item_results.rb +74 -0
  177. data/lib/ittybit/types/task_list_response_item_status.rb +14 -0
  178. data/lib/ittybit/types/task_response.rb +128 -44
  179. data/lib/ittybit/types/task_response_kind.rb +21 -0
  180. data/lib/ittybit/types/task_response_results.rb +74 -0
  181. data/lib/ittybit/types/task_response_status.rb +14 -0
  182. data/lib/requests.rb +2 -2
  183. data/lib/types_export.rb +168 -9
  184. metadata +163 -5
  185. data/lib/ittybit/types/links_list.rb +0 -88
  186. data/lib/ittybit/types/meta_list.rb +0 -128
  187. data/lib/ittybit/types/meta_list_type.rb +0 -8
@@ -0,0 +1,260 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "media_files_item_object"
4
+ require_relative "media_files_item_kind"
5
+ require_relative "media_files_item_orientation"
6
+ require "date"
7
+ require_relative "media_files_item_status"
8
+ require "ostruct"
9
+ require "json"
10
+
11
+ module Ittybit
12
+ class MediaFilesItem
13
+ # @return [String]
14
+ attr_reader :id
15
+ # @return [Ittybit::MediaFilesItemObject]
16
+ attr_reader :object
17
+ # @return [Ittybit::MediaFilesItemKind]
18
+ attr_reader :kind
19
+ # @return [String]
20
+ attr_reader :type
21
+ # @return [String]
22
+ attr_reader :codec
23
+ # @return [String]
24
+ attr_reader :container
25
+ # @return [Integer]
26
+ attr_reader :width
27
+ # @return [Integer]
28
+ attr_reader :height
29
+ # @return [Ittybit::MediaFilesItemOrientation]
30
+ attr_reader :orientation
31
+ # @return [Float]
32
+ attr_reader :rotation
33
+ # @return [Boolean]
34
+ attr_reader :transparency
35
+ # @return [Integer]
36
+ attr_reader :frames
37
+ # @return [Float]
38
+ attr_reader :duration
39
+ # @return [Float]
40
+ attr_reader :fps
41
+ # @return [Integer]
42
+ attr_reader :filesize
43
+ # @return [Integer]
44
+ attr_reader :bitrate
45
+ # @return [String]
46
+ attr_reader :ref
47
+ # @return [String]
48
+ attr_reader :folder
49
+ # @return [String]
50
+ attr_reader :filename
51
+ # @return [String]
52
+ attr_reader :url
53
+ # @return [Hash{String => Object}]
54
+ attr_reader :metadata
55
+ # @return [Boolean]
56
+ attr_reader :original
57
+ # @return [DateTime]
58
+ attr_reader :created
59
+ # @return [DateTime]
60
+ attr_reader :updated
61
+ # @return [Ittybit::MediaFilesItemStatus]
62
+ attr_reader :status
63
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
64
+ attr_reader :additional_properties
65
+ # @return [Object]
66
+ attr_reader :_field_set
67
+ protected :_field_set
68
+
69
+ OMIT = Object.new
70
+
71
+ # @param id [String]
72
+ # @param object [Ittybit::MediaFilesItemObject]
73
+ # @param kind [Ittybit::MediaFilesItemKind]
74
+ # @param type [String]
75
+ # @param codec [String]
76
+ # @param container [String]
77
+ # @param width [Integer]
78
+ # @param height [Integer]
79
+ # @param orientation [Ittybit::MediaFilesItemOrientation]
80
+ # @param rotation [Float]
81
+ # @param transparency [Boolean]
82
+ # @param frames [Integer]
83
+ # @param duration [Float]
84
+ # @param fps [Float]
85
+ # @param filesize [Integer]
86
+ # @param bitrate [Integer]
87
+ # @param ref [String]
88
+ # @param folder [String]
89
+ # @param filename [String]
90
+ # @param url [String]
91
+ # @param metadata [Hash{String => Object}]
92
+ # @param original [Boolean]
93
+ # @param created [DateTime]
94
+ # @param updated [DateTime]
95
+ # @param status [Ittybit::MediaFilesItemStatus]
96
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
97
+ # @return [Ittybit::MediaFilesItem]
98
+ def initialize(id:, object:, kind:, type:, filesize:, url:, created:, updated:, status:, codec: OMIT, container: OMIT, width: OMIT, height: OMIT,
99
+ orientation: OMIT, rotation: OMIT, transparency: OMIT, frames: OMIT, duration: OMIT, fps: OMIT, bitrate: OMIT, ref: OMIT, folder: OMIT, filename: OMIT, metadata: OMIT, original: OMIT, additional_properties: nil)
100
+ @id = id
101
+ @object = object
102
+ @kind = kind
103
+ @type = type
104
+ @codec = codec if codec != OMIT
105
+ @container = container if container != OMIT
106
+ @width = width if width != OMIT
107
+ @height = height if height != OMIT
108
+ @orientation = orientation if orientation != OMIT
109
+ @rotation = rotation if rotation != OMIT
110
+ @transparency = transparency if transparency != OMIT
111
+ @frames = frames if frames != OMIT
112
+ @duration = duration if duration != OMIT
113
+ @fps = fps if fps != OMIT
114
+ @filesize = filesize
115
+ @bitrate = bitrate if bitrate != OMIT
116
+ @ref = ref if ref != OMIT
117
+ @folder = folder if folder != OMIT
118
+ @filename = filename if filename != OMIT
119
+ @url = url
120
+ @metadata = metadata if metadata != OMIT
121
+ @original = original if original != OMIT
122
+ @created = created
123
+ @updated = updated
124
+ @status = status
125
+ @additional_properties = additional_properties
126
+ @_field_set = {
127
+ "id": id,
128
+ "object": object,
129
+ "kind": kind,
130
+ "type": type,
131
+ "codec": codec,
132
+ "container": container,
133
+ "width": width,
134
+ "height": height,
135
+ "orientation": orientation,
136
+ "rotation": rotation,
137
+ "transparency": transparency,
138
+ "frames": frames,
139
+ "duration": duration,
140
+ "fps": fps,
141
+ "filesize": filesize,
142
+ "bitrate": bitrate,
143
+ "ref": ref,
144
+ "folder": folder,
145
+ "filename": filename,
146
+ "url": url,
147
+ "metadata": metadata,
148
+ "original": original,
149
+ "created": created,
150
+ "updated": updated,
151
+ "status": status
152
+ }.reject do |_k, v|
153
+ v == OMIT
154
+ end
155
+ end
156
+
157
+ # Deserialize a JSON object to an instance of MediaFilesItem
158
+ #
159
+ # @param json_object [String]
160
+ # @return [Ittybit::MediaFilesItem]
161
+ def self.from_json(json_object:)
162
+ struct = JSON.parse(json_object, object_class: OpenStruct)
163
+ parsed_json = JSON.parse(json_object)
164
+ id = parsed_json["id"]
165
+ object = parsed_json["object"]
166
+ kind = parsed_json["kind"]
167
+ type = parsed_json["type"]
168
+ codec = parsed_json["codec"]
169
+ container = parsed_json["container"]
170
+ width = parsed_json["width"]
171
+ height = parsed_json["height"]
172
+ orientation = parsed_json["orientation"]
173
+ rotation = parsed_json["rotation"]
174
+ transparency = parsed_json["transparency"]
175
+ frames = parsed_json["frames"]
176
+ duration = parsed_json["duration"]
177
+ fps = parsed_json["fps"]
178
+ filesize = parsed_json["filesize"]
179
+ bitrate = parsed_json["bitrate"]
180
+ ref = parsed_json["ref"]
181
+ folder = parsed_json["folder"]
182
+ filename = parsed_json["filename"]
183
+ url = parsed_json["url"]
184
+ metadata = parsed_json["metadata"]
185
+ original = parsed_json["original"]
186
+ created = (DateTime.parse(parsed_json["created"]) unless parsed_json["created"].nil?)
187
+ updated = (DateTime.parse(parsed_json["updated"]) unless parsed_json["updated"].nil?)
188
+ status = parsed_json["status"]
189
+ new(
190
+ id: id,
191
+ object: object,
192
+ kind: kind,
193
+ type: type,
194
+ codec: codec,
195
+ container: container,
196
+ width: width,
197
+ height: height,
198
+ orientation: orientation,
199
+ rotation: rotation,
200
+ transparency: transparency,
201
+ frames: frames,
202
+ duration: duration,
203
+ fps: fps,
204
+ filesize: filesize,
205
+ bitrate: bitrate,
206
+ ref: ref,
207
+ folder: folder,
208
+ filename: filename,
209
+ url: url,
210
+ metadata: metadata,
211
+ original: original,
212
+ created: created,
213
+ updated: updated,
214
+ status: status,
215
+ additional_properties: struct
216
+ )
217
+ end
218
+
219
+ # Serialize an instance of MediaFilesItem to a JSON object
220
+ #
221
+ # @return [String]
222
+ def to_json(*_args)
223
+ @_field_set&.to_json
224
+ end
225
+
226
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
227
+ # hash and check each fields type against the current object's property
228
+ # definitions.
229
+ #
230
+ # @param obj [Object]
231
+ # @return [Void]
232
+ def self.validate_raw(obj:)
233
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
234
+ obj.object.is_a?(Ittybit::MediaFilesItemObject) != false || raise("Passed value for field obj.object is not the expected type, validation failed.")
235
+ obj.kind.is_a?(Ittybit::MediaFilesItemKind) != false || raise("Passed value for field obj.kind is not the expected type, validation failed.")
236
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
237
+ obj.codec&.is_a?(String) != false || raise("Passed value for field obj.codec is not the expected type, validation failed.")
238
+ obj.container&.is_a?(String) != false || raise("Passed value for field obj.container is not the expected type, validation failed.")
239
+ obj.width&.is_a?(Integer) != false || raise("Passed value for field obj.width is not the expected type, validation failed.")
240
+ obj.height&.is_a?(Integer) != false || raise("Passed value for field obj.height is not the expected type, validation failed.")
241
+ obj.orientation&.is_a?(Ittybit::MediaFilesItemOrientation) != false || raise("Passed value for field obj.orientation is not the expected type, validation failed.")
242
+ obj.rotation&.is_a?(Float) != false || raise("Passed value for field obj.rotation is not the expected type, validation failed.")
243
+ obj.transparency&.is_a?(Boolean) != false || raise("Passed value for field obj.transparency is not the expected type, validation failed.")
244
+ obj.frames&.is_a?(Integer) != false || raise("Passed value for field obj.frames is not the expected type, validation failed.")
245
+ obj.duration&.is_a?(Float) != false || raise("Passed value for field obj.duration is not the expected type, validation failed.")
246
+ obj.fps&.is_a?(Float) != false || raise("Passed value for field obj.fps is not the expected type, validation failed.")
247
+ obj.filesize.is_a?(Integer) != false || raise("Passed value for field obj.filesize is not the expected type, validation failed.")
248
+ obj.bitrate&.is_a?(Integer) != false || raise("Passed value for field obj.bitrate is not the expected type, validation failed.")
249
+ obj.ref&.is_a?(String) != false || raise("Passed value for field obj.ref is not the expected type, validation failed.")
250
+ obj.folder&.is_a?(String) != false || raise("Passed value for field obj.folder is not the expected type, validation failed.")
251
+ obj.filename&.is_a?(String) != false || raise("Passed value for field obj.filename is not the expected type, validation failed.")
252
+ obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
253
+ obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
254
+ obj.original&.is_a?(Boolean) != false || raise("Passed value for field obj.original is not the expected type, validation failed.")
255
+ obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
256
+ obj.updated.is_a?(DateTime) != false || raise("Passed value for field obj.updated is not the expected type, validation failed.")
257
+ obj.status.is_a?(Ittybit::MediaFilesItemStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
258
+ end
259
+ end
260
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ittybit
4
+ class MediaFilesItemKind
5
+ VIDEO = "video"
6
+ IMAGE = "image"
7
+ AUDIO = "audio"
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ittybit
4
+ class MediaFilesItemObject
5
+ SOURCE = "source"
6
+ TRACK = "track"
7
+ INTELLIGENCE = "intelligence"
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ittybit
4
+ class MediaFilesItemOrientation
5
+ LANDSCAPE = "landscape"
6
+ PORTRAIT = "portrait"
7
+ SQUARE = "square"
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ittybit
4
+ class MediaFilesItemStatus
5
+ WAITING = "waiting"
6
+ PROCESSING = "processing"
7
+ READY = "ready"
8
+ FAILED = "failed"
9
+ end
10
+ end
@@ -1,103 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "meta_list"
4
- require_relative "media"
5
- require_relative "error"
6
- require_relative "links_list"
7
- require "ostruct"
8
- require "json"
3
+ require_relative "media_list_response_item"
9
4
 
10
5
  module Ittybit
11
- class MediaListResponse
12
- # @return [Ittybit::MetaList]
13
- attr_reader :meta
14
- # @return [Array<Ittybit::Media>]
15
- attr_reader :data
16
- # @return [Ittybit::Error]
17
- attr_reader :error
18
- # @return [Ittybit::LinksList]
19
- attr_reader :links
20
- # @return [OpenStruct] Additional properties unmapped to the current class definition
21
- attr_reader :additional_properties
22
- # @return [Object]
23
- attr_reader :_field_set
24
- protected :_field_set
25
-
26
- OMIT = Object.new
27
-
28
- # @param meta [Ittybit::MetaList]
29
- # @param data [Array<Ittybit::Media>]
30
- # @param error [Ittybit::Error]
31
- # @param links [Ittybit::LinksList]
32
- # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
33
- # @return [Ittybit::MediaListResponse]
34
- def initialize(meta: OMIT, data: OMIT, error: OMIT, links: OMIT, additional_properties: nil)
35
- @meta = meta if meta != OMIT
36
- @data = data if data != OMIT
37
- @error = error if error != OMIT
38
- @links = links if links != OMIT
39
- @additional_properties = additional_properties
40
- @_field_set = { "meta": meta, "data": data, "error": error, "links": links }.reject do |_k, v|
41
- v == OMIT
42
- end
43
- end
44
-
45
- # Deserialize a JSON object to an instance of MediaListResponse
46
- #
47
- # @param json_object [String]
48
- # @return [Ittybit::MediaListResponse]
49
- def self.from_json(json_object:)
50
- struct = JSON.parse(json_object, object_class: OpenStruct)
51
- parsed_json = JSON.parse(json_object)
52
- if parsed_json["meta"].nil?
53
- meta = nil
54
- else
55
- meta = parsed_json["meta"].to_json
56
- meta = Ittybit::MetaList.from_json(json_object: meta)
57
- end
58
- data = parsed_json["data"]&.map do |item|
59
- item = item.to_json
60
- Ittybit::Media.from_json(json_object: item)
61
- end
62
- if parsed_json["error"].nil?
63
- error = nil
64
- else
65
- error = parsed_json["error"].to_json
66
- error = Ittybit::Error.from_json(json_object: error)
67
- end
68
- if parsed_json["links"].nil?
69
- links = nil
70
- else
71
- links = parsed_json["links"].to_json
72
- links = Ittybit::LinksList.from_json(json_object: links)
73
- end
74
- new(
75
- meta: meta,
76
- data: data,
77
- error: error,
78
- links: links,
79
- additional_properties: struct
80
- )
81
- end
82
-
83
- # Serialize an instance of MediaListResponse to a JSON object
84
- #
85
- # @return [String]
86
- def to_json(*_args)
87
- @_field_set&.to_json
88
- end
89
-
90
- # Leveraged for Union-type generation, validate_raw attempts to parse the given
91
- # hash and check each fields type against the current object's property
92
- # definitions.
93
- #
94
- # @param obj [Object]
95
- # @return [Void]
96
- def self.validate_raw(obj:)
97
- obj.meta.nil? || Ittybit::MetaList.validate_raw(obj: obj.meta)
98
- obj.data&.is_a?(Array) != false || raise("Passed value for field obj.data is not the expected type, validation failed.")
99
- obj.error.nil? || Ittybit::Error.validate_raw(obj: obj.error)
100
- obj.links.nil? || Ittybit::LinksList.validate_raw(obj: obj.links)
101
- end
102
- end
6
+ MEDIA_LIST_RESPONSE = Array
103
7
  end
@@ -0,0 +1,173 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "media_list_response_item_kind"
4
+ require_relative "media_list_response_item_files_item"
5
+ require "date"
6
+ require "ostruct"
7
+ require "json"
8
+
9
+ module Ittybit
10
+ class MediaListResponseItem
11
+ # @return [String]
12
+ attr_reader :id
13
+ # @return [String]
14
+ attr_reader :object
15
+ # @return [Ittybit::MediaListResponseItemKind]
16
+ attr_reader :kind
17
+ # @return [String]
18
+ attr_reader :title
19
+ # @return [String]
20
+ attr_reader :alt
21
+ # @return [Integer]
22
+ attr_reader :width
23
+ # @return [Integer]
24
+ attr_reader :height
25
+ # @return [Float]
26
+ attr_reader :duration
27
+ # @return [Array<Ittybit::MediaListResponseItemFilesItem>]
28
+ attr_reader :files
29
+ # @return [Hash{String => Object}]
30
+ attr_reader :urls
31
+ # @return [String]
32
+ attr_reader :background
33
+ # @return [Hash{String => Object}]
34
+ attr_reader :metadata
35
+ # @return [DateTime]
36
+ attr_reader :created
37
+ # @return [DateTime]
38
+ attr_reader :updated
39
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
40
+ attr_reader :additional_properties
41
+ # @return [Object]
42
+ attr_reader :_field_set
43
+ protected :_field_set
44
+
45
+ OMIT = Object.new
46
+
47
+ # @param id [String]
48
+ # @param object [String]
49
+ # @param kind [Ittybit::MediaListResponseItemKind]
50
+ # @param title [String]
51
+ # @param alt [String]
52
+ # @param width [Integer]
53
+ # @param height [Integer]
54
+ # @param duration [Float]
55
+ # @param files [Array<Ittybit::MediaListResponseItemFilesItem>]
56
+ # @param urls [Hash{String => Object}]
57
+ # @param background [String]
58
+ # @param metadata [Hash{String => Object}]
59
+ # @param created [DateTime]
60
+ # @param updated [DateTime]
61
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
62
+ # @return [Ittybit::MediaListResponseItem]
63
+ def initialize(id:, object:, files:, urls:, created:, updated:, kind: OMIT, title: OMIT, alt: OMIT, width: OMIT,
64
+ height: OMIT, duration: OMIT, background: OMIT, metadata: OMIT, additional_properties: nil)
65
+ @id = id
66
+ @object = object
67
+ @kind = kind if kind != OMIT
68
+ @title = title if title != OMIT
69
+ @alt = alt if alt != OMIT
70
+ @width = width if width != OMIT
71
+ @height = height if height != OMIT
72
+ @duration = duration if duration != OMIT
73
+ @files = files
74
+ @urls = urls
75
+ @background = background if background != OMIT
76
+ @metadata = metadata if metadata != OMIT
77
+ @created = created
78
+ @updated = updated
79
+ @additional_properties = additional_properties
80
+ @_field_set = {
81
+ "id": id,
82
+ "object": object,
83
+ "kind": kind,
84
+ "title": title,
85
+ "alt": alt,
86
+ "width": width,
87
+ "height": height,
88
+ "duration": duration,
89
+ "files": files,
90
+ "urls": urls,
91
+ "background": background,
92
+ "metadata": metadata,
93
+ "created": created,
94
+ "updated": updated
95
+ }.reject do |_k, v|
96
+ v == OMIT
97
+ end
98
+ end
99
+
100
+ # Deserialize a JSON object to an instance of MediaListResponseItem
101
+ #
102
+ # @param json_object [String]
103
+ # @return [Ittybit::MediaListResponseItem]
104
+ def self.from_json(json_object:)
105
+ struct = JSON.parse(json_object, object_class: OpenStruct)
106
+ parsed_json = JSON.parse(json_object)
107
+ id = parsed_json["id"]
108
+ object = parsed_json["object"]
109
+ kind = parsed_json["kind"]
110
+ title = parsed_json["title"]
111
+ alt = parsed_json["alt"]
112
+ width = parsed_json["width"]
113
+ height = parsed_json["height"]
114
+ duration = parsed_json["duration"]
115
+ files = parsed_json["files"]&.map do |item|
116
+ item = item.to_json
117
+ Ittybit::MediaListResponseItemFilesItem.from_json(json_object: item)
118
+ end
119
+ urls = parsed_json["urls"]
120
+ background = parsed_json["background"]
121
+ metadata = parsed_json["metadata"]
122
+ created = (DateTime.parse(parsed_json["created"]) unless parsed_json["created"].nil?)
123
+ updated = (DateTime.parse(parsed_json["updated"]) unless parsed_json["updated"].nil?)
124
+ new(
125
+ id: id,
126
+ object: object,
127
+ kind: kind,
128
+ title: title,
129
+ alt: alt,
130
+ width: width,
131
+ height: height,
132
+ duration: duration,
133
+ files: files,
134
+ urls: urls,
135
+ background: background,
136
+ metadata: metadata,
137
+ created: created,
138
+ updated: updated,
139
+ additional_properties: struct
140
+ )
141
+ end
142
+
143
+ # Serialize an instance of MediaListResponseItem to a JSON object
144
+ #
145
+ # @return [String]
146
+ def to_json(*_args)
147
+ @_field_set&.to_json
148
+ end
149
+
150
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
151
+ # hash and check each fields type against the current object's property
152
+ # definitions.
153
+ #
154
+ # @param obj [Object]
155
+ # @return [Void]
156
+ def self.validate_raw(obj:)
157
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
158
+ obj.object.is_a?(String) != false || raise("Passed value for field obj.object is not the expected type, validation failed.")
159
+ obj.kind&.is_a?(Ittybit::MediaListResponseItemKind) != false || raise("Passed value for field obj.kind is not the expected type, validation failed.")
160
+ obj.title&.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
161
+ obj.alt&.is_a?(String) != false || raise("Passed value for field obj.alt is not the expected type, validation failed.")
162
+ obj.width&.is_a?(Integer) != false || raise("Passed value for field obj.width is not the expected type, validation failed.")
163
+ obj.height&.is_a?(Integer) != false || raise("Passed value for field obj.height is not the expected type, validation failed.")
164
+ obj.duration&.is_a?(Float) != false || raise("Passed value for field obj.duration is not the expected type, validation failed.")
165
+ obj.files.is_a?(Array) != false || raise("Passed value for field obj.files is not the expected type, validation failed.")
166
+ obj.urls.is_a?(Hash) != false || raise("Passed value for field obj.urls is not the expected type, validation failed.")
167
+ obj.background&.is_a?(String) != false || raise("Passed value for field obj.background is not the expected type, validation failed.")
168
+ obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
169
+ obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
170
+ obj.updated.is_a?(DateTime) != false || raise("Passed value for field obj.updated is not the expected type, validation failed.")
171
+ end
172
+ end
173
+ end