imagekitio 4.6.0 → 4.8.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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +1 -1
  4. data/lib/imagekitio/internal/transport/base_client.rb +4 -1
  5. data/lib/imagekitio/models/accounts/origin_request.rb +35 -10
  6. data/lib/imagekitio/models/accounts/origin_response.rb +20 -2
  7. data/lib/imagekitio/models/accounts/request_bandwidth_entry.rb +26 -0
  8. data/lib/imagekitio/models/accounts/usage_analytics_get_params.rb +39 -0
  9. data/lib/imagekitio/models/accounts/usage_analytics_response.rb +1044 -0
  10. data/lib/imagekitio/models/transformation.rb +1 -1
  11. data/lib/imagekitio/resources/accounts/usage.rb +6 -0
  12. data/lib/imagekitio/resources/accounts/usage_analytics.rb +55 -0
  13. data/lib/imagekitio/resources/accounts.rb +4 -0
  14. data/lib/imagekitio/version.rb +1 -1
  15. data/lib/imagekitio.rb +4 -0
  16. data/rbi/imagekitio/models/accounts/origin_request.rbi +36 -10
  17. data/rbi/imagekitio/models/accounts/origin_response.rbi +28 -2
  18. data/rbi/imagekitio/models/accounts/request_bandwidth_entry.rbi +44 -0
  19. data/rbi/imagekitio/models/accounts/usage_analytics_get_params.rbi +64 -0
  20. data/rbi/imagekitio/models/accounts/usage_analytics_response.rbi +2097 -0
  21. data/rbi/imagekitio/models/transformation.rbi +2 -2
  22. data/rbi/imagekitio/resources/accounts/usage.rbi +6 -0
  23. data/rbi/imagekitio/resources/accounts/usage_analytics.rbi +46 -0
  24. data/rbi/imagekitio/resources/accounts.rbi +3 -0
  25. data/sig/imagekitio/models/accounts/origin_request.rbs +18 -4
  26. data/sig/imagekitio/models/accounts/origin_response.rbs +18 -4
  27. data/sig/imagekitio/models/accounts/request_bandwidth_entry.rbs +18 -0
  28. data/sig/imagekitio/models/accounts/usage_analytics_get_params.rbs +30 -0
  29. data/sig/imagekitio/models/accounts/usage_analytics_response.rbs +785 -0
  30. data/sig/imagekitio/resources/accounts/usage_analytics.rbs +15 -0
  31. data/sig/imagekitio/resources/accounts.rbs +2 -0
  32. metadata +14 -2
@@ -203,7 +203,7 @@ module Imagekitio
203
203
  #
204
204
  # - `co-color` - Color to apply (e.g., `red`, `blue`, `FF0022`). Default is gray
205
205
  # color.
206
- # - `in-intensity` - Intensity of the color (0-100). Default is 35. See
206
+ # - `in-intensity` - Intensity of the color (0-100). Default is 100. See
207
207
  # [Colorize](https://imagekit.io/docs/effects-and-enhancements#colorize---e-colorize).
208
208
  sig { returns(T.nilable(String)) }
209
209
  attr_reader :colorize
@@ -804,7 +804,7 @@ module Imagekitio
804
804
  #
805
805
  # - `co-color` - Color to apply (e.g., `red`, `blue`, `FF0022`). Default is gray
806
806
  # color.
807
- # - `in-intensity` - Intensity of the color (0-100). Default is 35. See
807
+ # - `in-intensity` - Intensity of the color (0-100). Default is 100. See
808
808
  # [Colorize](https://imagekit.io/docs/effects-and-enhancements#colorize---e-colorize).
809
809
  colorize: nil,
810
810
  # Indicates whether the output image should retain the original color profile. See
@@ -8,6 +8,12 @@ module Imagekitio
8
8
  # includes data from the start date while excluding data from the end date. In
9
9
  # other words, the data covers the period starting from the specified start date
10
10
  # up to, but not including, the end date.
11
+ #
12
+ # For an agency account, the returned usage is aggregated across the agency and
13
+ # all of its child accounts that are billed to it.
14
+ #
15
+ # The response is cached for 6 hours per account, date range and requested
16
+ # metrics.
11
17
  sig do
