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.531.4
This commit is contained in:
@@ -23,11 +23,11 @@ module PlexRubySDK
|
||||
end
|
||||
|
||||
|
||||
sig { params(count: T.nilable(::Float), only_transient: T.nilable(::PlexRubySDK::Operations::OnlyTransient), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetGlobalHubsResponse) }
|
||||
sig { params(count: T.nilable(::Float), only_transient: T.nilable(Models::Operations::OnlyTransient), timeout_ms: T.nilable(Integer)).returns(Models::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(
|
||||
request = Models::Operations::GetGlobalHubsRequest.new(
|
||||
|
||||
count: count,
|
||||
only_transient: only_transient
|
||||
@@ -36,7 +36,7 @@ module PlexRubySDK
|
||||
base_url = Utils.template_url(url, params)
|
||||
url = "#{base_url}/hubs"
|
||||
headers = {}
|
||||
query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetGlobalHubsRequest, request)
|
||||
query_params = Utils.get_query_params(Models::Operations::GetGlobalHubsRequest, request)
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
@@ -55,10 +55,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
|
||||
@@ -74,56 +75,90 @@ 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 = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
if Utils.match_status_code(http_response.status, ['200'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
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::Operations::GetGlobalHubsResponseBody)
|
||||
response = Models::Operations::GetGlobalHubsResponse.new(
|
||||
status_code: http_response.status,
|
||||
content_type: content_type,
|
||||
raw_response: http_response,
|
||||
object: obj
|
||||
)
|
||||
|
||||
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
return response
|
||||
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, ['400'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
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::GetGlobalHubsBadRequest)
|
||||
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, ['401'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
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::GetGlobalHubsUnauthorized)
|
||||
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'
|
||||
|
||||
res = ::PlexRubySDK::Operations::GetGlobalHubsResponse.new(
|
||||
status_code: r.status, content_type: content_type, raw_response: r
|
||||
)
|
||||
if r.status == 200
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::GetGlobalHubsResponseBody)
|
||||
res.object = out
|
||||
end
|
||||
elsif r.status == 400
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::GetGlobalHubsBadRequest)
|
||||
res.bad_request = out
|
||||
end
|
||||
elsif r.status == 401
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::GetGlobalHubsUnauthorized)
|
||||
res.unauthorized = out
|
||||
end
|
||||
end
|
||||
|
||||
res
|
||||
end
|
||||
|
||||
|
||||
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetRecentlyAddedRequest), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetRecentlyAddedResponse) }
|
||||
sig { params(request: T.nilable(Models::Operations::GetRecentlyAddedRequest), timeout_ms: T.nilable(Integer)).returns(Models::Operations::GetRecentlyAddedResponse) }
|
||||
def get_recently_added(request, timeout_ms = nil)
|
||||
# get_recently_added - Get Recently Added
|
||||
# This endpoint will return the recently added content.
|
||||
@@ -132,7 +167,7 @@ module PlexRubySDK
|
||||
base_url = Utils.template_url(url, params)
|
||||
url = "#{base_url}/hubs/home/recentlyAdded"
|
||||
headers = {}
|
||||
query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetRecentlyAddedRequest, request)
|
||||
query_params = Utils.get_query_params(Models::Operations::GetRecentlyAddedRequest, request)
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
@@ -151,10 +186,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
|
||||
@@ -170,52 +206,67 @@ 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::GetRecentlyAddedResponse.new(
|
||||
status_code: r.status, content_type: content_type, raw_response: r
|
||||
)
|
||||
if r.status == 200
|
||||
|
||||
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
if Utils.match_status_code(http_response.status, ['200'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::GetRecentlyAddedResponseBody)
|
||||
res.object = out
|
||||
end
|
||||
elsif [400, 401].include?(r.status)
|
||||
end
|
||||
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::Operations::GetRecentlyAddedResponseBody)
|
||||
response = Models::Operations::GetRecentlyAddedResponse.new(
|
||||
status_code: http_response.status,
|
||||
content_type: content_type,
|
||||
raw_response: http_response,
|
||||
object: obj
|
||||
)
|
||||
|
||||
res
|
||||
return response
|
||||
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, ['400', '401', '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
|
||||
end
|
||||
|
||||
|
||||
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) }
|
||||
sig { params(section_id: ::Float, count: T.nilable(::Float), only_transient: T.nilable(Models::Operations::QueryParamOnlyTransient), timeout_ms: T.nilable(Integer)).returns(Models::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
|
||||
#
|
||||
request = ::PlexRubySDK::Operations::GetLibraryHubsRequest.new(
|
||||
request = Models::Operations::GetLibraryHubsRequest.new(
|
||||
|
||||
section_id: section_id,
|
||||
count: count,
|
||||
@@ -224,13 +275,13 @@ module PlexRubySDK
|
||||
url, params = @sdk_configuration.get_server_details
|
||||
base_url = Utils.template_url(url, params)
|
||||
url = Utils.generate_url(
|
||||
::PlexRubySDK::Operations::GetLibraryHubsRequest,
|
||||
Models::Operations::GetLibraryHubsRequest,
|
||||
base_url,
|
||||
'/hubs/sections/{sectionId}',
|
||||
request
|
||||
)
|
||||
headers = {}
|
||||
query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetLibraryHubsRequest, request)
|
||||
query_params = Utils.get_query_params(Models::Operations::GetLibraryHubsRequest, request)
|
||||
headers['Accept'] = 'application/json'
|
||||
headers['user-agent'] = @sdk_configuration.user_agent
|
||||
|
||||
@@ -249,10 +300,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
|
||||
@@ -268,52 +320,86 @@ 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 = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
if Utils.match_status_code(http_response.status, ['200'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
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::Operations::GetLibraryHubsResponseBody)
|
||||
response = Models::Operations::GetLibraryHubsResponse.new(
|
||||
status_code: http_response.status,
|
||||
content_type: content_type,
|
||||
raw_response: http_response,
|
||||
object: obj
|
||||
)
|
||||
|
||||
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
||||
return response
|
||||
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, ['400'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
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::GetLibraryHubsBadRequest)
|
||||
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, ['401'])
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
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::GetLibraryHubsUnauthorized)
|
||||
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'
|
||||
|
||||
res = ::PlexRubySDK::Operations::GetLibraryHubsResponse.new(
|
||||
status_code: r.status, content_type: content_type, raw_response: r
|
||||
)
|
||||
if r.status == 200
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::GetLibraryHubsResponseBody)
|
||||
res.object = out
|
||||
end
|
||||
elsif r.status == 400
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::GetLibraryHubsBadRequest)
|
||||
res.bad_request = out
|
||||
end
|
||||
elsif r.status == 401
|
||||
if Utils.match_content_type(content_type, 'application/json')
|
||||
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::GetLibraryHubsUnauthorized)
|
||||
res.unauthorized = out
|
||||
end
|
||||
end
|
||||
|
||||
res
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user