Skip to content

Commit 453e942

Browse files
feat(api): manual updates
1 parent b4c2a83 commit 453e942

33 files changed

+297
-207
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 42
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml
33
openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a
4-
config_hash: 4e73c7e12a531edcd1366dab7eccc360
4+
config_hash: 08e12746cdca1c59c897cf2e50893c3c

lib/imagekit.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
require_relative "imagekit/models/accounts/url_endpoint_request"
5555
require_relative "imagekit/models/file"
5656
require_relative "imagekit/models/base_overlay"
57+
require_relative "imagekit/models/base_webhook_event"
5758
require_relative "imagekit/models/accounts/origin_create_params"
5859
require_relative "imagekit/models/accounts/origin_delete_params"
5960
require_relative "imagekit/models/accounts/origin_get_params"

lib/imagekit/models.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ module Imagekit
4545

4646
BaseOverlay = Imagekit::Models::BaseOverlay
4747

48+
BaseWebhookEvent = Imagekit::Models::BaseWebhookEvent
49+
4850
Beta = Imagekit::Models::Beta
4951

5052
Cache = Imagekit::Models::Cache
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# frozen_string_literal: true
2+
3+
module Imagekit
4+
module Models
5+
class BaseWebhookEvent < Imagekit::Internal::Type::BaseModel
6+
# @!attribute id
7+
# Unique identifier for the event.
8+
#
9+
# @return [String]
10+
required :id, String
11+
12+
# @!attribute type
13+
# The type of webhook event.
14+
#
15+
# @return [String]
16+
required :type, String
17+
18+
# @!method initialize(id:, type:)
19+
# @param id [String] Unique identifier for the event.
20+
#
21+
# @param type [String] The type of webhook event.
22+
end
23+
end
24+
end

lib/imagekit/models/unsafe_unwrap_webhook_event.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,31 @@
22

33
module Imagekit
44
module Models
5+
# Triggered when a new video transformation request is accepted for processing.
6+
# This event confirms that ImageKit has received and queued your transformation
7+
# request. Use this for debugging and tracking transformation lifecycle.
58
module UnsafeUnwrapWebhookEvent
69
extend Imagekit::Internal::Type::Union
710

11+
# Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle.
812
variant -> { Imagekit::VideoTransformationAcceptedEvent }
913

14+
# Triggered when video encoding is finished and the transformed resource is ready to be served. This is the key event to listen for - update your database or CMS flags when you receive this so your application can start showing the transformed video to users.
1015
variant -> { Imagekit::VideoTransformationReadyEvent }
1116

17+
# Triggered when an error occurs during video encoding. Listen to this webhook to log error reasons and debug issues. Check your origin and URL endpoint settings if the reason is related to download failure. For other errors, contact ImageKit support.
1218
variant -> { Imagekit::VideoTransformationErrorEvent }
1319

20+
# Triggered when a pre-transformation completes successfully. The file has been processed with the requested transformation and is now available in the Media Library.
1421
variant -> { Imagekit::UploadPreTransformSuccessEvent }
1522

23+
# Triggered when a pre-transformation fails. The file upload may have been accepted, but the requested transformation could not be applied.
1624
variant -> { Imagekit::UploadPreTransformErrorEvent }
1725

26+
# Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event.
1827
variant -> { Imagekit::UploadPostTransformSuccessEvent }
1928

29+
# Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated.
2030
variant -> { Imagekit::UploadPostTransformErrorEvent }
2131

2232
# @!method self.variants

lib/imagekit/models/unwrap_webhook_event.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,31 @@
22

33
module Imagekit
44
module Models
5+
# Triggered when a new video transformation request is accepted for processing.
6+
# This event confirms that ImageKit has received and queued your transformation
7+
# request. Use this for debugging and tracking transformation lifecycle.
58
module UnwrapWebhookEvent
69
extend Imagekit::Internal::Type::Union
710

11+
# Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle.
812
variant -> { Imagekit::VideoTransformationAcceptedEvent }
913

14+
# Triggered when video encoding is finished and the transformed resource is ready to be served. This is the key event to listen for - update your database or CMS flags when you receive this so your application can start showing the transformed video to users.
1015
variant -> { Imagekit::VideoTransformationReadyEvent }
1116

17+
# Triggered when an error occurs during video encoding. Listen to this webhook to log error reasons and debug issues. Check your origin and URL endpoint settings if the reason is related to download failure. For other errors, contact ImageKit support.
1218
variant -> { Imagekit::VideoTransformationErrorEvent }
1319

