imagekitio 4.2.0 → 4.4.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 (154) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +73 -0
  3. data/README.md +9 -2
  4. data/lib/imagekitio/client.rb +14 -0
  5. data/lib/imagekitio/helpers/helper.rb +6 -0
  6. data/lib/imagekitio/internal/transport/pooled_net_requester.rb +1 -1
  7. data/lib/imagekitio/internal/type/base_model.rb +5 -5
  8. data/lib/imagekitio/internal/util.rb +54 -8
  9. data/lib/imagekitio/models/accounts/origin_create_params.rb +1 -9
  10. data/lib/imagekitio/models/accounts/origin_delete_params.rb +13 -1
  11. data/lib/imagekitio/models/accounts/origin_get_params.rb +13 -1
  12. data/lib/imagekitio/models/accounts/origin_update_params.rb +10 -6
  13. data/lib/imagekitio/models/accounts/url_endpoint_delete_params.rb +14 -1
  14. data/lib/imagekitio/models/accounts/url_endpoint_get_params.rb +14 -1
  15. data/lib/imagekitio/models/accounts/url_endpoint_update_params.rb +14 -1
  16. data/lib/imagekitio/models/ai_tag.rb +39 -0
  17. data/lib/imagekitio/models/beta/v2/file_upload_response.rb +9 -270
  18. data/lib/imagekitio/models/cache/invalidation_get_params.rb +7 -1
  19. data/lib/imagekitio/models/custom_metadata.rb +8 -0
  20. data/lib/imagekitio/models/custom_metadata_field_delete_params.rb +7 -1
  21. data/lib/imagekitio/models/custom_metadata_field_update_params.rb +8 -1
  22. data/lib/imagekitio/models/embedded_metadata.rb +8 -0
  23. data/lib/imagekitio/models/extension_config.rb +10 -5
  24. data/lib/imagekitio/models/extensions.rb +10 -5
  25. data/lib/imagekitio/models/file.rb +11 -275
  26. data/lib/imagekitio/models/file_create_event.rb +34 -0
  27. data/lib/imagekitio/models/file_delete_event.rb +44 -0
  28. data/lib/imagekitio/models/file_delete_params.rb +7 -1
  29. data/lib/imagekitio/models/file_get_params.rb +7 -1
  30. data/lib/imagekitio/models/file_update_event.rb +34 -0
  31. data/lib/imagekitio/models/file_update_params.rb +5 -7
  32. data/lib/imagekitio/models/file_upload_response.rb +9 -267
  33. data/lib/imagekitio/models/file_version_create_event.rb +34 -0
  34. data/lib/imagekitio/models/file_version_delete_event.rb +52 -0
  35. data/lib/imagekitio/models/files/metadata_get_params.rb +7 -1
  36. data/lib/imagekitio/models/files/version_delete_params.rb +7 -1
  37. data/lib/imagekitio/models/files/version_get_params.rb +7 -1
  38. data/lib/imagekitio/models/files/version_list_params.rb +7 -1
  39. data/lib/imagekitio/models/files/version_restore_params.rb +7 -1
  40. data/lib/imagekitio/models/folders/job_get_params.rb +7 -1
  41. data/lib/imagekitio/models/overlay_position.rb +99 -5
  42. data/lib/imagekitio/models/saved_extension_delete_params.rb +7 -1
  43. data/lib/imagekitio/models/saved_extension_get_params.rb +7 -1
  44. data/lib/imagekitio/models/saved_extension_update_params.rb +8 -1
  45. data/lib/imagekitio/models/selected_fields_schema.rb +212 -0
  46. data/lib/imagekitio/models/unsafe_unwrap_webhook_event.rb +16 -1
  47. data/lib/imagekitio/models/unwrap_webhook_event.rb +16 -1
  48. data/lib/imagekitio/models/upload_pre_transform_success_event.rb +9 -285
  49. data/lib/imagekitio/models/version_info.rb +26 -0
  50. data/lib/imagekitio/models.rb +25 -0
  51. data/lib/imagekitio/resources/accounts/origins.rb +4 -14
  52. data/lib/imagekitio/resources/accounts/usage.rb +2 -1
  53. data/lib/imagekitio/resources/assets.rb +2 -1
  54. data/lib/imagekitio/resources/beta/v2/files.rb +5 -4
  55. data/lib/imagekitio/resources/custom_metadata_fields.rb +2 -1
  56. data/lib/imagekitio/resources/files/metadata.rb +2 -1
  57. data/lib/imagekitio/resources/files.rb +7 -11
  58. data/lib/imagekitio/resources/webhooks.rb +14 -3
  59. data/lib/imagekitio/version.rb +1 -1
  60. data/lib/imagekitio.rb +12 -1
  61. data/rbi/imagekitio/client.rbi +13 -0
  62. data/rbi/imagekitio/internal/util.rbi +29 -1
  63. data/rbi/imagekitio/models/accounts/origin_create_params.rbi +4 -51
  64. data/rbi/imagekitio/models/accounts/origin_delete_params.rbi +18 -5
  65. data/rbi/imagekitio/models/accounts/origin_get_params.rbi +18 -5
  66. data/rbi/imagekitio/models/accounts/origin_update_params.rbi +9 -43
  67. data/rbi/imagekitio/models/accounts/url_endpoint_delete_params.rbi +20 -5
  68. data/rbi/imagekitio/models/accounts/url_endpoint_get_params.rbi +20 -5
  69. data/rbi/imagekitio/models/accounts/url_endpoint_update_params.rbi +20 -5
  70. data/rbi/imagekitio/models/ai_tag.rbi +56 -0
  71. data/rbi/imagekitio/models/beta/v2/file_upload_response.rbi +11 -535
  72. data/rbi/imagekitio/models/cache/invalidation_get_params.rbi +11 -5
  73. data/rbi/imagekitio/models/custom_metadata.rbi +11 -0
  74. data/rbi/imagekitio/models/custom_metadata_field_delete_params.rbi +13 -5
  75. data/rbi/imagekitio/models/custom_metadata_field_update_params.rbi +6 -0
  76. data/rbi/imagekitio/models/embedded_metadata.rbi +11 -0
  77. data/rbi/imagekitio/models/extension_config.rbi +16 -6
  78. data/rbi/imagekitio/models/extensions.rbi +16 -6
  79. data/rbi/imagekitio/models/file.rbi +15 -475
  80. data/rbi/imagekitio/models/file_create_event.rbi +53 -0
  81. data/rbi/imagekitio/models/file_delete_event.rbi +80 -0
  82. data/rbi/imagekitio/models/file_delete_params.rbi +13 -5
  83. data/rbi/imagekitio/models/file_get_params.rbi +13 -5
  84. data/rbi/imagekitio/models/file_update_event.rbi +53 -0
  85. data/rbi/imagekitio/models/file_update_params.rbi +5 -28
  86. data/rbi/imagekitio/models/file_upload_response.rbi +11 -520
  87. data/rbi/imagekitio/models/file_version_create_event.rbi +56 -0
  88. data/rbi/imagekitio/models/file_version_delete_event.rbi +93 -0
  89. data/rbi/imagekitio/models/files/metadata_get_params.rbi +11 -5
  90. data/rbi/imagekitio/models/files/version_delete_params.rbi +10 -2
  91. data/rbi/imagekitio/models/files/version_get_params.rbi +10 -2
  92. data/rbi/imagekitio/models/files/version_list_params.rbi +11 -5
  93. data/rbi/imagekitio/models/files/version_restore_params.rbi +10 -2
  94. data/rbi/imagekitio/models/folders/job_get_params.rbi +11 -5
  95. data/rbi/imagekitio/models/overlay_position.rbi +165 -9
  96. data/rbi/imagekitio/models/saved_extension_delete_params.rbi +13 -5
  97. data/rbi/imagekitio/models/saved_extension_get_params.rbi +13 -5
  98. data/rbi/imagekitio/models/saved_extension_update_params.rbi +6 -0
  99. data/rbi/imagekitio/models/selected_fields_schema.rbi +364 -0
  100. data/rbi/imagekitio/models/unsafe_unwrap_webhook_event.rbi +6 -1
  101. data/rbi/imagekitio/models/unwrap_webhook_event.rbi +6 -1
  102. data/rbi/imagekitio/models/upload_pre_transform_success_event.rbi +11 -533
  103. data/rbi/imagekitio/models/version_info.rbi +40 -0
  104. data/rbi/imagekitio/models.rbi +34 -0
  105. data/rbi/imagekitio/resources/accounts/origins.rbi +22 -2
  106. data/rbi/imagekitio/resources/beta/v2/files.rbi +5 -4
  107. data/rbi/imagekitio/resources/files.rbi +10 -5
  108. data/rbi/imagekitio/resources/webhooks.rbi +22 -4
  109. data/sig/imagekitio/client.rbs +3 -0
  110. data/sig/imagekitio/internal/util.rbs +14 -0
  111. data/sig/imagekitio/models/accounts/origin_create_params.rbs +3 -16
  112. data/sig/imagekitio/models/accounts/origin_delete_params.rbs +11 -3
  113. data/sig/imagekitio/models/accounts/origin_get_params.rbs +11 -3
  114. data/sig/imagekitio/models/accounts/origin_update_params.rbs +4 -9
  115. data/sig/imagekitio/models/accounts/url_endpoint_delete_params.rbs +11 -3
  116. data/sig/imagekitio/models/accounts/url_endpoint_get_params.rbs +11 -3
  117. data/sig/imagekitio/models/accounts/url_endpoint_update_params.rbs +13 -3
  118. data/sig/imagekitio/models/ai_tag.rbs +27 -0
  119. data/sig/imagekitio/models/beta/v2/file_upload_response.rbs +30 -223
  120. data/sig/imagekitio/models/cache/invalidation_get_params.rbs +11 -3
  121. data/sig/imagekitio/models/custom_metadata.rbs +7 -0
  122. data/sig/imagekitio/models/custom_metadata_field_delete_params.rbs +11 -3
  123. data/sig/imagekitio/models/custom_metadata_field_update_params.rbs +5 -0
  124. data/sig/imagekitio/models/embedded_metadata.rbs +7 -0
  125. data/sig/imagekitio/models/file.rbs +29 -224
  126. data/sig/imagekitio/models/file_create_event.rbs +32 -0
  127. data/sig/imagekitio/models/file_delete_event.rbs +48 -0
  128. data/sig/imagekitio/models/file_delete_params.rbs +11 -3
  129. data/sig/imagekitio/models/file_get_params.rbs +12 -3
  130. data/sig/imagekitio/models/file_update_event.rbs +32 -0
  131. data/sig/imagekitio/models/file_update_params.rbs +4 -9
  132. data/sig/imagekitio/models/file_upload_response.rbs +29 -224
  133. data/sig/imagekitio/models/file_version_create_event.rbs +36 -0
  134. data/sig/imagekitio/models/file_version_delete_event.rbs +50 -0
  135. data/sig/imagekitio/models/files/metadata_get_params.rbs +11 -3
  136. data/sig/imagekitio/models/files/version_delete_params.rbs +6 -1
  137. data/sig/imagekitio/models/files/version_get_params.rbs +6 -1
  138. data/sig/imagekitio/models/files/version_list_params.rbs +11 -3
  139. data/sig/imagekitio/models/files/version_restore_params.rbs +6 -1
  140. data/sig/imagekitio/models/folders/job_get_params.rbs +11 -3
  141. data/sig/imagekitio/models/overlay_position.rbs +73 -3
  142. data/sig/imagekitio/models/saved_extension_delete_params.rbs +11 -3
  143. data/sig/imagekitio/models/saved_extension_get_params.rbs +11 -3
  144. data/sig/imagekitio/models/saved_extension_update_params.rbs +5 -0
  145. data/sig/imagekitio/models/selected_fields_schema.rbs +165 -0
  146. data/sig/imagekitio/models/unsafe_unwrap_webhook_event.rbs +5 -0
  147. data/sig/imagekitio/models/unwrap_webhook_event.rbs +5 -0
  148. data/sig/imagekitio/models/upload_pre_transform_success_event.rbs +29 -224
  149. data/sig/imagekitio/models/version_info.rbs +19 -0
  150. data/sig/imagekitio/models.rbs +22 -0
  151. data/sig/imagekitio/resources/accounts/origins.rbs +2 -2
  152. data/sig/imagekitio/resources/files.rbs +1 -1
  153. data/sig/imagekitio/resources/webhooks.rbs +15 -3
  154. metadata +46 -2
