ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.399.2

This commit is contained in:
speakeasybot
2024-09-19 00:09:01 +00:00
parent aa386ef9c9
commit ce6a7c2ddc
23 changed files with 995 additions and 906 deletions

View File

@@ -6,19 +6,31 @@ import Foundation
///
/// > Note: These parameters may be overridden by individual API operations
public struct GlobalParameters {
public let xPlexClientIdentifier: String?
public let clientID: String?
public let clientName: String?
public let clientVersion: String?
public let clientPlatform: String?
public let deviceName: String?
/// Creates an object with the given parameters
///
/// - Parameter xPlexClientIdentifier: The unique identifier for the client application
/// - Parameter clientID: 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
clientID: String? = nil,
clientName: String? = nil,
clientVersion: String? = nil,
clientPlatform: String? = nil,
deviceName: String? = nil
) {
self.xPlexClientIdentifier = xPlexClientIdentifier
self.clientID = clientID
self.clientName = clientName
self.clientVersion = clientVersion
self.clientPlatform = clientPlatform
self.deviceName = deviceName
}
}
@@ -31,7 +43,11 @@ extension GlobalParameters: ParameterDefaults {
public func defaultQueryParameter(for key: String) -> AnyValue? {
switch key {
case "X-Plex-Client-Identifier": return xPlexClientIdentifier.map { AnyValue($0) }
case "ClientID": return clientID.map { AnyValue($0) }
case "ClientName": return clientName.map { AnyValue($0) }
case "ClientVersion": return clientVersion.map { AnyValue($0) }
case "ClientPlatform": return clientPlatform.map { AnyValue($0) }
case "DeviceName": return deviceName.map { AnyValue($0) }
default: return nil
}
}

View File

@@ -294,7 +294,7 @@ private func handleGetServerResourcesResponse(response: Client.APIResponse) thro
private func handleGetPinResponse(response: Client.APIResponse) throws -> Operations.GetPinResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.statusCode == 201 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .authPinContainer(try JSONDecoder().decode(Operations.GetPinAuthPinContainer.self, from: data))

View File

@@ -21,9 +21,12 @@ extension Operations.GetPinRequest: Serializable {
extension Operations.GetPinRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: clientID, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: clientName, named: "X-Plex-Product", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: clientPlatform, named: "X-Plex-Platform", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: clientVersion, named: "X-Plex-Version", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: deviceName, named: "X-Plex-Device", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: strong, named: "strong", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: xPlexClientIdentifier, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: xPlexProduct, named: "X-Plex-Product", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}

View File

@@ -21,10 +21,10 @@ extension Operations.GetServerResourcesRequest: Serializable {
extension Operations.GetServerResourcesRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: clientID, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: includeHttps, named: "includeHttps", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: includeIPv6, named: "includeIPv6", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: includeRelay, named: "includeRelay", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: xPlexClientIdentifier, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}

View File

@@ -31,7 +31,7 @@ extension Operations.GetTokenByPinIdRequest: PathParameterSerializable {
extension Operations.GetTokenByPinIdRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: xPlexClientIdentifier, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: clientID, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}

View File

@@ -21,7 +21,7 @@ extension Operations.PostUsersSignInDataRequest: Serializable {
extension Operations.PostUsersSignInDataRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: xPlexClientIdentifier, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: clientID, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}

View File

@@ -22,7 +22,7 @@ extension Operations {
/// Indicates if the region has privacy restrictions.
public let inPrivacyRestrictedRegion: Bool
/// The postal code of the location.
public let postalCode: Int
public let postalCode: String
/// The name of the primary administrative subdivision.
public let subdivisions: String
/// The time zone of the country.
@@ -42,7 +42,7 @@ extension Operations {
/// - Parameter subdivisions: The name of the primary administrative subdivision.
/// - Parameter timeZone: The time zone of the country.
///
public init(city: String, code: String, continentCode: String, coordinates: String, country: String, europeanUnionMember: Bool, inPrivacyRestrictedCountry: Bool, inPrivacyRestrictedRegion: Bool, postalCode: Int, subdivisions: String, timeZone: String) {
public init(city: String, code: String, continentCode: String, coordinates: String, country: String, europeanUnionMember: Bool, inPrivacyRestrictedCountry: Bool, inPrivacyRestrictedRegion: Bool, postalCode: String, subdivisions: String, timeZone: String) {
self.city = city
self.code = code
self.continentCode = continentCode

View File

@@ -22,7 +22,7 @@ extension Operations {
/// Indicates if the region has privacy restrictions.
public let inPrivacyRestrictedRegion: Bool
/// The postal code of the location.
public let postalCode: Int
public let postalCode: String
/// The name of the primary administrative subdivision.
public let subdivisions: String
/// The time zone of the country.
@@ -42,7 +42,7 @@ extension Operations {
/// - Parameter subdivisions: The name of the primary administrative subdivision.
/// - Parameter timeZone: The time zone of the country.
///
public init(city: String, code: String, continentCode: String, coordinates: String, country: String, europeanUnionMember: Bool, inPrivacyRestrictedCountry: Bool, inPrivacyRestrictedRegion: Bool, postalCode: Int, subdivisions: String, timeZone: String) {
public init(city: String, code: String, continentCode: String, coordinates: String, country: String, europeanUnionMember: Bool, inPrivacyRestrictedCountry: Bool, inPrivacyRestrictedRegion: Bool, postalCode: String, subdivisions: String, timeZone: String) {
self.city = city
self.code = code
self.continentCode = continentCode

View File

@@ -20,7 +20,7 @@ extension Operations {
public let product: String
public let qr: String
public let trusted: Bool
public let authToken: AnyValue?
public let authToken: String?
public let newRegistration: AnyValue?
/// Creates an object with the specified parameters
@@ -29,7 +29,7 @@ extension Operations {
/// - Parameter expiresIn: The number of seconds this pin expires, by default 900 seconds
/// - Parameter location: Geo location data
///
public init(clientIdentifier: String, code: String, createdAt: Date, expiresAt: Date, expiresIn: Int, id: Int, location: Operations.GeoData, product: String, qr: String, trusted: Bool, authToken: AnyValue? = nil, newRegistration: AnyValue? = nil) {
public init(clientIdentifier: String, code: String, createdAt: Date, expiresAt: Date, expiresIn: Int, id: Int, location: Operations.GeoData, product: String, qr: String, trusted: Bool, authToken: String? = nil, newRegistration: AnyValue? = nil) {
self.clientIdentifier = clientIdentifier
self.code = code
self._createdAt = DateTime<Date>(wrappedValue: createdAt)
@@ -73,7 +73,7 @@ extension Operations.GetPinAuthPinContainer: Codable {
self.product = try container.decode(String.self, forKey: .product)
self.qr = try container.decode(String.self, forKey: .qr)
self.trusted = try container.decode(Bool.self, forKey: .trusted)
self.authToken = try container.decodeIfPresent(AnyValue.self, forKey: .authToken)
self.authToken = try container.decodeIfPresent(String.self, forKey: .authToken)
self.newRegistration = try container.decodeIfPresent(AnyValue.self, forKey: .newRegistration)
}

View File

@@ -5,32 +5,38 @@ 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 clientID: String?
public let clientName: String?
public let clientPlatform: String?
public let clientVersion: String?
public let deviceName: 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?
/// 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?
public let xPlexProduct: String?
/// Creates an object with the specified parameters
///
/// - Parameter clientID: 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)
///
/// - 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(strong: Bool? = nil, xPlexClientIdentifier: String? = nil, xPlexProduct: String? = nil) {
public init(clientID: String? = nil, clientName: String? = nil, clientPlatform: String? = nil, clientVersion: String? = nil, deviceName: String? = nil, strong: Bool? = nil) {
self.clientID = clientID
self.clientName = clientName
self.clientPlatform = clientPlatform
self.clientVersion = clientVersion
self.deviceName = deviceName
self.strong = strong
self.xPlexClientIdentifier = xPlexClientIdentifier
self.xPlexProduct = xPlexProduct
}
}}

View File

@@ -5,6 +5,11 @@ import Foundation
extension Operations {
/// A model object
public struct GetServerResourcesRequest: 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 clientID: String?
/// Include Https entries in the results
public let includeHttps: Operations.IncludeHttps?
/// Include IPv6 entries in the results
@@ -13,28 +18,23 @@ extension Operations {
/// E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
///
public let includeRelay: Operations.IncludeRelay?
/// 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 clientID: 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)
///
/// - Parameter includeHttps: Include Https entries in the results
/// - Parameter includeIPv6: Include IPv6 entries in the results
/// - Parameter includeRelay: Include Relay addresses in the results
/// E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
///
/// - 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(includeHttps: Operations.IncludeHttps? = nil, includeIPv6: Operations.IncludeIPv6? = nil, includeRelay: Operations.IncludeRelay? = nil, xPlexClientIdentifier: String? = nil) {
public init(clientID: String? = nil, includeHttps: Operations.IncludeHttps? = nil, includeIPv6: Operations.IncludeIPv6? = nil, includeRelay: Operations.IncludeRelay? = nil) {
self.clientID = clientID
self.includeHttps = includeHttps
self.includeIPv6 = includeIPv6
self.includeRelay = includeRelay
self.xPlexClientIdentifier = xPlexClientIdentifier
}
}}

View File

@@ -20,7 +20,7 @@ extension Operations {
public let product: String
public let qr: String
public let trusted: Bool
public let authToken: AnyValue?
public let authToken: String?
public let newRegistration: AnyValue?
/// Creates an object with the specified parameters
@@ -29,7 +29,7 @@ extension Operations {
/// - Parameter expiresIn: The number of seconds this pin expires, by default 900 seconds
/// - Parameter location: Geo location data
///
public init(clientIdentifier: String, code: String, createdAt: Date, expiresAt: Date, expiresIn: Int, id: Int, location: Operations.GetTokenByPinIdGeoData, product: String, qr: String, trusted: Bool, authToken: AnyValue? = nil, newRegistration: AnyValue? = nil) {
public init(clientIdentifier: String, code: String, createdAt: Date, expiresAt: Date, expiresIn: Int, id: Int, location: Operations.GetTokenByPinIdGeoData, product: String, qr: String, trusted: Bool, authToken: String? = nil, newRegistration: AnyValue? = nil) {
self.clientIdentifier = clientIdentifier
self.code = code
self._createdAt = DateTime<Date>(wrappedValue: createdAt)
@@ -73,7 +73,7 @@ extension Operations.GetTokenByPinIdAuthPinContainer: Codable {
self.product = try container.decode(String.self, forKey: .product)
self.qr = try container.decode(String.self, forKey: .qr)
self.trusted = try container.decode(Bool.self, forKey: .trusted)
self.authToken = try container.decodeIfPresent(AnyValue.self, forKey: .authToken)
self.authToken = try container.decodeIfPresent(String.self, forKey: .authToken)
self.newRegistration = try container.decodeIfPresent(AnyValue.self, forKey: .newRegistration)
}

View File

@@ -22,7 +22,7 @@ extension Operations {
/// Indicates if the region has privacy restrictions.
public let inPrivacyRestrictedRegion: Bool
/// The postal code of the location.
public let postalCode: Int
public let postalCode: String
/// The name of the primary administrative subdivision.
public let subdivisions: String
/// The time zone of the country.
@@ -42,7 +42,7 @@ extension Operations {
/// - Parameter subdivisions: The name of the primary administrative subdivision.
/// - Parameter timeZone: The time zone of the country.
///
public init(city: String, code: String, continentCode: String, coordinates: String, country: String, europeanUnionMember: Bool, inPrivacyRestrictedCountry: Bool, inPrivacyRestrictedRegion: Bool, postalCode: Int, subdivisions: String, timeZone: String) {
public init(city: String, code: String, continentCode: String, coordinates: String, country: String, europeanUnionMember: Bool, inPrivacyRestrictedCountry: Bool, inPrivacyRestrictedRegion: Bool, postalCode: String, subdivisions: String, timeZone: String) {
self.city = city
self.code = code
self.continentCode = continentCode

View File

@@ -11,18 +11,18 @@ 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 clientID: String?
/// Creates an object with the specified parameters
///
/// - Parameter pinID: The PinID to retrieve an access token for
/// - Parameter xPlexClientIdentifier: The unique identifier for the client application
/// - Parameter clientID: 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(pinID: Int, xPlexClientIdentifier: String? = nil) {
public init(pinID: Int, clientID: String? = nil) {
self.pinID = pinID
self.xPlexClientIdentifier = xPlexClientIdentifier
self.clientID = clientID
}
}}

View File

@@ -5,24 +5,24 @@ import Foundation
extension Operations {
/// A model object
public struct PostUsersSignInDataRequest: APIValue {
/// Login credentials
public let requestBody: Operations.PostUsersSignInDataRequestBody?
/// 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?
public let clientID: String?
/// Login credentials
public let requestBody: Operations.PostUsersSignInDataRequestBody?
/// Creates an object with the specified parameters
///
/// - Parameter requestBody: Login credentials
/// - Parameter xPlexClientIdentifier: The unique identifier for the client application
/// - Parameter clientID: 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)
///
/// - Parameter requestBody: Login credentials
///
public init(requestBody: Operations.PostUsersSignInDataRequestBody? = nil, xPlexClientIdentifier: String? = nil) {
public init(clientID: String? = nil, requestBody: Operations.PostUsersSignInDataRequestBody? = nil) {
self.clientID = clientID
self.requestBody = requestBody
self.xPlexClientIdentifier = xPlexClientIdentifier
}
}}