20+
# Triggered when a pre-transformation completes successfully. The file has been processed with the requested transformation and is now available in the Media Library.
1421
variant -> { Imagekit::UploadPreTransformSuccessEvent }
1522

23+
# Triggered when a pre-transformation fails. The file upload may have been accepted, but the requested transformation could not be applied.
1624
variant -> { Imagekit::UploadPreTransformErrorEvent }
1725

26+
# Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event.
1827
variant -> { Imagekit::UploadPostTransformSuccessEvent }
1928

29+
# Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated.
2030
variant -> { Imagekit::UploadPostTransformErrorEvent }
2131

2232
# @!method self.variants

lib/imagekit/models/upload_post_transform_error_event.rb

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
module Imagekit
44
module Models
5-
class UploadPostTransformErrorEvent < Imagekit::Internal::Type::BaseModel
6-
# @!attribute id
7-
# Unique identifier for the event.
8-
#
9-
# @return [String]
10-
required :id, String
11-
5+
class UploadPostTransformErrorEvent < Imagekit::Models::BaseWebhookEvent
126
# @!attribute created_at
137
# Timestamp of when the event occurred in ISO8601 format.
148
#
@@ -30,8 +24,9 @@ class UploadPostTransformErrorEvent < Imagekit::Internal::Type::BaseModel
3024
# @return [Symbol, :"upload.post-transform.error"]
3125
required :type, const: :"upload.post-transform.error"
3226

33-
# @!method initialize(id:, created_at:, data:, request:, type: :"upload.post-transform.error")
34-
# @param id [String] Unique identifier for the event.
27+
# @!method initialize(created_at:, data:, request:, type: :"upload.post-transform.error")
28+
# Triggered when a post-transformation fails. The original file remains available,
29+
# but the requested transformation could not be generated.
3530
#
3631
# @param created_at [Time] Timestamp of when the event occurred in ISO8601 format.
3732
#
@@ -41,7 +36,6 @@ class UploadPostTransformErrorEvent < Imagekit::Internal::Type::BaseModel
4136
#
4237
# @param type [Symbol, :"upload.post-transform.error"]
4338

44-
# @see Imagekit::Models::UploadPostTransformErrorEvent#data
4539
class Data < Imagekit::Internal::Type::BaseModel
4640
# @!attribute file_id
4741
# Unique identifier of the originally uploaded file.
@@ -107,7 +101,6 @@ class Error < Imagekit::Internal::Type::BaseModel
107101
end
108102
end
109103

110-
# @see Imagekit::Models::UploadPostTransformErrorEvent#request
111104
class Request < Imagekit::Internal::Type::BaseModel
112105
# @!attribute transformation
113106
#

lib/imagekit/models/upload_post_transform_success_event.rb

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
module Imagekit
44
module Models
5-
class UploadPostTransformSuccessEvent < Imagekit::Internal::Type::BaseModel
6-
# @!attribute id
7-
# Unique identifier for the event.
8-
#
9-
# @return [String]
10-
required :id, String
11-
5+
class UploadPostTransformSuccessEvent < Imagekit::Models::BaseWebhookEvent
126
# @!attribute created_at
137
# Timestamp of when the event occurred in ISO8601 format.
148
#
@@ -30,8 +24,10 @@ class UploadPostTransformSuccessEvent < Imagekit::Internal::Type::BaseModel
3024
# @return [Symbol, :"upload.post-transform.success"]
3125
required :type, const: :"upload.post-transform.success"
3226

33-
# @!method initialize(id:, created_at:, data:, request:, type: :"upload.post-transform.success")
34-
# @param id [String] Unique identifier for the event.
27+
# @!method initialize(created_at:, data:, request:, type: :"upload.post-transform.success")
28+
# Triggered when a post-transformation completes successfully. The transformed
29+
# version of the file is now ready and can be accessed via the provided URL. Note
30+
# that each post-transformation generates a separate webhook event.
3531
#
3632
# @param created_at [Time] Timestamp of when the event occurred in ISO8601 format.
3733
#
@@ -41,7 +37,6 @@ class UploadPostTransformSuccessEvent < Imagekit::Internal::Type::BaseModel
4137
#
4238
# @param type [Symbol, :"upload.post-transform.success"]
4339

44-
# @see Imagekit::Models::UploadPostTransformSuccessEvent#data
4540
class Data < Imagekit::Internal::Type::BaseModel
4641
# @!attribute file_id
4742
# Unique identifier of the originally uploaded file.
@@ -69,7 +64,6 @@ class Data < Imagekit::Internal::Type::BaseModel
6964
# @param url [String] URL of the generated post-transformation.
7065
end
7166

