ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.228.1

This commit is contained in:
speakeasybot
2024-03-29 16:37:03 +00:00
parent b76c9ac22d
commit 0ba404a3aa
12 changed files with 126 additions and 27 deletions

View File

@@ -1,18 +1,19 @@
lockVersion: 2.0.0 lockVersion: 2.0.0
id: 5d77204e-e413-4fd0-a14a-bad3aee2247a id: 5d77204e-e413-4fd0-a14a-bad3aee2247a
management: management:
docChecksum: e34dac84738ebf2d447ea2b9055a6eeb docChecksum: a91eaf9ec1e6a3a6f4bf0571f5b18bae
docVersion: 0.0.3 docVersion: 0.0.3
speakeasyVersion: 1.213.0 speakeasyVersion: 1.228.1
generationVersion: 2.283.1 generationVersion: 2.292.0
releaseVersion: 0.0.2 releaseVersion: 0.1.0
configChecksum: 9eb228df4cab70cbab8695a6a5458559 configChecksum: b2cfa34ed4663bdec9d08c57f8e59960
repoURL: https://github.com/LukeHagar/plexswift.git repoURL: https://github.com/LukeHagar/plexswift.git
features: features:
swift: swift:
core: 3.2.2 core: 3.2.2
globalSecurity: 2.81.5 globalSecurity: 2.81.5
globalServerURLs: 2.82.1 globalServerURLs: 2.82.1
globals: 2.81.3
methodServerURLs: 3.0.1 methodServerURLs: 3.0.1
nameOverrides: 2.81.1 nameOverrides: 2.81.1
generatedFiles: generatedFiles:
@@ -32,6 +33,7 @@ generatedFiles:
- Sources/Plexswift/internal/api/_SessionsAPI.swift - Sources/Plexswift/internal/api/_SessionsAPI.swift
- Sources/Plexswift/internal/api/_UpdaterAPI.swift - Sources/Plexswift/internal/api/_UpdaterAPI.swift
- Sources/Plexswift/configuration/GlobalServer.swift - Sources/Plexswift/configuration/GlobalServer.swift
- Sources/Plexswift/configuration/GlobalParameters.swift
- Sources/Plexswift/Client.swift - Sources/Plexswift/Client.swift
- Package.swift - Package.swift
- Sources/plexswift/AnyValue.swift - Sources/plexswift/AnyValue.swift

View File

@@ -12,7 +12,7 @@ generation:
auth: auth:
oAuth2ClientCredentialsEnabled: true oAuth2ClientCredentialsEnabled: true
swift: swift:
version: 0.0.2 version: 0.1.0
author: LukeHagar author: LukeHagar
description: Swift Client SDK Generated by Speakeasy description: Swift Client SDK Generated by Speakeasy
imports: imports:

View File

