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:
@@ -1,18 +1,19 @@
|
||||
lockVersion: 2.0.0
|
||||
id: 5d77204e-e413-4fd0-a14a-bad3aee2247a
|
||||
management:
|
||||
docChecksum: e34dac84738ebf2d447ea2b9055a6eeb
|
||||
docChecksum: a91eaf9ec1e6a3a6f4bf0571f5b18bae
|
||||
docVersion: 0.0.3
|
||||
speakeasyVersion: 1.213.0
|
||||
generationVersion: 2.283.1
|
||||
releaseVersion: 0.0.2
|
||||
configChecksum: 9eb228df4cab70cbab8695a6a5458559
|
||||
speakeasyVersion: 1.228.1
|
||||
generationVersion: 2.292.0
|
||||
releaseVersion: 0.1.0
|
||||
configChecksum: b2cfa34ed4663bdec9d08c57f8e59960
|
||||
repoURL: https://github.com/LukeHagar/plexswift.git
|
||||
features:
|
||||
swift:
|
||||
core: 3.2.2
|
||||
globalSecurity: 2.81.5
|
||||
globalServerURLs: 2.82.1
|
||||
globals: 2.81.3
|
||||
methodServerURLs: 3.0.1
|
||||
nameOverrides: 2.81.1
|
||||
generatedFiles:
|
||||
@@ -32,6 +33,7 @@ generatedFiles:
|
||||
- Sources/Plexswift/internal/api/_SessionsAPI.swift
|
||||
- Sources/Plexswift/internal/api/_UpdaterAPI.swift
|
||||
- Sources/Plexswift/configuration/GlobalServer.swift
|
||||
- Sources/Plexswift/configuration/GlobalParameters.swift
|
||||
- Sources/Plexswift/Client.swift
|
||||
- Package.swift
|
||||
- Sources/plexswift/AnyValue.swift
|
||||
|
||||
@@ -12,7 +12,7 @@ generation:
|
||||
auth:
|
||||
oAuth2ClientCredentialsEnabled: true
|
||||
swift:
|
||||
version: 0.0.2
|
||||
version: 0.1.0
|
||||
author: LukeHagar
|
||||
description: Swift Client SDK Generated by Speakeasy
|
||||
imports:
|
||||
|
||||
51
README.md
51
README.md
@@ -31,7 +31,7 @@ You can add `plexswift` to your project directly in Xcode `(File > Add Packages.
|
||||
|
||||
```bash
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.0.2"))
|
||||
.package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.1.0"))
|
||||
]
|
||||
```
|
||||
<!-- End SDK Installation [installation] -->
|
||||
@@ -106,6 +106,55 @@ case .empty:
|
||||
```
|
||||
<!-- End Authentication [security] -->
|
||||
|
||||
<!-- Start Global Parameters [global-parameters] -->
|
||||
## Global Parameters
|
||||
|
||||
A parameter is configured globally. This parameter must be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.
|
||||
|
||||
For example, you can set `X-Plex-Client-Identifier` to `"<value>"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
|
||||
|
||||
|
||||
### Available Globals
|
||||
|
||||
The following global parameter is available. The required parameter must be set when you initialize the SDK client.
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
| ---- | ---- |:--------:| ----------- |
|
||||
| xPlexClientIdentifier | String | ✔️ | 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)
|
||||
|
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```swift
|
||||
import Foundation
|
||||
import Plexswift
|
||||
|
||||
let client = Client()
|
||||
|
||||
let response = try await client.plex.getPin(
|
||||
request: Operations.GetPinRequest(
|
||||
strong: false,
|
||||
)
|
||||
)
|
||||
|
||||
switch response.data {
|
||||
case .twoHundredApplicationJsonObject(let twoHundredApplicationJsonObject):
|
||||
// Handle response
|
||||
break
|
||||
case .fourHundredApplicationJsonObject(let fourHundredApplicationJsonObject):
|
||||
// Handle response
|
||||
break
|
||||
case .empty:
|
||||
// Handle empty response
|
||||
break
|
||||
}
|
||||
|
||||
```
|
||||
<!-- End Global Parameters [global-parameters] -->
|
||||
|
||||
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
||||
|
||||
# Development
|
||||
|
||||
@@ -7,3 +7,11 @@ Based on:
|
||||
- Speakeasy CLI 1.213.0 (2.283.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [swift v0.0.2] .
|
||||
|
||||
## 2024-03-29 16:36:48
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.228.1 (2.292.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [swift v0.1.0] .
|
||||
@@ -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