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,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "automations_update_response_workflow_item_ref_kind"
4
+ require_relative "automations_update_response_workflow_item_ref_next_item"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Ittybit
9
+ class Automations
10
+ class AutomationsUpdateResponseWorkflowItemRef
11
+ # @return [Ittybit::Automations::AutomationsUpdateResponseWorkflowItemRefKind]
12
+ attr_reader :kind
13
+ # @return [String]
14
+ attr_reader :ref
15
+ # @return [Array<Ittybit::Automations::AutomationsUpdateResponseWorkflowItemRefNextItem>]
16
+ attr_reader :next_
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param kind [Ittybit::Automations::AutomationsUpdateResponseWorkflowItemRefKind]
26
+ # @param ref [String]
27
+ # @param next_ [Array<Ittybit::Automations::AutomationsUpdateResponseWorkflowItemRefNextItem>]
28
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
29
+ # @return [Ittybit::Automations::AutomationsUpdateResponseWorkflowItemRef]
30
+ def initialize(kind:, ref: OMIT, next_: OMIT, additional_properties: nil)
31
+ @kind = kind
32
+ @ref = ref if ref != OMIT
33
+ @next_ = next_ if next_ != OMIT
34
+ @additional_properties = additional_properties
35
+ @_field_set = { "kind": kind, "ref": ref, "next": next_ }.reject do |_k, v|
36
+ v == OMIT
37
+ end
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of
41
+ # AutomationsUpdateResponseWorkflowItemRef
42
+ #
43
+ # @param json_object [String]
44
+ # @return [Ittybit::Automations::AutomationsUpdateResponseWorkflowItemRef]
45
+ def self.from_json(json_object:)
46
+ struct = JSON.parse(json_object, object_class: OpenStruct)
47
+ parsed_json = JSON.parse(json_object)
48
+ kind = parsed_json["kind"]
49
+ ref = parsed_json["ref"]
50
+ next_ = parsed_json["next"]&.map do |item|
51
+ item = item.to_json
52
+ Ittybit::Automations::AutomationsUpdateResponseWorkflowItemRefNextItem.from_json(json_object: item)
53
+ end
54
+ new(
55
+ kind: kind,
56
+ ref: ref,
57
+ next_: next_,
58
+ additional_properties: struct
59
+ )
60
+ end
61
+
62
+ # Serialize an instance of AutomationsUpdateResponseWorkflowItemRef to a JSON
63
+ # object
64
+ #
65
+ # @return [String]
66
+ def to_json(*_args)
67
+ @_field_set&.to_json
68
+ end
69
+
70
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
71
+ # hash and check each fields type against the current object's property
72
+ # definitions.
73
+ #
74
+ # @param obj [Object]
75
+ # @return [Void]
76
+ def self.validate_raw(obj:)
77
+ obj.kind.is_a?(Ittybit::Automations::AutomationsUpdateResponseWorkflowItemRefKind) != false || raise("Passed value for field obj.kind is not the expected type, validation failed.")
78
+ obj.ref&.is_a?(String) != false || raise("Passed value for field obj.ref is not the expected type, validation failed.")
79
+ obj.next_&.is_a?(Array) != false || raise("Passed value for field obj.next_ is not the expected type, validation failed.")
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ittybit
4
+ class Automations
5
+ class AutomationsUpdateResponseWorkflowItemRefKind
6
+ VIDEO = "video"
7
+ IMAGE = "image"
8
+ AUDIO = "audio"
9
+ CHAPTERS = "chapters"
10
+ SUBTITLES = "subtitles"
11
+ THUMBNAILS = "thumbnails"
12
+ NSFW = "nsfw"
13
+ SPEECH = "speech"
14
+ DESCRIPTION = "description"
15
+ OUTLINE = "outline"
16
+ PROMPT = "prompt"
17
+ HTTP = "http"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Ittybit
7
+ class Automations
8
+ class AutomationsUpdateResponseWorkflowItemRefNextItem
9
+ # @return [String]
10
+ attr_reader :kind
11
+ # @return [String]
12
+ attr_reader :ref
13
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
14
+ attr_reader :additional_properties
15
+ # @return [Object]
16
+ attr_reader :_field_set
17
+ protected :_field_set
18
+
19
+ OMIT = Object.new
20
+
21
+ # @param kind [String]
22
+ # @param ref [String]
23
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
24
+ # @return [Ittybit::Automations::AutomationsUpdateResponseWorkflowItemRefNextItem]
25
+ def initialize(kind: OMIT, ref: OMIT, additional_properties: nil)
26
+ @kind = kind if kind != OMIT
27
+ @ref = ref if ref != OMIT
28
+ @additional_properties = additional_properties
29
+ @_field_set = { "kind": kind, "ref": ref }.reject do |_k, v|
30
+ v == OMIT
31
+ end
32
+ end
33
+
34
+ # Deserialize a JSON object to an instance of
35
+ # AutomationsUpdateResponseWorkflowItemRefNextItem
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Ittybit::Automations::AutomationsUpdateResponseWorkflowItemRefNextItem]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ kind = parsed_json["kind"]
43
+ ref = parsed_json["ref"]
44
+ new(
45
+ kind: kind,
46
+ ref: ref,
47
+ additional_properties: struct
48
+ )
49
+ end
50
+
51
+ # Serialize an instance of AutomationsUpdateResponseWorkflowItemRefNextItem to a
52
+ # JSON object
53
+ #
54
+ # @return [String]
55
+ def to_json(*_args)
56
+ @_field_set&.to_json
57
+ end
58
+
59
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
60
+ # hash and check each fields type against the current object's property
61
+ # definitions.
62
+ #
63
+ # @param obj [Object]
64
+ # @return [Void]
65
+ def self.validate_raw(obj:)
66
+ obj.kind&.is_a?(String) != false || raise("Passed value for field obj.kind is not the expected type, validation failed.")
67
+ obj.ref&.is_a?(String) != false || raise("Passed value for field obj.ref is not the expected type, validation failed.")
68
+ end
69
+ end
70
+ end
71
+ end
@@ -1,9 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../../requests"
4
- require_relative "../types/file_list_response"
5
- require_relative "../types/file_response"
6
- require_relative "../types/confirmation_response"
4
+ require_relative "types/files_list_response_item"
5
+ require "json"
6
+ require_relative "types/files_create_response"
7
+ require_relative "types/files_get_response"
8
+ require_relative "types/files_delete_response"
9
+ require_relative "types/files_update_response"
7
10
  require "async"
