mirror of
https://github.com/LukeHagar/plexruby.git
synced 2025-12-07 20:57:44 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.526.6
This commit is contained in:
@@ -5,7 +5,10 @@
|
||||
|
||||
require 'faraday'
|
||||
require 'faraday/multipart'
|
||||
require 'faraday/retry'
|
||||
require 'sorbet-runtime'
|
||||
require_relative 'sdk_hooks/hooks'
|
||||
require_relative 'utils/retries'
|
||||
|
||||
module PlexRubySDK
|
||||
extend T::Sig
|
||||
@@ -20,8 +23,8 @@ module PlexRubySDK
|
||||
end
|
||||
|
||||
|
||||
sig { params(count: T.nilable(::Float), only_transient: T.nilable(::PlexRubySDK::Operations::OnlyTransient)).returns(::PlexRubySDK::Operations::GetGlobalHubsResponse) }
|
||||
def get_global_hubs(count = nil, only_transient = nil)
|
||||
sig { params(count: T.nilable(::Float), only_transient: T.nilable(::PlexRubySDK::Operations::OnlyTransient), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetGlobalHubsResponse) }
|
||||
def get_global_hubs(count = nil, only_transient = nil, timeout_ms = nil)
|
||||
# get_global_hubs - Get Global Hubs
|
||||
# Get Global Hubs filtered by the parameters provided.
|
||||
request = ::PlexRubySDK::Operations::GetGlobalHubsRequest.new(
|
||||
@@ -37,11 +40,61 @@ module PlexRubySDK
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
r = @sdk_configuration.client.get(url) do |req|
|
||||
req.headers = headers
|
||||
req.params = query_params
|
||||
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
||||
Utils.configure_request_security(req, security) if !security.nil?
|
||||
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
||||
|
||||
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
||||
timeout ||= @sdk_configuration.timeout
|
||||
|
||||
connection = @sdk_configuration.client
|
||||
|
||||
hook_ctx = SDKHooks::HookContext.new(
|
||||
base_url: base_url,
|
||||
oauth2_scopes: nil,
|
||||
operation_id: 'getGlobalHubs',
|
||||
security_source: @sdk_configuration.security_source
|
||||
)
|
||||
|
||||
error = T.let(nil, T.nilable(StandardError))
|
||||
r = T.let(nil, T.nilable(Faraday::Response))
|
||||
|
||||
begin
|
||||
r = connection.get(url) do |req|
|
||||
req.headers.merge!(headers)
|
||||
req.options.timeout = timeout unless timeout.nil?
|
||||
req.params = query_params
|
||||
Utils.configure_request_security(req, security)
|
||||
|
||||
@sdk_configuration.hooks.before_request(
|
||||
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
request: req
|
||||
)
|
||||
end
|
||||
rescue StandardError => e
|
||||
error = e
|
||||
ensure
|
||||
if r.nil? || Utils.error_status?(r.status)
|
||||
r = @sdk_configuration.hooks.after_error(
|
||||
error: error,
|
||||
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
)
|
||||
else
|
||||
r = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
)
|
||||
end
|
||||
|
||||
if r.nil?
|
||||
raise error if !error.nil?
|
||||
raise 'no response'
|
||||
end
|
||||
end
|
||||
|
||||
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
@@ -70,8 +123,8 @@ module PlexRubySDK
|
||||
end
|
||||
|
||||
|
||||
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetRecentlyAddedRequest)).returns(::PlexRubySDK::Operations::GetRecentlyAddedResponse) }
|
||||
def get_recently_added(request)
|
||||
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetRecentlyAddedRequest), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetRecentlyAddedResponse) }
|
||||
def get_recently_added(request, timeout_ms = nil)
|
||||
# get_recently_added - Get Recently Added
|
||||
# This endpoint will return the recently added content.
|
||||
#
|
||||
@@ -83,11 +136,61 @@ module PlexRubySDK
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
r = @sdk_configuration.client.get(url) do |req|
|
||||
req.headers = headers
|
||||
req.params = query_params
|
||||
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
||||
Utils.configure_request_security(req, security) if !security.nil?
|
||||
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
||||
|
||||
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
||||
timeout ||= @sdk_configuration.timeout
|
||||
|
||||
connection = @sdk_configuration.client
|
||||
|
||||
hook_ctx = SDKHooks::HookContext.new(
|
||||
base_url: base_url,
|
||||
oauth2_scopes: nil,
|
||||
operation_id: 'get-recently-added',
|
||||
security_source: @sdk_configuration.security_source
|
||||
)
|
||||
|
||||
error = T.let(nil, T.nilable(StandardError))
|
||||
r = T.let(nil, T.nilable(Faraday::Response))
|
||||
|
||||
begin
|
||||
r = connection.get(url) do |req|
|
||||
req.headers.merge!(headers)
|
||||
req.options.timeout = timeout unless timeout.nil?
|
||||
req.params = query_params
|
||||
Utils.configure_request_security(req, security)
|
||||
|
||||
@sdk_configuration.hooks.before_request(
|
||||
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
request: req
|
||||
)
|
||||
end
|
||||
rescue StandardError => e
|
||||
error = e
|
||||
ensure
|
||||
if r.nil? || Utils.error_status?(r.status)
|
||||
r = @sdk_configuration.hooks.after_error(
|
||||
error: error,
|
||||
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
)
|
||||
else
|
||||
r = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
)
|
||||
end
|
||||
|
||||
if r.nil?
|
||||
raise error if !error.nil?
|
||||
raise 'no response'
|
||||
end
|
||||
end
|
||||
|
||||
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
@@ -107,8 +210,8 @@ module PlexRubySDK
|
||||
end
|
||||
|
||||
|
||||
sig { params(section_id: ::Float, count: T.nilable(::Float), only_transient: T.nilable(::PlexRubySDK::Operations::QueryParamOnlyTransient)).returns(::PlexRubySDK::Operations::GetLibraryHubsResponse) }
|
||||
def get_library_hubs(section_id, count = nil, only_transient = nil)
|
||||
sig { params(section_id: ::Float, count: T.nilable(::Float), only_transient: T.nilable(::PlexRubySDK::Operations::QueryParamOnlyTransient), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetLibraryHubsResponse) }
|
||||
def get_library_hubs(section_id, count = nil, only_transient = nil, timeout_ms = nil)
|
||||
# get_library_hubs - Get library specific hubs
|
||||
# This endpoint will return a list of library specific hubs
|
||||
#
|
||||
@@ -131,11 +234,61 @@ module PlexRubySDK
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
r = @sdk_configuration.client.get(url) do |req|
|
||||
req.headers = headers
|
||||
req.params = query_params
|
||||
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
||||
Utils.configure_request_security(req, security) if !security.nil?
|
||||
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
||||
|
||||
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
||||
timeout ||= @sdk_configuration.timeout
|
||||
|
||||
connection = @sdk_configuration.client
|
||||
|
||||
hook_ctx = SDKHooks::HookContext.new(
|
||||
base_url: base_url,
|
||||
oauth2_scopes: nil,
|
||||
operation_id: 'getLibraryHubs',
|
||||
security_source: @sdk_configuration.security_source
|
||||
)
|
||||
|
||||
error = T.let(nil, T.nilable(StandardError))
|
||||
r = T.let(nil, T.nilable(Faraday::Response))
|
||||
|
||||
begin
|
||||
r = connection.get(url) do |req|
|
||||
req.headers.merge!(headers)
|
||||
req.options.timeout = timeout unless timeout.nil?
|
||||
req.params = query_params
|
||||
Utils.configure_request_security(req, security)
|
||||
|
||||
@sdk_configuration.hooks.before_request(
|
||||
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
request: req
|
||||
)
|
||||
end
|
||||
rescue StandardError => e
|
||||
error = e
|
||||
ensure
|
||||
if r.nil? || Utils.error_status?(r.status)
|
||||
r = @sdk_configuration.hooks.after_error(
|
||||
error: error,
|
||||
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
)
|
||||
else
|
||||
r = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
)
|
||||
end
|
||||
|
||||
if r.nil?
|
||||
raise error if !error.nil?
|
||||
raise 'no response'
|
||||
end
|
||||
end
|
||||
|
||||
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
|
||||
Reference in New Issue
Block a user