12
18
  params(
13
19
  end_date: Date,
@@ -0,0 +1,46 @@
1
+ # typed: strong
2
+
3
+ module Imagekitio
4
+ module Resources
5
+ class Accounts
6
+ class UsageAnalytics
7
+ # **Note:** This API is currently in beta.
8
+ #
9
+ # Get the account analytics data between two dates. The response covers the period
10
+ # from the start date to the end date, both dates inclusive. Both dates are
11
+ # interpreted as UTC calendar days.
12
+ #
13
+ # The returned data is scoped to the requesting account only. Unlike
14
+ # `/v1/accounts/usage`, an agency account's analytics are not aggregated across
15
+ # its child accounts.
16
+ #
17
+ # The response is cached for 5 minutes per account and date range. Use
18
+ # `generatedAt` to check how fresh the returned data is.
19
+ sig do
20
+ params(
21
+ end_date: Date,
22
+ start_date: Date,
23
+ request_options: Imagekitio::RequestOptions::OrHash
24
+ ).returns(Imagekitio::Accounts::UsageAnalyticsResponse)
25
+ end
26
+ def get(
27
+ # Specify an `endDate` in `YYYY-MM-DD` format, interpreted as a UTC calendar day.
28
+ # It should be after the `startDate`. The difference between `startDate` and
29
+ # `endDate` should be less than 90 days.
30
+ end_date:,
31
+ # Specify a `startDate` in `YYYY-MM-DD` format, interpreted as a UTC calendar day.
32
+ # It should be before the `endDate`. The difference between `startDate` and
33
+ # `endDate` should be less than 90 days.
34
+ start_date:,
35
+ request_options: {}
36
+ )
37
+ end
38
+
39
+ # @api private
40
+ sig { params(client: Imagekitio::Client).returns(T.attached_class) }
41
+ def self.new(client:)
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -6,6 +6,9 @@ module Imagekitio
6
6
  sig { returns(Imagekitio::Resources::Accounts::Usage) }
7
7
  attr_reader :usage
8
8
 
9
+ sig { returns(Imagekitio::Resources::Accounts::UsageAnalytics) }
10
+ attr_reader :usage_analytics
11
+
9
12
  sig { returns(Imagekitio::Resources::Accounts::Origins) }
10
13
  attr_reader :origins
11
14
 
@@ -23,7 +23,8 @@ module Imagekitio
23
23
  type: :S3,
24
24
  base_url_for_canonical_header: String,
25
25
  include_canonical_header: bool,
26
- prefix: String
26
+ prefix: String,
27
+ use_iam_role: bool
27
28
  }
28
29
 
29
30
  class S3 < Imagekitio::Internal::Type::BaseModel
@@ -49,6 +50,10 @@ module Imagekitio
49
50
 
50
51
  def prefix=: (String) -> String
51
52
 
53
+ attr_reader use_iam_role: bool?
54
+
55
+ def use_iam_role=: (bool) -> bool
56
+
52
57
  def initialize: (
53
58
  access_key: String,
54
59
  bucket: String,
@@ -57,6 +62,7 @@ module Imagekitio
57
62
  ?base_url_for_canonical_header: String,
58
63
  ?include_canonical_header: bool,
59
64
  ?prefix: String,
65
+ ?use_iam_role: bool,
60
66
  ?type: :S3
61
67
  ) -> void
62
68
 
@@ -68,7 +74,8 @@ module Imagekitio
68
74
  type: :S3,
69
75
  base_url_for_canonical_header: String,
70
76
  include_canonical_header: bool,
71
- prefix: String
77
+ prefix: String,
78
+ use_iam_role: bool
72
79
  }
73
80
  end
74
81
 
@@ -151,7 +158,8 @@ module Imagekitio
151
158
  type: :CLOUDINARY_BACKUP,
152
159
  base_url_for_canonical_header: String,
153
160
  include_canonical_header: bool,
154
- prefix: String
161
+ prefix: String,
162
+ use_iam_role: bool
155
163
  }
156
164
 
157
165
  class CloudinaryBackup < Imagekitio::Internal::Type::BaseModel
@@ -177,6 +185,10 @@ module Imagekitio
177
185
 
178
186
  def prefix=: (String) -> String
179
187
 
188
+ attr_reader use_iam_role: bool?
189
+
190
+ def use_iam_role=: (bool) -> bool
191
+
180
192
  def initialize: (
181
193
  access_key: String,
182
194
  bucket: String,
@@ -185,6 +197,7 @@ module Imagekitio
185
197
  ?base_url_for_canonical_header: String,
186
198
  ?include_canonical_header: bool,
187
199
  ?prefix: String,
200
+ ?use_iam_role: bool,
188
201
  ?type: :CLOUDINARY_BACKUP
189
202
  ) -> void
190
203
 
@@ -196,7 +209,8 @@ module Imagekitio
196
209
  type: :CLOUDINARY_BACKUP,
197
210
  base_url_for_canonical_header: String,