8
11
 
9
12
  module Ittybit
@@ -22,7 +25,7 @@ module Ittybit
22
25
  # @param page [Integer]
23
26
  # @param limit [Integer]
24
27
  # @param request_options [Ittybit::RequestOptions]
25
- # @return [Ittybit::FileListResponse]
28
+ # @return [Array<Ittybit::Files::FilesListResponseItem>]
26
29
  # @example
27
30
  # api = Ittybit::Client.new(
28
31
  # base_url: "https://api.example.com",
@@ -36,9 +39,10 @@ module Ittybit
36
39
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
37
40
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
38
41
  req.headers = {
39
- **(req.headers || {}),
40
- **@request_client.get_headers,
41
- **(request_options&.additional_headers || {})
42
+ **(req.headers || {}),
43
+ **@request_client.get_headers,
44
+ **(request_options&.additional_headers || {}),
45
+ "Accept-Version": "2025-08-20"
42
46
  }.compact
43
47
  req.params = { **(request_options&.additional_query_parameters || {}), "page": page, "limit": limit }.compact
44
48
  unless request_options.nil? || request_options&.additional_body_parameters.nil?
@@ -46,7 +50,11 @@ module Ittybit
46
50
  end
47
51
  req.url "#{@request_client.get_url(request_options: request_options)}/files"
48
52
  end
49
- Ittybit::FileListResponse.from_json(json_object: response.body)
53
+ parsed_json = JSON.parse(response.body)
54
+ parsed_json&.map do |item|
55
+ item = item.to_json
56
+ Ittybit::Files::FilesListResponseItem.from_json(json_object: item)
57
+ end
50
58
  end
51
59
 
52
60
  # Creates a new file from a publicly accessible or signed URL.
@@ -58,7 +66,7 @@ module Ittybit
58
66
  # @param ref [String]
59
67
  # @param metadata [Hash{String => Object}]
60
68
  # @param request_options [Ittybit::RequestOptions]
61
- # @return [Ittybit::FileResponse]
69
+ # @return [Ittybit::Files::FilesCreateResponse]
62
70
  # @example
63
71
  # api = Ittybit::Client.new(
64
72
  # base_url: "https://api.example.com",
