mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 12:47:44 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.228.1
This commit is contained in:
@@ -50,7 +50,7 @@ import FoundationNetworking
|
||||
///
|
||||
/// ### Initializers
|
||||
///
|
||||
/// - ``init(security:)``
|
||||
/// - ``init(globalParameters:security:)``
|
||||
///
|
||||
/// ### API calls
|
||||
///
|
||||
@@ -88,12 +88,14 @@ public final class Client {
|
||||
|
||||
// Underscore-prefix properties so these do not potentially conflict with any operation namespaces.
|
||||
private lazy var _session = URLSession(configuration: .default)
|
||||
private var _globalParameters: GlobalParameters?
|
||||
private var _security: Shared.Security
|
||||
|
||||
private var _selectedServer: GlobalServers?
|
||||
|
||||
/// Creates an API client object with the specified parameters.
|
||||
public init(security: Shared.Security) {
|
||||
public init(globalParameters: GlobalParameters? = nil, security: Shared.Security) {
|
||||
self._globalParameters = globalParameters
|
||||
self._security = security
|
||||
}
|
||||
|
||||
@@ -163,7 +165,7 @@ public final class Client {
|
||||
do {
|
||||
let builder = URLRequestBuilder(
|
||||
baseURL: try baseURL(serverOverride: server),
|
||||
parameterDefaults: nil,
|
||||
parameterDefaults: _globalParameters,
|
||||
defaultSecurityParameterProviding: _security
|
||||
)
|
||||
try configureRequest(builder)
|
||||
|
||||
@@ -40,6 +40,7 @@ case .empty:
|
||||
### Connecting to the API
|
||||
|
||||
- ``Client``
|
||||
- ``GlobalParameters``
|
||||
- ``Shared/Security``
|
||||
- ``Response``
|
||||
- ``ResponseWithHeaders``
|
||||
|
||||
37
Sources/Plexswift/configuration/GlobalParameters.swift
Normal file
37
Sources/Plexswift/configuration/GlobalParameters.swift
Normal file
@@ -0,0 +1,37 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Describes common parameters which can be used when making API requests.
|
||||
///
|
||||
/// > Note: These parameters may be overridden by individual API operations
|
||||
public struct GlobalParameters {
|
||||
public let xPlexClientIdentifier: String?
|
||||
|
||||
/// Creates an object with the given parameters
|
||||
///
|
||||
/// - Parameter xPlexClientIdentifier: The unique identifier for the client application
|
||||
/// This is used to track the client application and its usage
|
||||
/// (UUID, serial number, or other number unique per device)
|
||||
///
|
||||
///
|
||||
public init(
|
||||
xPlexClientIdentifier: String? = nil
|
||||
) {
|
||||
self.xPlexClientIdentifier = xPlexClientIdentifier
|
||||
}
|
||||
}
|
||||
|
||||
extension GlobalParameters: ParameterDefaults {
|
||||
public func defaultSerializedPathParameter(for key: String) throws -> String? {
|
||||
switch key {
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
public func defaultQueryParameter(for key: String) -> AnyValue? {
|
||||
switch key {
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ extension Operations.GetPinRequest: QueryParameterSerializable {
|
||||
extension Operations.GetPinRequest: HeaderParameterSerializable {
|
||||
func serializedHeaderParameters() throws -> [SerializedParameter] {
|
||||
return [
|
||||
SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try xPlexClientIdentifier.serialize(with: .header(explode: false)))
|
||||
SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try xPlexClientIdentifier?.serialize(with: .header(explode: false)))
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ extension Operations.GetTokenRequest: PathParameterSerializable {
|
||||
extension Operations.GetTokenRequest: HeaderParameterSerializable {
|
||||
func serializedHeaderParameters() throws -> [SerializedParameter] {
|
||||
return [
|
||||
SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try xPlexClientIdentifier.serialize(with: .header(explode: false)))
|
||||
SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try xPlexClientIdentifier?.serialize(with: .header(explode: false)))
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,31 +5,31 @@ import Foundation
|
||||
extension Operations {
|
||||
/// A model object
|
||||
public struct GetPinRequest: APIValue {
|
||||
/// The unique identifier for the client application
|
||||
/// This is used to track the client application and its usage
|
||||
/// (UUID, serial number, or other number unique per device)
|
||||
///
|
||||
public let xPlexClientIdentifier: String
|
||||
/// Determines the kind of code returned by the API call
|
||||
/// Strong codes are used for Pin authentication flows
|
||||
/// Non-Strong codes are used for `Plex.tv/link`
|
||||
///
|
||||
public let strong: Bool?
|
||||
|
||||
/// Creates an object with the specified parameters
|
||||
///
|
||||
/// - Parameter xPlexClientIdentifier: The unique identifier for the client application
|
||||
/// The unique identifier for the client application
|
||||
/// This is used to track the client application and its usage
|
||||
/// (UUID, serial number, or other number unique per device)
|
||||
///
|
||||
public let xPlexClientIdentifier: String?
|
||||
|
||||
/// Creates an object with the specified parameters
|
||||
///
|
||||
/// - Parameter strong: Determines the kind of code returned by the API call
|
||||
/// Strong codes are used for Pin authentication flows
|
||||
/// Non-Strong codes are used for `Plex.tv/link`
|
||||
///
|
||||
/// - Parameter xPlexClientIdentifier: The unique identifier for the client application
|
||||
/// This is used to track the client application and its usage
|
||||
/// (UUID, serial number, or other number unique per device)
|
||||
///
|
||||
///
|
||||
public init(xPlexClientIdentifier: String, strong: Bool? = nil) {
|
||||
self.xPlexClientIdentifier = xPlexClientIdentifier
|
||||
public init(strong: Bool? = nil, xPlexClientIdentifier: String? = nil) {
|
||||
self.strong = strong
|
||||
self.xPlexClientIdentifier = xPlexClientIdentifier
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ extension Operations {
|
||||
/// This is used to track the client application and its usage
|
||||
/// (UUID, serial number, or other number unique per device)
|
||||
///
|
||||
public let xPlexClientIdentifier: String
|
||||
public let xPlexClientIdentifier: String?
|
||||
|
||||
/// Creates an object with the specified parameters
|
||||
///
|
||||
@@ -21,7 +21,7 @@ extension Operations {
|
||||
/// (UUID, serial number, or other number unique per device)
|
||||
///
|
||||
///
|
||||
public init(pinID: String, xPlexClientIdentifier: String) {
|
||||
public init(pinID: String, xPlexClientIdentifier: String? = nil) {
|
||||
self.pinID = pinID
|
||||
self.xPlexClientIdentifier = xPlexClientIdentifier
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ final class URLRequestBuilder: URLRequestConfiguration {
|
||||
urlRequest.setValue(contentType, forHTTPHeaderField: "Content-Type")
|
||||
}
|
||||
|
||||
urlRequest.setValue("speakeasy-sdk/swift 0.0.2 2.283.1 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName)
|
||||
urlRequest.setValue("speakeasy-sdk/swift 0.1.0 2.292.0 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName)
|
||||
|
||||
addSecurityParameters(to: &urlRequest)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user