@@ -7,7 +7,13 @@ module Imagekitio
7
7
  extend Imagekitio::Internal::Type::RequestParameters::Converter
8
8
  include Imagekitio::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!method initialize(id:, request_options: {})
16
+ # @param id [String]
11
17
  # @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
12
18
  end
13
19
  end
@@ -7,6 +7,11 @@ module Imagekitio
7
7
  extend Imagekitio::Internal::Type::RequestParameters::Converter
8
8
  include Imagekitio::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
10
15
  # @!attribute config
11
16
  # Configuration object for an extension (base extensions only, not saved extension
12
17
  # references).
@@ -26,10 +31,12 @@ module Imagekitio
26
31
  # @return [String, nil]
27
32
  optional :name, String
28
33
 
29
- # @!method initialize(config: nil, description: nil, name: nil, request_options: {})
34
+ # @!method initialize(id:, config: nil, description: nil, name: nil, request_options: {})
30
35
  # Some parameter documentations has been truncated, see
31
36
  # {Imagekitio::Models::SavedExtensionUpdateParams} for more details.
32
37
  #
38
+ # @param id [String]
39
+ #
33
40
  # @param config [Imagekitio::Models::ExtensionConfig::RemoveBg, Imagekitio::Models::ExtensionConfig::AIAutoDescription, Imagekitio::Models::ExtensionConfig::AITasks, Imagekitio::Models::ExtensionConfig::AutoTaggingExtension] Configuration object for an extension (base extensions only, not saved extension
