Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 47
configured_endpoints: 48
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require "etc"
require "pathname"
require "securerandom"
require "shellwords"
Expand Down Expand Up @@ -37,7 +38,11 @@ multitask(:test) do
ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 }
end

xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --]
# Cap parallelism at the CPU count. `--max-procs=0` spawns one process per
# 300-file batch with no upper bound; on large SDKs (thousands of files) that
# oversubscribes CPUs and stacks up rubocop processes, exhausting memory and
# slowing CI to the point of timing out.
xargs = %W[xargs --no-run-if-empty --null --max-procs=#{Etc.nprocessors} --max-args=300 --]
ruby_opt = {"RUBYOPT" => [ENV["RUBYOPT"], "--encoding=UTF-8"].compact.join(" ")}

filtered = ->(ext, dirs) do
Expand Down
4 changes: 4 additions & 0 deletions lib/imagekitio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
require_relative "imagekitio/client"
require_relative "imagekitio/models/accounts/origin_request"
require_relative "imagekitio/models/accounts/url_endpoint_request"
require_relative "imagekitio/models/accounts/request_bandwidth_entry"
require_relative "imagekitio/models/base_webhook_event"
require_relative "imagekitio/models/update_file_request"
require_relative "imagekitio/models/file"
Expand All @@ -74,6 +75,8 @@
require_relative "imagekitio/models/accounts/url_endpoint_list_response"
require_relative "imagekitio/models/accounts/url_endpoint_response"
require_relative "imagekitio/models/accounts/url_endpoint_update_params"
require_relative "imagekitio/models/accounts/usage_analytics_get_params"
require_relative "imagekitio/models/accounts/usage_analytics_response"
require_relative "imagekitio/models/accounts/usage_get_params"
require_relative "imagekitio/models/accounts/usage_get_response"
require_relative "imagekitio/models/ai_tag"
Expand Down Expand Up @@ -185,6 +188,7 @@
require_relative "imagekitio/resources/accounts/origins"
require_relative "imagekitio/resources/accounts/url_endpoints"
require_relative "imagekitio/resources/accounts/usage"
require_relative "imagekitio/resources/accounts/usage_analytics"
require_relative "imagekitio/resources/assets"
require_relative "imagekitio/resources/beta"
require_relative "imagekitio/resources/beta/v2"
Expand Down
5 changes: 4 additions & 1 deletion lib/imagekitio/internal/transport/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ def initialize(
Imagekitio::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
end

headers.delete("content-type") if body.nil?
# Generated methods always pass `req[:body]` for operations that define a
# request body, so only elide the content-type header when the operation
# has no body at all, not when an optional body param was omitted.
headers.delete("content-type") if body.nil? && !req.key?(:body)

url = Imagekitio::Internal::Util.join_parsed_uri(
@base_url_components,
Expand Down
26 changes: 26 additions & 0 deletions lib/imagekitio/models/accounts/request_bandwidth_entry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# frozen_string_literal: true

module Imagekitio
module Models
module Accounts
class RequestBandwidthEntry < Imagekitio::Internal::Type::BaseModel
# @!attribute bandwidth_bytes
# Total bandwidth used in bytes.
#
# @return [Float]
required :bandwidth_bytes, Float, api_name: :bandwidthBytes

# @!attribute request_count
# Number of requests.
#
# @return [Float]
required :request_count, Float, api_name: :requestCount

# @!method initialize(bandwidth_bytes:, request_count:)
# @param bandwidth_bytes [Float] Total bandwidth used in bytes.
#
# @param request_count [Float] Number of requests.
end
end
end
end
39 changes: 39 additions & 0 deletions lib/imagekitio/models/accounts/usage_analytics_get_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# frozen_string_literal: true

module Imagekitio
module Models
module Accounts
# @see Imagekitio::Resources::Accounts::UsageAnalytics#get
class UsageAnalyticsGetParams < Imagekitio::Internal::Type::BaseModel
extend Imagekitio::Internal::Type::RequestParameters::Converter
include Imagekitio::Internal::Type::RequestParameters

# @!attribute end_date
# Specify an `endDate` in `YYYY-MM-DD` format, interpreted as a UTC calendar day.
# It should be after the `startDate`. The difference between `startDate` and
# `endDate` should be less than 90 days.
#
# @return [Date]
required :end_date, Date

# @!attribute start_date
# Specify a `startDate` in `YYYY-MM-DD` format, interpreted as a UTC calendar day.
# It should be before the `endDate`. The difference between `startDate` and
# `endDate` should be less than 90 days.
#
# @return [Date]
required :start_date, Date

# @!method initialize(end_date:, start_date:, request_options: {})
# Some parameter documentations has been truncated, see
# {Imagekitio::Models::Accounts::UsageAnalyticsGetParams} for more details.
#
# @param end_date [Date] Specify an `endDate` in `YYYY-MM-DD` format, interpreted as a UTC calendar day.
#
# @param start_date [Date] Specify a `startDate` in `YYYY-MM-DD` format, interpreted as a UTC calendar day.
#
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
end
end
end
end
Loading