198
211
  include_canonical_header: bool,
199
- prefix: String
212
+ prefix: String,
213
+ use_iam_role: bool
200
214
  }
201
215
  end
202
216
 
@@ -22,7 +22,8 @@ module Imagekitio
22
22
  name: String,
23
23
  prefix: String,
24
24
  type: :S3,
25
- base_url_for_canonical_header: String
25
+ base_url_for_canonical_header: String,
26
+ use_iam_role: bool
26
27
  }
27
28
 
28
29
  class S3 < Imagekitio::Internal::Type::BaseModel
@@ -40,6 +41,10 @@ module Imagekitio
40
41
 
41
42
  def base_url_for_canonical_header=: (String) -> String
42
43
 
44
+ attr_reader use_iam_role: bool?
45
+
46
+ def use_iam_role=: (bool) -> bool
47
+
43
48
  attr_accessor id: String
44
49
 
45
50
  def initialize: (
@@ -49,6 +54,7 @@ module Imagekitio
49
54
  name: String,
50
55
  prefix: String,
51
56
  ?base_url_for_canonical_header: String,
57
+ ?use_iam_role: bool,
52
58
  ?type: :S3
53
59
  ) -> void
54
60
 
@@ -59,7 +65,8 @@ module Imagekitio
59
65
  name: String,
60
66
  prefix: String,
61
67
  type: :S3,
62
- base_url_for_canonical_header: String
68
+ base_url_for_canonical_header: String,
69
+ use_iam_role: bool
63
70
  }
64
71
  end
65
72
 
@@ -130,7 +137,8 @@ module Imagekitio
130
137
  name: String,
131
138
  prefix: String,
132
139
  type: :CLOUDINARY_BACKUP,
133
- base_url_for_canonical_header: String
140
+ base_url_for_canonical_header: String,
141
+ use_iam_role: bool
134
142
  }
135
143
 
136
144
  class CloudinaryBackup < Imagekitio::Internal::Type::BaseModel
@@ -148,6 +156,10 @@ module Imagekitio
148
156
 
149
157
  def base_url_for_canonical_header=: (String) -> String
150
158
 
159
+ attr_reader use_iam_role: bool?
160
+
161
+ def use_iam_role=: (bool) -> bool
162
+
151
163
  attr_accessor id: String
152
164
 
153
165
  def initialize: (
@@ -157,6 +169,7 @@ module Imagekitio
157
169
  name: String,
158
170
  prefix: String,
159
171
  ?base_url_for_canonical_header: String,
172
+ ?use_iam_role: bool,
160
173
  ?type: :CLOUDINARY_BACKUP
161
174
  ) -> void
162
175
 
@@ -167,7 +180,8 @@ module Imagekitio
167
180
  name: String,
168
181
  prefix: String,
169
182
  type: :CLOUDINARY_BACKUP,
170
- base_url_for_canonical_header: String
183
+ base_url_for_canonical_header: String,
184
+ use_iam_role: bool
171
185
  }
172
186
  end
173
187
 
@@ -0,0 +1,18 @@
1
+ module Imagekitio
2
+ module Models
3
+ module Accounts
4
+ type request_bandwidth_entry =
5
+ { bandwidth_bytes: Float, request_count: Float }
6
+
7
+ class RequestBandwidthEntry < Imagekitio::Internal::Type::BaseModel
8
+ attr_accessor bandwidth_bytes: Float
9
+
10
+ attr_accessor request_count: Float
11
+
12
+ def initialize: (bandwidth_bytes: Float, request_count: Float) -> void
13
+
14
+ def to_hash: -> { bandwidth_bytes: Float, request_count: Float }
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,30 @@
1
+ module Imagekitio
2
+ module Models
3
+ module Accounts
4
+ type usage_analytics_get_params =
5
+ { end_date: Date, start_date: Date }
6
+ & Imagekitio::Internal::Type::request_parameters
7
+
8
+ class UsageAnalyticsGetParams < Imagekitio::Internal::Type::BaseModel
9
+ extend Imagekitio::Internal::Type::RequestParameters::Converter
10
+ include Imagekitio::Internal::Type::RequestParameters
11
+
12
+ attr_accessor end_date: Date
13
+
14
+ attr_accessor start_date: Date
15
+
16
+ def initialize: (
17
+ end_date: Date,
18
+ start_date: Date,
19
+ ?request_options: Imagekitio::request_opts
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ end_date: Date,
24
+ start_date: Date,
25
+ request_options: Imagekitio::RequestOptions
26
+ }
27
+ end
28
+ end
29
+ end
30
+ end