mirror of
https://github.com/LukeHagar/plexruby.git
synced 2025-12-07 12:47:45 +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 { returns(::PlexRubySDK::Operations::GetButlerTasksResponse) }
|
||||
def get_butler_tasks
|
||||
sig { params(timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetButlerTasksResponse) }
|
||||
def get_butler_tasks(timeout_ms = nil)
|
||||
# get_butler_tasks - Get Butler tasks
|
||||
# Returns a list of butler tasks
|
||||
url, params = @sdk_configuration.get_server_details
|
||||
@@ -31,10 +34,60 @@ module PlexRubySDK
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
r = @sdk_configuration.client.get(url) do |req|
|
||||
req.headers = headers
|
||||
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: 'getButlerTasks',
|
||||
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?
|
||||
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')
|
||||
@@ -63,8 +116,8 @@ module PlexRubySDK
|
||||
end
|
||||
|
||||
|
||||
sig { returns(::PlexRubySDK::Operations::StartAllTasksResponse) }
|
||||
def start_all_tasks
|
||||
sig { params(timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::StartAllTasksResponse) }
|
||||
def start_all_tasks(timeout_ms = nil)
|
||||
# start_all_tasks - Start all Butler tasks
|
||||
# This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
|
||||
# 1. Any tasks not scheduled to run on the current day will be skipped.
|
||||
@@ -79,10 +132,60 @@ module PlexRubySDK
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
r = @sdk_configuration.client.post(url) do |req|
|
||||
req.headers = headers
|
||||
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: 'startAllTasks',
|
||||
security_source: @sdk_configuration.security_source
|
||||
)
|
||||
|
||||
error = T.let(nil, T.nilable(StandardError))
|
||||
r = T.let(nil, T.nilable(Faraday::Response))
|
||||
|
||||
begin
|
||||
r = connection.post(url) do |req|
|
||||
req.headers.merge!(headers)
|
||||
req.options.timeout = timeout unless timeout.nil?
|
||||
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 { returns(::PlexRubySDK::Operations::StopAllTasksResponse) }
|
||||
def stop_all_tasks
|
||||
sig { params(timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::StopAllTasksResponse) }
|
||||
def stop_all_tasks(timeout_ms = nil)
|
||||
# stop_all_tasks - Stop all Butler tasks
|
||||
# This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
|
||||
#
|
||||
@@ -119,10 +222,60 @@ module PlexRubySDK
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
r = @sdk_configuration.client.delete(url) do |req|
|
||||
req.headers = headers
|
||||
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: 'stopAllTasks',
|
||||
security_source: @sdk_configuration.security_source
|
||||
)
|
||||
|
||||
error = T.let(nil, T.nilable(StandardError))
|
||||
r = T.let(nil, T.nilable(Faraday::Response))
|
||||
|
||||
begin
|
||||
r = connection.delete(url) do |req|
|
||||
req.headers.merge!(headers)
|
||||
req.options.timeout = timeout unless timeout.nil?
|
||||
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')
|
||||
@@ -147,8 +300,8 @@ module PlexRubySDK
|
||||
end
|
||||
|
||||
|
||||
sig { params(task_name: ::PlexRubySDK::Operations::TaskName).returns(::PlexRubySDK::Operations::StartTaskResponse) }
|
||||
def start_task(task_name)
|
||||
sig { params(task_name: ::PlexRubySDK::Operations::TaskName, timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::StartTaskResponse) }
|
||||
def start_task(task_name, timeout_ms = nil)
|
||||
# start_task - Start a single Butler task
|
||||
# This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
|
||||
# 1. Any tasks not scheduled to run on the current day will be skipped.
|
||||
@@ -172,10 +325,60 @@ module PlexRubySDK
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
r = @sdk_configuration.client.post(url) do |req|
|
||||
req.headers = headers
|
||||
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: 'startTask',
|
||||
security_source: @sdk_configuration.security_source
|
||||
)
|
||||
|
||||
error = T.let(nil, T.nilable(StandardError))
|
||||
r = T.let(nil, T.nilable(Faraday::Response))
|
||||
|
||||
begin
|
||||
r = connection.post(url) do |req|
|
||||
req.headers.merge!(headers)
|
||||
req.options.timeout = timeout unless timeout.nil?
|
||||
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')
|
||||
@@ -200,8 +403,8 @@ module PlexRubySDK
|
||||
end
|
||||
|
||||
|
||||
sig { params(task_name: ::PlexRubySDK::Operations::PathParamTaskName).returns(::PlexRubySDK::Operations::StopTaskResponse) }
|
||||
def stop_task(task_name)
|
||||
sig { params(task_name: ::PlexRubySDK::Operations::PathParamTaskName, timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::StopTaskResponse) }
|
||||
def stop_task(task_name, timeout_ms = nil)
|
||||
# stop_task - Stop a single Butler task
|
||||
# This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
|
||||
#
|
||||
@@ -221,10 +424,60 @@ module PlexRubySDK
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
r = @sdk_configuration.client.delete(url) do |req|
|
||||
req.headers = headers
|
||||
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: 'stopTask',
|
||||
security_source: @sdk_configuration.security_source
|
||||
)
|
||||
|
||||
error = T.let(nil, T.nilable(StandardError))
|
||||
r = T.let(nil, T.nilable(Faraday::Response))
|
||||
|
||||
begin
|
||||
r = connection.delete(url) do |req|
|
||||
req.headers.merge!(headers)
|
||||
req.options.timeout = timeout unless timeout.nil?
|
||||
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