@@ -77,9 +85,10 @@ module Ittybit
77
85
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
78
86
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
79
87
  req.headers = {
80
- **(req.headers || {}),
81
- **@request_client.get_headers,
82
- **(request_options&.additional_headers || {})
88
+ **(req.headers || {}),
89
+ **@request_client.get_headers,
90
+ **(request_options&.additional_headers || {}),
91
+ "Accept-Version": "2025-08-20"
83
92
  }.compact
84
93
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
85
94
  req.params = { **(request_options&.additional_query_parameters || {}) }.compact
@@ -95,14 +104,14 @@ module Ittybit
95
104
  }.compact
96
105
  req.url "#{@request_client.get_url(request_options: request_options)}/files"
97
106
  end
98
- Ittybit::FileResponse.from_json(json_object: response.body)
107
+ Ittybit::Files::FilesCreateResponse.from_json(json_object: response.body)
99
108
  end
100
109
 
101
110
  # Retrieve the file object for a file with the given ID.
102
111
  #
103
112
  # @param id [String]
104
113
  # @param request_options [Ittybit::RequestOptions]
105
- # @return [Ittybit::FileResponse]
114
+ # @return [Ittybit::Files::FilesGetResponse]
106
115
  # @example
107
116
  # api = Ittybit::Client.new(
108
117
  # base_url: "https://api.example.com",
@@ -116,9 +125,10 @@ module Ittybit
116
125
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
117
126
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
118
127
  req.headers = {
119
- **(req.headers || {}),
120
- **@request_client.get_headers,
121
- **(request_options&.additional_headers || {})
128
+ **(req.headers || {}),
129
+ **@request_client.get_headers,
130
+ **(request_options&.additional_headers || {}),
131
+ "Accept-Version": "2025-08-20"
122
132
  }.compact
123
133
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
124
134
  req.params = { **(request_options&.additional_query_parameters || {}) }.compact
@@ -128,14 +138,14 @@ module Ittybit
128
138
  end
129
139
  req.url "#{@request_client.get_url(request_options: request_options)}/files/#{id}"
130
140
  end
131
- Ittybit::FileResponse.from_json(json_object: response.body)
141
+ Ittybit::Files::FilesGetResponse.from_json(json_object: response.body)
132
142
  end
133
143
 
134
144
  # Permanently removes a file from the system. This action cannot be undone.
135
145
  #
136
146
  # @param id [String]
137
147
  # @param request_options [Ittybit::RequestOptions]
138
- # @return [Ittybit::ConfirmationResponse]
148
+ # @return [Ittybit::Files::FilesDeleteResponse]
139
149
  # @example
140
150
  # api = Ittybit::Client.new(
141
151
  # base_url: "https://api.example.com",
@@ -149,9 +159,10 @@ module Ittybit
149
159
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
150
160
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
151
161
  req.headers = {
152
- **(req.headers || {}),
153
- **@request_client.get_headers,
154
- **(request_options&.additional_headers || {})
162
+ **(req.headers || {}),
163
+ **@request_client.get_headers,
164
+ **(request_options&.additional_headers || {}),
165
+ "Accept-Version": "2025-08-20"
155
166
  }.compact
156
167
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
157
168
  req.params = { **(request_options&.additional_query_parameters || {}) }.compact
@@ -161,7 +172,7 @@ module Ittybit
161
172
  end
162
173
  req.url "#{@request_client.get_url(request_options: request_options)}/files/#{id}"
163
174
  end
164
- Ittybit::ConfirmationResponse.from_json(json_object: response.body)
175
+ Ittybit::Files::FilesDeleteResponse.from_json(json_object: response.body)
165
176
  end
166
177
 
167
178
  # Update a file's `filename`, `folder`, `ref`, or `metadata`. Only the specified
@@ -173,7 +184,7 @@ module Ittybit
173
184
  # @param ref [String]
174
185
  # @param metadata [Hash{String => Object}]
175
186
  # @param request_options [Ittybit::RequestOptions]
176
- # @return [Ittybit::FileResponse]
187
+ # @return [Ittybit::Files::FilesUpdateResponse]
177
188
  # @example
178
189
  # api = Ittybit::Client.new(
179
190
  # base_url: "https://api.example.com",
@@ -184,7 +195,7 @@ module Ittybit
184
195
  # id: "file_abcdefgh1234",
185
196
  # folder: "updated/folder",
186
197
  # filename: "new_filename.mp4",
187
- # metadata: { "customKey2": "a different custom value" }
198
+ # metadata: { "customKey": "a different custom value" }
188
199
  # )