34
41
  #
35
42
  # @param description [String] Updated description of the saved extension.
@@ -0,0 +1,212 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ class SelectedFieldsSchemaItem < Imagekitio::Internal::Type::BaseModel
6
+ # @!attribute type
7
+ # Type of the custom metadata field.
8
+ #
9
+ # @return [Symbol, Imagekitio::Models::SelectedFieldsSchemaItem::Type]
10
+ required :type, enum: -> { Imagekitio::SelectedFieldsSchemaItem::Type }
11
+
12
+ # @!attribute default_value
13
+ # The default value for this custom metadata field. The value should match the
14
+ # `type` of custom metadata field.
15
+ #
16
+ # @return [String, Float, Boolean, Array<String, Float, Boolean>, nil]
17
+ optional :default_value,
18
+ union: -> { Imagekitio::SelectedFieldsSchemaItem::DefaultValue },
19
+ api_name: :defaultValue
20
+
21
+ # @!attribute is_value_required
22
+ # Specifies if the custom metadata field is required or not.
23
+ #
24
+ # @return [Boolean, nil]
25
+ optional :is_value_required, Imagekitio::Internal::Type::Boolean, api_name: :isValueRequired
26
+
27
+ # @!attribute max_length
28
+ # Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
29
+ #
30
+ # @return [Float, nil]
31
+ optional :max_length, Float, api_name: :maxLength
32
+
33
+ # @!attribute max_value
34
+ # Maximum value of the field. Only set if field type is `Date` or `Number`. For
35
+ # `Date` type field, the value will be in ISO8601 string format. For `Number` type
36
+ # field, it will be a numeric value.
37
+ #
38
+ # @return [String, Float, nil]
39
+ optional :max_value, union: -> { Imagekitio::SelectedFieldsSchemaItem::MaxValue }, api_name: :maxValue
40
+
41
+ # @!attribute min_length
42
+ # Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
43
+ #
44
+ # @return [Float, nil]
45
+ optional :min_length, Float, api_name: :minLength
46
+
47
+ # @!attribute min_value
48
+ # Minimum value of the field. Only set if field type is `Date` or `Number`. For
49
+ # `Date` type field, the value will be in ISO8601 string format. For `Number` type
50
+ # field, it will be a numeric value.
51
+ #
52
+ # @return [String, Float, nil]
53
+ optional :min_value, union: -> { Imagekitio::SelectedFieldsSchemaItem::MinValue }, api_name: :minValue
54
+
55
+ # @!attribute read_only
56
+ # Indicates whether the custom metadata field is read only. A read only field
57
+ # cannot be modified after being set. This field is configurable only via the
58
+ # **Path policy** feature.
59
+ #
60
+ # @return [Boolean, nil]
61
+ optional :read_only, Imagekitio::Internal::Type::Boolean, api_name: :readOnly
62
+
63
+ # @!attribute select_options
64
+ # An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
65
+ #
66
+ # @return [Array<String, Float, Boolean>, nil]
67
+ optional :select_options,
68
+ -> {
69
+ Imagekitio::Internal::Type::ArrayOf[union: Imagekitio::SelectedFieldsSchemaItem::SelectOption]
70
+ },
71
+ api_name: :selectOptions
72
+
73
+ # @!attribute select_options_truncated
74
+ # Specifies if the selectOptions array is truncated. It is truncated when number
75
+ # of options are > 100.
76
+ #
77
+ # @return [Boolean, nil]
78
+ optional :select_options_truncated,
79
+ Imagekitio::Internal::Type::Boolean,
80
+ api_name: :selectOptionsTruncated
81
+
82
+ # @!method initialize(type:, default_value: nil, is_value_required: nil, max_length: nil, max_value: nil, min_length: nil, min_value: nil, read_only: nil, select_options: nil, select_options_truncated: nil)
83
+ # Some parameter documentations has been truncated, see
84
+ # {Imagekitio::Models::SelectedFieldsSchemaItem} for more details.
85
+ #
86
+ # @param type [Symbol, Imagekitio::Models::SelectedFieldsSchemaItem::Type] Type of the custom metadata field.
87
+ #
88
+ # @param default_value [String, Float, Boolean, Array<String, Float, Boolean>] The default value for this custom metadata field. The value should match the `ty
89
+ #
90
+ # @param is_value_required [Boolean] Specifies if the custom metadata field is required or not.
91
+ #
92
+ # @param max_length [Float] Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
93
+ #
94
+ # @param max_value [String, Float] Maximum value of the field. Only set if field type is `Date` or `Number`. For `D
95
+ #
96
+ # @param min_length [Float] Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
97
+ #
98
+ # @param min_value [String, Float] Minimum value of the field. Only set if field type is `Date` or `Number`. For `D
99
+ #
100
+ # @param read_only [Boolean] Indicates whether the custom metadata field is read only. A read only field cann
101
+ #
102
+ # @param select_options [Array<String, Float, Boolean>] An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
103
+ #
104
+ # @param select_options_truncated [Boolean] Specifies if the selectOptions array is truncated. It is truncated when number o
105
+
106
+ # Type of the custom metadata field.
107
+ #
108
+ # @see Imagekitio::Models::SelectedFieldsSchemaItem#type
109
+ module Type
110
+ extend Imagekitio::Internal::Type::Enum
111
+
112
+ TEXT = :Text
113
+ TEXTAREA = :Textarea
114
+ NUMBER = :Number
115
+ DATE = :Date
116
+ BOOLEAN = :Boolean
117
+ SINGLE_SELECT = :SingleSelect
118
+ MULTI_SELECT = :MultiSelect
119
+
120
+ # @!method self.values
121
+ # @return [Array<Symbol>]
122
+ end
123
+
124
+ # The default value for this custom metadata field. The value should match the
125
+ # `type` of custom metadata field.
126
+ #
127
+ # @see Imagekitio::Models::SelectedFieldsSchemaItem#default_value
128
+ module DefaultValue
129
+ extend Imagekitio::Internal::Type::Union
130
+
131
+ variant String
132
+
133
+ variant Float
134
+
135
+ variant Imagekitio::Internal::Type::Boolean
136
+
137
+ # Default value should be of type array when custom metadata field type is set to `MultiSelect`.
138
+ variant -> { Imagekitio::Models::SelectedFieldsSchemaItem::DefaultValue::MixedArray }
139
+
140
+ module Mixed
141
+ extend Imagekitio::Internal::Type::Union
142
+
143
+ variant String
144
+
145
+ variant Float
146
+
147
+ variant Imagekitio::Internal::Type::Boolean
148
+
149
+ # @!method self.variants
150
+ # @return [Array(String, Float, Boolean)]
151
+ end
152
+
153
+ # @!method self.variants
154
+ # @return [Array(String, Float, Boolean, Array<String, Float, Boolean>)]
155
+
156
+ # @type [Imagekitio::Internal::Type::Converter]
157
+ MixedArray =
158
+ Imagekitio::Internal::Type::ArrayOf[union: -> {
159
+ Imagekitio::SelectedFieldsSchemaItem::DefaultValue::Mixed
160
+ }]
161
+ end
162
+
163
+ # Maximum value of the field. Only set if field type is `Date` or `Number`. For
164
+ # `Date` type field, the value will be in ISO8601 string format. For `Number` type
165
+ # field, it will be a numeric value.
166
+ #
167
+ # @see Imagekitio::Models::SelectedFieldsSchemaItem#max_value
168
+ module MaxValue
169
+ extend Imagekitio::Internal::Type::Union
170
+
171
+ variant String
172
+
173
+ variant Float
174
+
175
+ # @!method self.variants
176
+ # @return [Array(String, Float)]
177
+ end
178
+
179
+ # Minimum value of the field. Only set if field type is `Date` or `Number`. For
180
+ # `Date` type field, the value will be in ISO8601 string format. For `Number` type
181
+ # field, it will be a numeric value.
182
+ #
183
+ # @see Imagekitio::Models::SelectedFieldsSchemaItem#min_value
184
+ module MinValue
185
+ extend Imagekitio::Internal::Type::Union
186
+
187
+ variant String
188
+
189
+ variant Float
190
+
191
+ # @!method self.variants
192
+ # @return [Array(String, Float)]
193
+ end
194
+
195
+ module SelectOption
196
+ extend Imagekitio::Internal::Type::Union
197
+
198
+ variant String
199
+
200
+ variant Float
201
+
202
+ variant Imagekitio::Internal::Type::Boolean
203
+
204
+ # @!method self.variants
205
+ # @return [Array(String, Float, Boolean)]
206
+ end
207
+ end
208
+
209
+ # @type [Imagekitio::Internal::Type::Converter]
210
+ SelectedFieldsSchema = Imagekitio::Internal::Type::HashOf[-> { Imagekitio::SelectedFieldsSchemaItem }]
211
+ end
212
+ end
@@ -31,8 +31,23 @@ module Imagekitio
31
31
  # Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated.