72-
# @see Imagekit::Models::UploadPostTransformSuccessEvent#request
7367
class Request < Imagekit::Internal::Type::BaseModel
7468
# @!attribute transformation
7569
#

lib/imagekit/models/upload_pre_transform_error_event.rb

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
module Imagekit
44
module Models
5-
class UploadPreTransformErrorEvent < Imagekit::Internal::Type::BaseModel
6-
# @!attribute id
7-
# Unique identifier for the event.
8-
#
9-
# @return [String]
10-
required :id, String
11-
5+
class UploadPreTransformErrorEvent < Imagekit::Models::BaseWebhookEvent
126
# @!attribute created_at
137
# Timestamp of when the event occurred in ISO8601 format.
148
#
@@ -30,8 +24,9 @@ class UploadPreTransformErrorEvent < Imagekit::Internal::Type::BaseModel
3024
# @return [Symbol, :"upload.pre-transform.error"]
3125
required :type, const: :"upload.pre-transform.error"
3226

33-
# @!method initialize(id:, created_at:, data:, request:, type: :"upload.pre-transform.error")
34-
# @param id [String] Unique identifier for the event.
27+
# @!method initialize(created_at:, data:, request:, type: :"upload.pre-transform.error")
28+
# Triggered when a pre-transformation fails. The file upload may have been
29+
# accepted, but the requested transformation could not be applied.
3530
#
3631
# @param created_at [Time] Timestamp of when the event occurred in ISO8601 format.
3732
#
@@ -41,7 +36,6 @@ class UploadPreTransformErrorEvent < Imagekit::Internal::Type::BaseModel
4136
#
4237
# @param type [Symbol, :"upload.pre-transform.error"]
4338

44-
# @see Imagekit::Models::UploadPreTransformErrorEvent#data
4539
class Data < Imagekit::Internal::Type::BaseModel
4640
# @!attribute name
4741
# Name of the file.
@@ -91,7 +85,6 @@ class Error < Imagekit::Internal::Type::BaseModel
9185
end
9286
end
9387

94-
# @see Imagekit::Models::UploadPreTransformErrorEvent#request
9588
class Request < Imagekit::Internal::Type::BaseModel
9689
# @!attribute transformation
9790
# The requested pre-transformation string.

lib/imagekit/models/upload_pre_transform_success_event.rb

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
module Imagekit
44
module Models
5-
class UploadPreTransformSuccessEvent < Imagekit::Internal::Type::BaseModel
6-
# @!attribute id
7-
# Unique identifier for the event.
8-
#
9-
# @return [String]
10-
required :id, String
11-
5+
class UploadPreTransformSuccessEvent < Imagekit::Models::BaseWebhookEvent
126
# @!attribute created_at
137
# Timestamp of when the event occurred in ISO8601 format.
148
#
@@ -31,8 +25,10 @@ class UploadPreTransformSuccessEvent < Imagekit::Internal::Type::BaseModel
3125
# @return [Symbol, :"upload.pre-transform.success"]
3226
required :type, const: :"upload.pre-transform.success"
3327

34-
# @!method initialize(id:, created_at:, data:, request:, type: :"upload.pre-transform.success")
35-
# @param id [String] Unique identifier for the event.
28+
# @!method initialize(created_at:, data:, request:, type: :"upload.pre-transform.success")
29+
# Triggered when a pre-transformation completes successfully. The file has been
30+
# processed with the requested transformation and is now available in the Media
31+
# Library.
3632
#
3733
# @param created_at [Time] Timestamp of when the event occurred in ISO8601 format.
3834
#
@@ -42,7 +38,6 @@ class UploadPreTransformSuccessEvent < Imagekit::Internal::Type::BaseModel
4238
#
4339
# @param type [Symbol, :"upload.pre-transform.success"]
4440

45-
# @see Imagekit::Models::UploadPreTransformSuccessEvent#data
4641
class Data < Imagekit::Internal::Type::BaseModel
4742
# @!attribute ai_tags
4843
# An array of tags assigned to the uploaded file by auto tagging.
@@ -439,7 +434,6 @@ class VersionInfo < Imagekit::Internal::Type::BaseModel
439434
end
440435
end
441436

442-
# @see Imagekit::Models::UploadPreTransformSuccessEvent#request
443437
class Request < Imagekit::Internal::Type::BaseModel
444438
# @!attribute transformation
445439
# The requested pre-transformation string.

0 commit comments

Comments
 (0)