189
200
  def update(id:, folder: nil, filename: nil, ref: nil, metadata: nil, request_options: nil)
190
201
  response = @request_client.conn.patch do |req|
@@ -192,9 +203,10 @@ module Ittybit
192
203
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
193
204
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
194
205
  req.headers = {
195
- **(req.headers || {}),
196
- **@request_client.get_headers,
197
- **(request_options&.additional_headers || {})
206
+ **(req.headers || {}),
207
+ **@request_client.get_headers,
208
+ **(request_options&.additional_headers || {}),
209
+ "Accept-Version": "2025-08-20"
198
210
  }.compact
199
211
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
200
212
  req.params = { **(request_options&.additional_query_parameters || {}) }.compact
@@ -208,7 +220,7 @@ module Ittybit
208
220
  }.compact
209
221
  req.url "#{@request_client.get_url(request_options: request_options)}/files/#{id}"
210
222
  end
211
- Ittybit::FileResponse.from_json(json_object: response.body)
223
+ Ittybit::Files::FilesUpdateResponse.from_json(json_object: response.body)
212
224
  end
213
225
  end
214
226
 
@@ -227,7 +239,7 @@ module Ittybit
227
239
  # @param page [Integer]
228
240
  # @param limit [Integer]
229
241
  # @param request_options [Ittybit::RequestOptions]
230
- # @return [Ittybit::FileListResponse]
242
+ # @return [Array<Ittybit::Files::FilesListResponseItem>]
231
243
  # @example
232
244
  # api = Ittybit::Client.new(
233
245
  # base_url: "https://api.example.com",
@@ -242,9 +254,10 @@ module Ittybit
242
254
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
243
255
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
244
256
  req.headers = {
245
- **(req.headers || {}),
246
- **@request_client.get_headers,
247
- **(request_options&.additional_headers || {})
257
+ **(req.headers || {}),
258
+ **@request_client.get_headers,
259
+ **(request_options&.additional_headers || {}),
260
+ "Accept-Version": "2025-08-20"
248
261
  }.compact
249
262
  req.params = { **(request_options&.additional_query_parameters || {}), "page": page, "limit": limit }.compact
250
263
  unless request_options.nil? || request_options&.additional_body_parameters.nil?
@@ -252,7 +265,11 @@ module Ittybit
252
265
  end
253
266
  req.url "#{@request_client.get_url(request_options: request_options)}/files"
254
267
  end
255
- Ittybit::FileListResponse.from_json(json_object: response.body)
268
+ parsed_json = JSON.parse(response.body)
269
+ parsed_json&.map do |item|
270
+ item = item.to_json
271
+ Ittybit::Files::FilesListResponseItem.from_json(json_object: item)
272
+ end
256
273
  end
257
274
  end
258
275
 
@@ -265,7 +282,7 @@ module Ittybit
265
282
  # @param ref [String]
266
283
  # @param metadata [Hash{String => Object}]
267
284
  # @param request_options [Ittybit::RequestOptions]
268
- # @return [Ittybit::FileResponse]
285
+ # @return [Ittybit::Files::FilesCreateResponse]
269
286
  # @example
270
287
  # api = Ittybit::Client.new(
271
288
  # base_url: "https://api.example.com",
@@ -285,9 +302,10 @@ module Ittybit
285
302
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
286
303
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
287
304
  req.headers = {
288
- **(req.headers || {}),
289
- **@request_client.get_headers,
290
- **(request_options&.additional_headers || {})
305
+ **(req.headers || {}),
306
+ **@request_client.get_headers,
307
+ **(request_options&.additional_headers || {}),
308
+ "Accept-Version": "2025-08-20"
291
309
  }.compact
292
310
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
293
311
  req.params = { **(request_options&.additional_query_parameters || {}) }.compact
@@ -303,7 +321,7 @@ module Ittybit
303
321
  }.compact
304
322
  req.url "#{@request_client.get_url(request_options: request_options)}/files"
305
323
  end
306
- Ittybit::FileResponse.from_json(json_object: response.body)
324
+ Ittybit::Files::FilesCreateResponse.from_json(json_object: response.body)
307
325
  end
308
326
  end
309
327
 
@@ -311,7 +329,7 @@ module Ittybit
311
329
  #
312
330
  # @param id [String]
313
331
  # @param request_options [Ittybit::RequestOptions]