32
32
  variant -> { Imagekitio::UploadPostTransformErrorEvent }
33
33
 
34
+ # Triggered when a file is created.
35
+ variant -> { Imagekitio::FileCreateEvent }
36
+
37
+ # Triggered when a file is updated.
38
+ variant -> { Imagekitio::FileUpdateEvent }
39
+
40
+ # Triggered when a file is deleted.
41
+ variant -> { Imagekitio::FileDeleteEvent }
42
+
43
+ # Triggered when a file version is created.
44
+ variant -> { Imagekitio::FileVersionCreateEvent }
45
+
46
+ # Triggered when a file version is deleted.
47
+ variant -> { Imagekitio::FileVersionDeleteEvent }
48
+
34
49
  # @!method self.variants
35
- # @return [Array(Imagekitio::Models::VideoTransformationAcceptedEvent, Imagekitio::Models::VideoTransformationReadyEvent, Imagekitio::Models::VideoTransformationErrorEvent, Imagekitio::Models::UploadPreTransformSuccessEvent, Imagekitio::Models::UploadPreTransformErrorEvent, Imagekitio::Models::UploadPostTransformSuccessEvent, Imagekitio::Models::UploadPostTransformErrorEvent)]
50
+ # @return [Array(Imagekitio::Models::VideoTransformationAcceptedEvent, Imagekitio::Models::VideoTransformationReadyEvent, Imagekitio::Models::VideoTransformationErrorEvent, Imagekitio::Models::UploadPreTransformSuccessEvent, Imagekitio::Models::UploadPreTransformErrorEvent, Imagekitio::Models::UploadPostTransformSuccessEvent, Imagekitio::Models::UploadPostTransformErrorEvent, Imagekitio::Models::FileCreateEvent, Imagekitio::Models::FileUpdateEvent, Imagekitio::Models::FileDeleteEvent, Imagekitio::Models::FileVersionCreateEvent, Imagekitio::Models::FileVersionDeleteEvent)]
36
51
  end
