mirror of
https://github.com/LukeHagar/plexruby.git
synced 2025-12-06 12:47:44 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.513.4
This commit is contained in:
@@ -16,33 +16,29 @@ module PlexRubySDK
|
||||
attr_accessor :server, :media, :video, :activities, :butler, :plex, :hubs, :search, :library, :watchlist, :log, :playlists, :authentication, :statistics, :sessions, :updater, :users
|
||||
|
||||
sig do
|
||||
params(client: Faraday::Request,
|
||||
security: T.nilable(Shared::Security),
|
||||
protocol: T.nilable(::PlexRubySDK::ServerVariables::ServerProtocol),
|
||||
ip: T.nilable(::String),
|
||||
port: T.nilable(::String),
|
||||
server_idx: Integer,
|
||||
server_url: String,
|
||||
url_params: T::Hash[Symbol, String]).void
|
||||
params(
|
||||
client: T.nilable(Faraday::Request),
|
||||
security: T.nilable(::PlexRubySDK::Shared::Security),
|
||||
security_source: T.nilable(T.proc.returns(::PlexRubySDK::Shared::Security)),
|
||||
protocol: T.nilable(::PlexRubySDK::ServerVariables::ServerProtocol),
|
||||
ip: T.nilable(::String),
|
||||
port: T.nilable(::String),
|
||||
server_idx: T.nilable(Integer),
|
||||
server_url: T.nilable(String),
|
||||
url_params: T.nilable(T::Hash[Symbol, String])
|
||||
).void
|
||||
end
|
||||
def initialize(client: nil,
|
||||
security: nil,
|
||||
protocol: nil,
|
||||
ip: nil,
|
||||
port: nil,
|
||||
server_idx: nil,
|
||||
server_url: nil,
|
||||
url_params: nil)
|
||||
|
||||
def initialize(client: nil, security: nil, security_source: nil, protocol: nil, ip: nil, port: nil, server_idx: nil, server_url: nil, url_params: nil)
|
||||
## Instantiates the SDK configuring it with the provided parameters.
|
||||
# @param [Faraday::Request] client The faraday HTTP client to use for all operations
|
||||
# @param [Shared::Security] security The security details required for authentication
|
||||
# @param [T.nilable(Faraday::Request)] client The faraday HTTP client to use for all operations
|
||||
# @param [T.nilable(::PlexRubySDK::Shared::Security)] security: The security details required for authentication
|
||||
# @param [T.proc.returns(T.nilable(::PlexRubySDK::Shared::Security))] security_source: A function that returns security details required for authentication
|
||||
# @param [T.nilable(::PlexRubySDK::ServerVariables::ServerProtocol)] protocol: Allows setting the protocol variable for url substitution
|
||||
# @param [T.nilable(::String)] ip: Allows setting the ip variable for url substitution
|
||||
# @param [T.nilable(::String)] port: Allows setting the port variable for url substitution
|
||||
# @param [::Integer] server_idx The index of the server to use for all operations
|
||||
# @param [::String] server_url The server URL to use for all operations
|
||||
# @param [::Hash<::Symbol, ::String>] url_params Parameters to optionally template the server URL with
|
||||
# @param [T.nilable(::Integer)] server_idx The index of the server to use for all operations
|
||||
# @param [T.nilable(::String)] server_url The server URL to use for all operations
|
||||
# @param [T.nilable(::Hash<::Symbol, ::String>)] url_params Parameters to optionally template the server URL with
|
||||
|
||||
if client.nil?
|
||||
client = Faraday.new(request: {
|
||||
@@ -56,8 +52,16 @@ module PlexRubySDK
|
||||
if !server_url.nil?
|
||||
if !url_params.nil?
|
||||
server_url = Utils.template_url(server_url, url_params)
|
||||
elsif !protocol.nil? || !ip.nil? || !port.nil?
|
||||
url_params = {
|
||||
protocol: protocol || 'https',
|
||||
ip: ip || '10.10.10.47',
|
||||
port: port || '32400',
|
||||
}
|
||||
server_url = Utils.template_url(server_url, url_params)
|
||||
end
|
||||
end
|
||||
|
||||
server_idx = 0 if server_idx.nil?
|
||||
|
||||
server_params = [
|
||||
@@ -67,35 +71,17 @@ module PlexRubySDK
|
||||
port: port || '32400',
|
||||
},
|
||||
]
|
||||
|
||||
@sdk_configuration = SDKConfiguration.new(client, security, server_url, server_idx, server_params)
|
||||
@sdk_configuration = SDKConfiguration.new(
|
||||
client,
|
||||
security,
|
||||
security_source,
|
||||
server_url,
|
||||
server_idx,
|
||||
server_params
|
||||
)
|
||||
init_sdks
|
||||
end
|
||||
|
||||
sig { params(server_url: String, params: T.nilable(T::Hash[Symbol, String])).void }
|
||||
def config_server_url(server_url, params)
|
||||
if !params.nil?
|
||||
server_url = Utils.template_url(server_url, params)
|
||||
end
|
||||
@sdk_configuration.server_url = server_url
|
||||
init_sdks
|
||||
end
|
||||
|
||||
sig { params(server_idx: Integer, params: T.nilable(T::Hash[Symbol, String])).void }
|
||||
def config_server(server_idx, params)
|
||||
raise StandardError, "Invalid server index #{server_idx}" if server_idx.negative? || server_idx >= SERVERS.length
|
||||
@sdk_configuration.server_idx = server_idx
|
||||
if !params.nil?
|
||||
@sdk_configuration.server_params[server_idx] = params
|
||||
end
|
||||
init_sdks
|
||||
end
|
||||
|
||||
sig { params(security: ::PlexRubySDK::Shared::Security).void }
|
||||
def config_security(security)
|
||||
@sdk_configuration.security = security
|
||||
end
|
||||
|
||||
sig { void }
|
||||
def init_sdks
|
||||
@server = Server.new(@sdk_configuration)
|
||||
|
||||
Reference in New Issue
Block a user