@@ -31,7 +31,7 @@ You can add `plexswift` to your project directly in Xcode `(File > Add Packages.
```bash ```bash
dependencies: [ 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] --> <!-- End SDK Installation [installation] -->
@@ -106,6 +106,55 @@ case .empty:
``` ```
<!-- End Authentication [security] --> <!-- 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 --> <!-- Placeholder for Future Speakeasy SDK Sections -->
# Development # Development

View File

@@ -6,4 +6,12 @@ Based on:
- OpenAPI Doc - OpenAPI Doc
- Speakeasy CLI 1.213.0 (2.283.1) https://github.com/speakeasy-api/speakeasy - Speakeasy CLI 1.213.0 (2.283.1) https://github.com/speakeasy-api/speakeasy
### Generated ### Generated
- [swift v0.0.2] . - [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] .

View File

@@ -50,7 +50,7 @@ import FoundationNetworking
/// ///
/// ### Initializers /// ### Initializers
/// ///
/// - ``init(security:)`` /// - ``init(globalParameters:security:)``
/// ///
/// ### API calls /// ### API calls
/// ///
@@ -88,12 +88,14 @@ public final class Client {
// Underscore-prefix properties so these do not potentially conflict with any operation namespaces. // Underscore-prefix properties so these do not potentially conflict with any operation namespaces.
private lazy var _session = URLSession(configuration: .default) private lazy var _session = URLSession(configuration: .default)
private var _globalParameters: GlobalParameters?
private var _security: Shared.Security private var _security: Shared.Security
private var _selectedServer: GlobalServers? private var _selectedServer: GlobalServers?
/// Creates an API client object with the specified parameters. /// 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 self._security = security
} }
@@ -163,7 +165,7 @@ public final class Client {
do { do {
let builder = URLRequestBuilder( let builder = URLRequestBuilder(
baseURL: try baseURL(serverOverride: server), baseURL: try baseURL(serverOverride: server),
parameterDefaults: nil, parameterDefaults: _globalParameters,
defaultSecurityParameterProviding: _security defaultSecurityParameterProviding: _security
) )
try configureRequest(builder) try configureRequest(builder)

View File

@@ -40,6 +40,7 @@ case .empty:
### Connecting to the API ### Connecting to the API
- ``Client`` - ``Client``
- ``GlobalParameters``
- ``Shared/Security`` - ``Shared/Security``
- ``Response`` - ``Response``
- ``ResponseWithHeaders`` - ``ResponseWithHeaders``

View 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
}
}
}

View File

@@ -31,7 +31,7 @@ extension Operations.GetPinRequest: QueryParameterSerializable {
extension Operations.GetPinRequest: HeaderParameterSerializable { extension Operations.GetPinRequest: HeaderParameterSerializable {
func serializedHeaderParameters() throws -> [SerializedParameter] { func serializedHeaderParameters() throws -> [SerializedParameter] {
return [ 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)))
] ]
} }
} }

View File

@@ -27,7 +27,7 @@ extension Operations.GetTokenRequest: PathParameterSerializable {
extension Operations.GetTokenRequest: HeaderParameterSerializable { extension Operations.GetTokenRequest: HeaderParameterSerializable {
func serializedHeaderParameters() throws -> [SerializedParameter] { func serializedHeaderParameters() throws -> [SerializedParameter] {
return [ 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)))
] ]
} }
} }

View File

@@ -5,31 +5,31 @@ import Foundation
extension Operations { extension Operations {
/// A model object /// A model object
public struct GetPinRequest: APIValue { 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 /// Determines the kind of code returned by the API call
/// Strong codes are used for Pin authentication flows /// Strong codes are used for Pin authentication flows
/// Non-Strong codes are used for `Plex.tv/link` /// Non-Strong codes are used for `Plex.tv/link`
/// ///
public let strong: Bool? public let strong: Bool?
/// The unique identifier for the client application
/// Creates an object with the specified parameters
///
/// - Parameter xPlexClientIdentifier: The unique identifier for the client application
/// This is used to track the client application and its usage /// This is used to track the client application and its usage
/// (UUID, serial number, or other number unique per device) /// (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 /// - Parameter strong: Determines the kind of code returned by the API call
/// Strong codes are used for Pin authentication flows /// Strong codes are used for Pin authentication flows
/// Non-Strong codes are used for `Plex.tv/link` /// 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) { public init(strong: Bool? = nil, xPlexClientIdentifier: String? = nil) {
self.xPlexClientIdentifier = xPlexClientIdentifier
self.strong = strong self.strong = strong
self.xPlexClientIdentifier = xPlexClientIdentifier
} }
} }
} }

View File

@@ -11,7 +11,7 @@ extension Operations {
/// This is used to track the client application and its usage /// This is used to track the client application and its usage
/// (UUID, serial number, or other number unique per device) /// (UUID, serial number, or other number unique per device)
/// ///
public let xPlexClientIdentifier: String public let xPlexClientIdentifier: String?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
@@ -21,7 +21,7 @@ extension Operations {
/// (UUID, serial number, or other number unique per device) /// (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.pinID = pinID
self.xPlexClientIdentifier = xPlexClientIdentifier self.xPlexClientIdentifier = xPlexClientIdentifier
} }

View File

@@ -62,7 +62,7 @@ final class URLRequestBuilder: URLRequestConfiguration {
urlRequest.setValue(contentType, forHTTPHeaderField: "Content-Type") 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) addSecurityParameters(to: &urlRequest)