37
52
  end
38
53
  end
@@ -31,8 +31,23 @@ module Imagekitio
31
31
  # Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated.
32
32
  variant -> { Imagekitio::UploadPostTransformErrorEvent }
33
33
 
34
+ # Triggered when a file is created.
35
+ variant -> { Imagekitio::FileCreateEvent }
36
+
37
+ # Triggered when a file is updated.
38
+ variant -> { Imagekitio::FileUpdateEvent }
39
+
40
+ # Triggered when a file is deleted.
41
+ variant -> { Imagekitio::FileDeleteEvent }
42
+
43
+ # Triggered when a file version is created.
44
+ variant -> { Imagekitio::FileVersionCreateEvent }
45
+
46
+ # Triggered when a file version is deleted.
47
+ variant -> { Imagekitio::FileVersionDeleteEvent }
48
+
34
49
  # @!method self.variants
35
- # @return [Array(Imagekitio::Models::VideoTransformationAcceptedEvent, Imagekitio::Models::VideoTransformationReadyEvent, Imagekitio::Models::VideoTransformationErrorEvent, Imagekitio::Models::UploadPreTransformSuccessEvent, Imagekitio::Models::UploadPreTransformErrorEvent, Imagekitio::Models::UploadPostTransformSuccessEvent, Imagekitio::Models::UploadPostTransformErrorEvent)]
50
+ # @return [Array(Imagekitio::Models::VideoTransformationAcceptedEvent, Imagekitio::Models::VideoTransformationReadyEvent, Imagekitio::Models::VideoTransformationErrorEvent, Imagekitio::Models::UploadPreTransformSuccessEvent, Imagekitio::Models::UploadPreTransformErrorEvent, Imagekitio::Models::UploadPostTransformSuccessEvent, Imagekitio::Models::UploadPostTransformErrorEvent, Imagekitio::Models::FileCreateEvent, Imagekitio::Models::FileUpdateEvent, Imagekitio::Models::FileDeleteEvent, Imagekitio::Models::FileVersionCreateEvent, Imagekitio::Models::FileVersionDeleteEvent)]
36
51
  end
