mirror of
https://github.com/LukeHagar/plexruby.git
synced 2025-12-06 20:57:45 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.531.4
This commit is contained in:
@@ -23,12 +23,12 @@ module PlexRubySDK
|
||||
end
|
||||
|
||||
|
||||
sig { params(level: ::PlexRubySDK::Operations::Level, message: ::String, source: ::String, timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::LogLineResponse) }
|
||||
sig { params(level: Models::Operations::Level, message: ::String, source: ::String, timeout_ms: T.nilable(Integer)).returns(Models::Operations::LogLineResponse) }
|
||||
def log_line(level, message, source, timeout_ms = nil)
|
||||
# log_line - Logging a single line message.
|
||||
# This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
|
||||
#
|
||||
request = ::PlexRubySDK::Operations::LogLineRequest.new(
|
||||
request = Models::Operations::LogLineRequest.new(
|
||||
|
||||
level: level,
|
||||
message: message,
|
||||
@@ -38,7 +38,7 @@ module PlexRubySDK
|
||||
base_url = Utils.template_url(url, params)
|
||||
url = "#{base_url}/log"
|
||||
headers = {}
|
||||
query_params = Utils.get_query_params(::PlexRubySDK::Operations::LogLineRequest, request)
|
||||
query_params = Utils.get_query_params(Models::Operations::LogLineRequest, request)
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
@@ -57,10 +57,11 @@ module PlexRubySDK
|
||||
)
|
||||
|
||||
error = T.let(nil, T.nilable(StandardError))
|
||||
r = T.let(nil, T.nilable(Faraday::Response))
|
||||
http_response = T.let(nil, T.nilable(Faraday::Response))
|
||||
|
||||
|
||||
begin
|
||||
r = connection.get(url) do |req|
|
||||
http_response = connection.get(url) do |req|
|
||||
req.headers.merge!(headers)
|
||||
req.options.timeout = timeout unless timeout.nil?
|
||||
req.params = query_params
|
||||
@@ -76,52 +77,82 @@ module PlexRubySDK
|
||||
rescue StandardError => e
|
||||
error = e
|
||||
ensure
|
||||
if r.nil? || Utils.error_status?(r.status)
|
||||
r = @sdk_configuration.hooks.after_error(
|
||||
if http_response.nil? || Utils.error_status?(http_response.status)
|
||||
http_response = @sdk_configuration.hooks.after_error(
|
||||
error: error,
|
||||
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
response: http_response
|
||||
)
|
||||
else
|
||||
r = @sdk_configuration.hooks.after_success(
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
response: http_response
|
||||
)
|
||||
end
|
||||
|
||||
if r.nil?
|
||||
if http_response.nil?
|
||||
raise error if !error.nil?
|
||||
raise 'no response'
|
||||
end
|
||||
end
|
||||
|
||||
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
|
||||
res = ::PlexRubySDK::Operations::LogLineResponse.new(
|
||||
status_code: r.status, content_type: content_type, raw_response: r
|
||||
)
|
||||
if r.status == 200
|
||||
elsif r.status == 400
|
||||
|
||||
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
if Utils.match_status_code(http_response.status, ['200'])
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: http_response
|
||||
)
|
||||
return Models::Operations::LogLineResponse.new(
|
||||
status_code: http_response.status,
|
||||
content_type: content_type,
|
||||
raw_response: http_response
|
||||
)
|
||||
elsif Utils.match_status_code(http_response.status, ['400'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::LogLineBadRequest)
|
||||
res.bad_request = out
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: http_response
|
||||
)
|
||||
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::LogLineBadRequest)
|
||||
obj.raw_response = http_response
|
||||
throw obj
|
||||
else
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
||||
end
|
||||
elsif r.status == 401
|
||||
elsif Utils.match_status_code(http_response.status, ['401'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::LogLineUnauthorized)
|
||||
res.unauthorized = out
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: http_response
|
||||
)
|
||||
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::LogLineUnauthorized)
|
||||
obj.raw_response = http_response
|
||||
throw obj
|
||||
else
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
||||
end
|
||||
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
||||
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
||||
else
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
||||
|
||||
end
|
||||
|
||||
res
|
||||
end
|
||||
|
||||
|
||||
sig { params(request: ::String, timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::LogMultiLineResponse) }
|
||||
sig { params(request: ::String, timeout_ms: T.nilable(Integer)).returns(Models::Operations::LogMultiLineResponse) }
|
||||
def log_multi_line(request, timeout_ms = nil)
|
||||
# log_multi_line - Logging a multi-line message
|
||||
# This endpoint allows for the batch addition of log entries to the main Plex Media Server log.
|
||||
@@ -179,10 +210,11 @@ module PlexRubySDK
|
||||
)
|
||||
|
||||
error = T.let(nil, T.nilable(StandardError))
|
||||
r = T.let(nil, T.nilable(Faraday::Response))
|
||||
http_response = T.let(nil, T.nilable(Faraday::Response))
|
||||
|
||||
|
||||
begin
|
||||
r = connection.post(url) do |req|
|
||||
http_response = connection.post(url) do |req|
|
||||
req.body = body
|
||||
req.headers.merge!(headers)
|
||||
req.options.timeout = timeout unless timeout.nil?
|
||||
@@ -198,52 +230,82 @@ module PlexRubySDK
|
||||
rescue StandardError => e
|
||||
error = e
|
||||
ensure
|
||||
if r.nil? || Utils.error_status?(r.status)
|
||||
r = @sdk_configuration.hooks.after_error(
|
||||
if http_response.nil? || Utils.error_status?(http_response.status)
|
||||
http_response = @sdk_configuration.hooks.after_error(
|
||||
error: error,
|
||||
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
response: http_response
|
||||
)
|
||||
else
|
||||
r = @sdk_configuration.hooks.after_success(
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
response: http_response
|
||||
)
|
||||
end
|
||||
|
||||
if r.nil?
|
||||
if http_response.nil?
|
||||
raise error if !error.nil?
|
||||
raise 'no response'
|
||||
end
|
||||
end
|
||||
|
||||
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
|
||||
res = ::PlexRubySDK::Operations::LogMultiLineResponse.new(
|
||||
status_code: r.status, content_type: content_type, raw_response: r
|
||||
)
|
||||
if r.status == 200
|
||||
elsif r.status == 400
|
||||
|
||||
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
if Utils.match_status_code(http_response.status, ['200'])
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: http_response
|
||||
)
|
||||
return Models::Operations::LogMultiLineResponse.new(
|
||||
status_code: http_response.status,
|
||||
content_type: content_type,
|
||||
raw_response: http_response
|
||||
)
|
||||
elsif Utils.match_status_code(http_response.status, ['400'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::LogMultiLineBadRequest)
|
||||
res.bad_request = out
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: http_response
|
||||
)
|
||||
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::LogMultiLineBadRequest)
|
||||
obj.raw_response = http_response
|
||||
throw obj
|
||||
else
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
||||
end
|
||||
elsif r.status == 401
|
||||
elsif Utils.match_status_code(http_response.status, ['401'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::LogMultiLineUnauthorized)
|
||||
res.unauthorized = out
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: http_response
|
||||
)
|
||||
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::LogMultiLineUnauthorized)
|
||||
obj.raw_response = http_response
|
||||
throw obj
|
||||
else
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
||||
end
|
||||
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
||||
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
||||
else
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
||||
|
||||
end
|
||||
|
||||
res
|
||||
end
|
||||
|
||||
|
||||
sig { params(timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::EnablePaperTrailResponse) }
|
||||
sig { params(timeout_ms: T.nilable(Integer)).returns(Models::Operations::EnablePaperTrailResponse) }
|
||||
def enable_paper_trail(timeout_ms = nil)
|
||||
# enable_paper_trail - Enabling Papertrail
|
||||
# This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
|
||||
@@ -270,10 +332,11 @@ module PlexRubySDK
|
||||
)
|
||||
|
||||
error = T.let(nil, T.nilable(StandardError))
|
||||
r = T.let(nil, T.nilable(Faraday::Response))
|
||||
http_response = T.let(nil, T.nilable(Faraday::Response))
|
||||
|
||||
|
||||
begin
|
||||
r = connection.get(url) do |req|
|
||||
http_response = connection.get(url) do |req|
|
||||
req.headers.merge!(headers)
|
||||
req.options.timeout = timeout unless timeout.nil?
|
||||
Utils.configure_request_security(req, security)
|
||||
@@ -288,49 +351,78 @@ module PlexRubySDK
|
||||
rescue StandardError => e
|
||||
error = e
|
||||
ensure
|
||||
if r.nil? || Utils.error_status?(r.status)
|
||||
r = @sdk_configuration.hooks.after_error(
|
||||
if http_response.nil? || Utils.error_status?(http_response.status)
|
||||
http_response = @sdk_configuration.hooks.after_error(
|
||||
error: error,
|
||||
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
response: http_response
|
||||
)
|
||||
else
|
||||
r = @sdk_configuration.hooks.after_success(
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: r
|
||||
response: http_response
|
||||
)
|
||||
end
|
||||
|
||||
if r.nil?
|
||||
if http_response.nil?
|
||||
raise error if !error.nil?
|
||||
raise 'no response'
|
||||
end
|
||||
end
|
||||
|
||||
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
|
||||
res = ::PlexRubySDK::Operations::EnablePaperTrailResponse.new(
|
||||
status_code: r.status, content_type: content_type, raw_response: r
|
||||
)
|
||||
if r.status == 200
|
||||
elsif r.status == 400
|
||||
|
||||
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
if Utils.match_status_code(http_response.status, ['200'])
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: http_response
|
||||
)
|
||||
return Models::Operations::EnablePaperTrailResponse.new(
|
||||
status_code: http_response.status,
|
||||
content_type: content_type,
|
||||
raw_response: http_response
|
||||
)
|
||||
elsif Utils.match_status_code(http_response.status, ['400'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::EnablePaperTrailBadRequest)
|
||||
res.bad_request = out
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: http_response
|
||||
)
|
||||
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::EnablePaperTrailBadRequest)
|
||||
obj.raw_response = http_response
|
||||
throw obj
|
||||
else
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
||||
end
|
||||
elsif r.status == 401
|
||||
elsif Utils.match_status_code(http_response.status, ['401'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::EnablePaperTrailUnauthorized)
|
||||
res.unauthorized = out
|
||||
http_response = @sdk_configuration.hooks.after_success(
|
||||
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
||||
hook_ctx: hook_ctx
|
||||
),
|
||||
response: http_response
|
||||
)
|
||||
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::EnablePaperTrailUnauthorized)
|
||||
obj.raw_response = http_response
|
||||
throw obj
|
||||
else
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
||||
end
|
||||
elsif r.status == 403
|
||||
elsif Utils.match_status_code(http_response.status, ['403', '4XX'])
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
||||
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
||||
else
|
||||
raise ::PlexRubySDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
||||
|
||||
end
|
||||
|
||||
res
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user