314
- # @return [Ittybit::FileResponse]
332
+ # @return [Ittybit::Files::FilesGetResponse]
315
333
  # @example
316
334
  # api = Ittybit::Client.new(
317
335
  # base_url: "https://api.example.com",
@@ -326,9 +344,10 @@ module Ittybit
326
344
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
327
345
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
328
346
  req.headers = {
329
- **(req.headers || {}),
330
- **@request_client.get_headers,
331
- **(request_options&.additional_headers || {})
347
+ **(req.headers || {}),
348
+ **@request_client.get_headers,
349
+ **(request_options&.additional_headers || {}),
350
+ "Accept-Version": "2025-08-20"
332
351
  }.compact
333
352
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
334
353
  req.params = { **(request_options&.additional_query_parameters || {}) }.compact
@@ -338,7 +357,7 @@ module Ittybit
338
357
  end
339
358
  req.url "#{@request_client.get_url(request_options: request_options)}/files/#{id}"
340
359
  end
341
- Ittybit::FileResponse.from_json(json_object: response.body)
360
+ Ittybit::Files::FilesGetResponse.from_json(json_object: response.body)
342
361
  end
343
362
  end
344
363
 
@@ -346,7 +365,7 @@ module Ittybit
346
365
  #
347
366
  # @param id [String]
348
367
  # @param request_options [Ittybit::RequestOptions]
349
- # @return [Ittybit::ConfirmationResponse]
368
+ # @return [Ittybit::Files::FilesDeleteResponse]
350
369
  # @example
351
370
  # api = Ittybit::Client.new(
352
371
  # base_url: "https://api.example.com",
@@ -361,9 +380,10 @@ module Ittybit
361
380
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
362
381
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
363
382
  req.headers = {
364
- **(req.headers || {}),
365
- **@request_client.get_headers,
366
- **(request_options&.additional_headers || {})
383
+ **(req.headers || {}),
384
+ **@request_client.get_headers,
385
+ **(request_options&.additional_headers || {}),
386
+ "Accept-Version": "2025-08-20"
367
387
  }.compact
368
388
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
369
389
  req.params = { **(request_options&.additional_query_parameters || {}) }.compact
@@ -373,7 +393,7 @@ module Ittybit
373
393
  end
374
394
  req.url "#{@request_client.get_url(request_options: request_options)}/files/#{id}"
375
395
  end
376
- Ittybit::ConfirmationResponse.from_json(json_object: response.body)
396
+ Ittybit::Files::FilesDeleteResponse.from_json(json_object: response.body)
377
397
  end
378
398
  end
379
399
 
@@ -386,7 +406,7 @@ module Ittybit
386
406
  # @param ref [String]
387
407
  # @param metadata [Hash{String => Object}]
388
408
  # @param request_options [Ittybit::RequestOptions]
389
- # @return [Ittybit::FileResponse]
409
+ # @return [Ittybit::Files::FilesUpdateResponse]
390
410
  # @example
391
411
  # api = Ittybit::Client.new(
392
412
  # base_url: "https://api.example.com",
@@ -397,7 +417,7 @@ module Ittybit
397
417
  # id: "file_abcdefgh1234",
398
418
  # folder: "updated/folder",
399
419
  # filename: "new_filename.mp4",
400
- # metadata: { "customKey2": "a different custom value" }
420
+ # metadata: { "customKey": "a different custom value" }
401
421
  # )
402
422
  def update(id:, folder: nil, filename: nil, ref: nil, metadata: nil, request_options: nil)
403
423
  Async do
@@ -406,9 +426,10 @@ module Ittybit
406
426
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
407
427
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
408
428
  req.headers = {
409
- **(req.headers || {}),
410
- **@request_client.get_headers,
411
- **(request_options&.additional_headers || {})
429
+ **(req.headers || {}),
430
+ **@request_client.get_headers,
431
+ **(request_options&.additional_headers || {}),
432
+ "Accept-Version": "2025-08-20"
412
433
  }.compact
413
434
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
414
435
  req.params = { **(request_options&.additional_query_parameters || {}) }.compact
@@ -422,7 +443,7 @@ module Ittybit
422
443
  }.compact
423
444
  req.url "#{@request_client.get_url(request_options: request_options)}/files/#{id}"
424
445
  end
425
- Ittybit::FileResponse.from_json(json_object: response.body)
446
+ Ittybit::Files::FilesUpdateResponse.from_json(json_object: response.body)
426
447
  end
427
448
  end
428
449
  end