37
52
  end
38
53
  end
@@ -42,11 +42,9 @@ module Imagekitio
42
42
  # @!attribute ai_tags
43
43
  # An array of tags assigned to the uploaded file by auto tagging.
44
44
  #
45
- # @return [Array<Imagekitio::Models::UploadPreTransformSuccessEvent::Data::AITag>, nil]
45
+ # @return [Array<Imagekitio::Models::AITag>, nil]
46
46
  optional :ai_tags,
47
- -> {
48
- Imagekitio::Internal::Type::ArrayOf[Imagekitio::UploadPreTransformSuccessEvent::Data::AITag]
49
- },
47
+ -> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::AITag] },
50
48
  api_name: :AITags,
51
49
  nil?: true
52
50
 
@@ -186,11 +184,9 @@ module Imagekitio
186
184
  # Keys are the names of the custom metadata fields; the value object has details
187
185
  # about the custom metadata schema.
188
186
  #
189
- # @return [Hash{Symbol=>Imagekitio::Models::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema}, nil]
187
+ # @return [Hash{Symbol=>Imagekitio::Models::SelectedFieldsSchemaItem}, nil]
190
188
  optional :selected_fields_schema,
191
- -> {
192
- Imagekitio::Internal::Type::HashOf[Imagekitio::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema]
193
- },
189
+ -> { Imagekitio::Internal::Type::HashOf[Imagekitio::SelectedFieldsSchemaItem] },
194
190
  api_name: :selectedFieldsSchema
195
191
 
196
192
  # @!attribute size
@@ -222,10 +218,8 @@ module Imagekitio
222
218
  # @!attribute version_info
223
219
  # An object containing the file or file version's `id` (versionId) and `name`.
224
220
  #
225
- # @return [Imagekitio::Models::UploadPreTransformSuccessEvent::Data::VersionInfo, nil]
226
- optional :version_info,
227
- -> { Imagekitio::UploadPreTransformSuccessEvent::Data::VersionInfo },
228
- api_name: :versionInfo
221
+ # @return [Imagekitio::Models::VersionInfo, nil]
222
+ optional :version_info, -> { Imagekitio::VersionInfo }, api_name: :versionInfo
229
223
 
230
224
  # @!attribute video_codec
231
225
  # The video codec used in the video (only for video).
@@ -245,7 +239,7 @@ module Imagekitio
245
239
  #
246
240
  # Object containing details of a successful upload.
247
241
  #
248
- # @param ai_tags [Array<Imagekitio::Models::UploadPreTransformSuccessEvent::Data::AITag>, nil] An array of tags assigned to the uploaded file by auto tagging.
242
+ # @param ai_tags [Array<Imagekitio::Models::AITag>, nil] An array of tags assigned to the uploaded file by auto tagging.
249
243
  #
250
244
  # @param audio_codec [String] The audio codec used in the video (only for video).
251
245
  #
@@ -279,7 +273,7 @@ module Imagekitio
279
273
  #
280
274
  # @param name [String] Name of the asset.
281
275
  #
282
- # @param selected_fields_schema [Hash{Symbol=>Imagekitio::Models::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema}] This field is included in the response only if the Path policy feature is availa
276
+ # @param selected_fields_schema [Hash{Symbol=>Imagekitio::Models::SelectedFieldsSchemaItem}] This field is included in the response only if the Path policy feature is availa
283
277
  #
284
278
  # @param size [Float] Size of the image file in Bytes.
285
279
  #
@@ -289,45 +283,12 @@ module Imagekitio
289
283
  #
290
284
  # @param url [String] A publicly accessible URL of the file.
291
285
  #
292
- # @param version_info [Imagekitio::Models::UploadPreTransformSuccessEvent::Data::VersionInfo] An object containing the file or file version's `id` (versionId) and `name`.
286
+ # @param version_info [Imagekitio::Models::VersionInfo] An object containing the file or file version's `id` (versionId) and `name`.
293
287
  #
294
288
  # @param video_codec [String] The video codec used in the video (only for video).
295
289
  #
296
290
  # @param width [Float] Width of the image in pixels (Only for Images)
297
291
 
