imagekitio 4.7.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/imagekitio/internal/transport/base_client.rb +4 -1
- data/lib/imagekitio/models/accounts/request_bandwidth_entry.rb +26 -0
- data/lib/imagekitio/models/accounts/usage_analytics_get_params.rb +39 -0
- data/lib/imagekitio/models/accounts/usage_analytics_response.rb +1044 -0
- data/lib/imagekitio/resources/accounts/usage.rb +6 -0
- data/lib/imagekitio/resources/accounts/usage_analytics.rb +55 -0
- data/lib/imagekitio/resources/accounts.rb +4 -0
- data/lib/imagekitio/version.rb +1 -1
- data/lib/imagekitio.rb +4 -0
- data/rbi/imagekitio/models/accounts/request_bandwidth_entry.rbi +44 -0
- data/rbi/imagekitio/models/accounts/usage_analytics_get_params.rbi +64 -0
- data/rbi/imagekitio/models/accounts/usage_analytics_response.rbi +2097 -0
- data/rbi/imagekitio/resources/accounts/usage.rbi +6 -0
- data/rbi/imagekitio/resources/accounts/usage_analytics.rbi +46 -0
- data/rbi/imagekitio/resources/accounts.rbi +3 -0
- data/sig/imagekitio/models/accounts/request_bandwidth_entry.rbs +18 -0
- data/sig/imagekitio/models/accounts/usage_analytics_get_params.rbs +30 -0
- data/sig/imagekitio/models/accounts/usage_analytics_response.rbs +785 -0
- data/sig/imagekitio/resources/accounts/usage_analytics.rbs +15 -0
- data/sig/imagekitio/resources/accounts.rbs +2 -0
- metadata +14 -2
|
@@ -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
|
|
|
@@ -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
|