298
- class AITag < Imagekitio::Internal::Type::BaseModel
299
- # @!attribute confidence
300
- # Confidence score of the tag.
301
- #
302
- # @return [Float, nil]
303
- optional :confidence, Float
304
-
305
- # @!attribute name
306
- # Name of the tag.
307
- #
308
- # @return [String, nil]
309
- optional :name, String
310
-
311
- # @!attribute source
312
- # Array of `AITags` associated with the image. If no `AITags` are set, it will be
313
- # null. These tags can be added using the `google-auto-tagging` or
314
- # `aws-auto-tagging` extensions.
315
- #
316
- # @return [String, nil]
317
- optional :source, String
318
-
319
- # @!method initialize(confidence: nil, name: nil, source: nil)
320
- # Some parameter documentations has been truncated, see
321
- # {Imagekitio::Models::UploadPreTransformSuccessEvent::Data::AITag} for more
322
- # details.
323
- #
324
- # @param confidence [Float] Confidence score of the tag.
325
- #
326
- # @param name [String] Name of the tag.
327
- #
328
- # @param source [String] Array of `AITags` associated with the image. If no `AITags` are set, it will be
329
- end
330
-
331
292
  # @see Imagekitio::Models::UploadPreTransformSuccessEvent::Data#extension_status
332
293
  class ExtensionStatus < Imagekitio::Internal::Type::BaseModel
333
294
  # @!attribute ai_auto_description
@@ -448,243 +409,6 @@ module Imagekitio
448
409
  # @return [Array<Symbol>]
449
410
  end
450
411
  end
451
-
452
- class SelectedFieldsSchema < Imagekitio::Internal::Type::BaseModel
453
- # @!attribute type
454
- # Type of the custom metadata field.
455
- #
456
- # @return [Symbol, Imagekitio::Models::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema::Type]
457
- required :type, enum: -> { Imagekitio::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema::Type }
458
-
459
- # @!attribute default_value
460
- # The default value for this custom metadata field. The value should match the
461
- # `type` of custom metadata field.
462
- #
463
- # @return [String, Float, Boolean, Array<String, Float, Boolean>, nil]
464
- optional :default_value,
465
- union: -> {
466
- Imagekitio::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema::DefaultValue
467
- },
468
- api_name: :defaultValue
469
-
470
- # @!attribute is_value_required
471
- # Specifies if the custom metadata field is required or not.
472
- #
473
- # @return [Boolean, nil]
474
- optional :is_value_required, Imagekitio::Internal::Type::Boolean, api_name: :isValueRequired
475
-
476
- # @!attribute max_length
477
- # Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
478
- #
479
- # @return [Float, nil]
480
- optional :max_length, Float, api_name: :maxLength
481
-
482
- # @!attribute max_value
483
- # Maximum value of the field. Only set if field type is `Date` or `Number`. For
484
- # `Date` type field, the value will be in ISO8601 string format. For `Number` type
485
- # field, it will be a numeric value.
486
- #
487
- # @return [String, Float, nil]
488
- optional :max_value,
489
- union: -> {
490
- Imagekitio::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema::MaxValue
491
- },
492
- api_name: :maxValue
493
-
494
- # @!attribute min_length
495
- # Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
496
- #
497
- # @return [Float, nil]
498
- optional :min_length, Float, api_name: :minLength
499
-
500
- # @!attribute min_value
501
- # Minimum value of the field. Only set if field type is `Date` or `Number`. For
502
- # `Date` type field, the value will be in ISO8601 string format. For `Number` type
503
- # field, it will be a numeric value.
504
- #
505
- # @return [String, Float, nil]
506
- optional :min_value,
507
- union: -> {
508
- Imagekitio::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema::MinValue
509
- },
510
- api_name: :minValue
511
-
512
- # @!attribute read_only
513
- # Indicates whether the custom metadata field is read only. A read only field
514
- # cannot be modified after being set. This field is configurable only via the
515
- # **Path policy** feature.
516
- #
517
- # @return [Boolean, nil]
518
- optional :read_only, Imagekitio::Internal::Type::Boolean, api_name: :readOnly
519
-
520
- # @!attribute select_options
521
- # An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
522
- #
523
- # @return [Array<String, Float, Boolean>, nil]
524
- optional :select_options,
525
- -> {
526
- Imagekitio::Internal::Type::ArrayOf[union: Imagekitio::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema::SelectOption]
527
- },
528
- api_name: :selectOptions
529
-
530
- # @!attribute select_options_truncated
531
- # Specifies if the selectOptions array is truncated. It is truncated when number
532
- # of options are > 100.
533
- #
534
- # @return [Boolean, nil]
535
- optional :select_options_truncated,
536
- Imagekitio::Internal::Type::Boolean,
537
- api_name: :selectOptionsTruncated
538
-
539
- # @!method initialize(type:, default_value: nil, is_value_required: nil, max_length: nil, max_value: nil, min_length: nil, min_value: nil, read_only: nil, select_options: nil, select_options_truncated: nil)
540
- # Some parameter documentations has been truncated, see
541
- # {Imagekitio::Models::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema}
542
- # for more details.
543
- #
544
- # @param type [Symbol, Imagekitio::Models::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema::Type] Type of the custom metadata field.
545
- #
546
- # @param default_value [String, Float, Boolean, Array<String, Float, Boolean>] The default value for this custom metadata field. The value should match the `ty
547
- #
548
- # @param is_value_required [Boolean] Specifies if the custom metadata field is required or not.
549
- #
550
- # @param max_length [Float] Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
551
- #
552
- # @param max_value [String, Float] Maximum value of the field. Only set if field type is `Date` or `Number`. For `D
553
- #
554
- # @param min_length [Float] Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
555
- #
556
- # @param min_value [String, Float] Minimum value of the field. Only set if field type is `Date` or `Number`. For `D
557
- #
558
- # @param read_only [Boolean] Indicates whether the custom metadata field is read only. A read only field cann
559
- #
560
- # @param select_options [Array<String, Float, Boolean>] An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
561
- #
562
- # @param select_options_truncated [Boolean] Specifies if the selectOptions array is truncated. It is truncated when number o
563
-
564
- # Type of the custom metadata field.
565
- #
566
- # @see Imagekitio::Models::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema#type
567
- module Type
568
- extend Imagekitio::Internal::Type::Enum
569
-
570
- TEXT = :Text
571
- TEXTAREA = :Textarea
572
- NUMBER = :Number
573
- DATE = :Date
574
- BOOLEAN = :Boolean
575
- SINGLE_SELECT = :SingleSelect
576
- MULTI_SELECT = :MultiSelect
577
-
578
- # @!method self.values
579
- # @return [Array<Symbol>]
580
- end
581
-
582
- # The default value for this custom metadata field. The value should match the
583
- # `type` of custom metadata field.
584
- #
585
- # @see Imagekitio::Models::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema#default_value
586
- module DefaultValue
587
- extend Imagekitio::Internal::Type::Union
588
-
589
- variant String
590
-
591
- variant Float
592
-
593
- variant Imagekitio::Internal::Type::Boolean
594
-
595
- # Default value should be of type array when custom metadata field type is set to `MultiSelect`.
596
- variant -> { Imagekitio::Models::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema::DefaultValue::MixedArray }
597
-
598
- module Mixed
599
- extend Imagekitio::Internal::Type::Union
600
-
601
- variant String
602
-
603
- variant Float
604
-
605
- variant Imagekitio::Internal::Type::Boolean
606
-
607
- # @!method self.variants
608
- # @return [Array(String, Float, Boolean)]
609
- end
610
-
611
- # @!method self.variants
612
- # @return [Array(String, Float, Boolean, Array<String, Float, Boolean>)]
613
-
614
- # @type [Imagekitio::Internal::Type::Converter]
615
- MixedArray =
616
- Imagekitio::Internal::Type::ArrayOf[union: -> {
617
- Imagekitio::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema::DefaultValue::Mixed
618
- }]
619
- end
620
-
621
- # Maximum value of the field. Only set if field type is `Date` or `Number`. For
622
- # `Date` type field, the value will be in ISO8601 string format. For `Number` type
623
- # field, it will be a numeric value.
624
- #
625
- # @see Imagekitio::Models::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema#max_value
626
- module MaxValue
627
- extend Imagekitio::Internal::Type::Union
628
-
629
- variant String
630
-
631
- variant Float
632
-
633
- # @!method self.variants
634
- # @return [Array(String, Float)]
635
- end
636
-
637
- # Minimum value of the field. Only set if field type is `Date` or `Number`. For
638
- # `Date` type field, the value will be in ISO8601 string format. For `Number` type
639
- # field, it will be a numeric value.
640
- #
641
- # @see Imagekitio::Models::UploadPreTransformSuccessEvent::Data::SelectedFieldsSchema#min_value
642
- module MinValue
643
- extend Imagekitio::Internal::Type::Union
644
-
645
- variant String
646
-
647
- variant Float
648
-
649
- # @!method self.variants
650
- # @return [Array(String, Float)]
651
- end
652
-
653
- module SelectOption
654
- extend Imagekitio::Internal::Type::Union
655
-
656
- variant String
657
-
658
- variant Float
659
-
660
- variant Imagekitio::Internal::Type::Boolean
661
-
662
- # @!method self.variants
663
- # @return [Array(String, Float, Boolean)]
664
- end
665
- end
666
-
667
- # @see Imagekitio::Models::UploadPreTransformSuccessEvent::Data#version_info
668
- class VersionInfo < Imagekitio::Internal::Type::BaseModel
669
- # @!attribute id
670
- # Unique identifier of the file version.
671
- #
672
- # @return [String, nil]
673
- optional :id, String
674
-
675
- # @!attribute name
676
- # Name of the file version.
677
- #
678
- # @return [String, nil]
679
- optional :name, String
680
-
681
- # @!method initialize(id: nil, name: nil)
682
- # An object containing the file or file version's `id` (versionId) and `name`.
683
- #
684
- # @param id [String] Unique identifier of the file version.
685
- #
686
- # @param name [String] Name of the file version.
687
- end
688
412
  end
689
413
 
690
414
  class Request < Imagekitio::Internal::Type::BaseModel
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ class VersionInfo < Imagekitio::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # Unique identifier of the file version.
8
+ #
9
+ # @return [String, nil]
10
+ optional :id, String
11
+
12
+ # @!attribute name
13
+ # Name of the file version.
14
+ #
15
+ # @return [String, nil]
16
+ optional :name, String
17
+
18
+ # @!method initialize(id: nil, name: nil)
19
+ # An object containing the file or file version's `id` (versionId) and `name`.
20
+ #
21
+ # @param id [String] Unique identifier of the file version.
22
+ #
23
+ # @param name [String] Name of the file version.
24
+ end
25
+ end
26
+ end