Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.399.2
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Sep 19, 2024
1 parent aa386ef commit ce6a7c2
Show file tree
Hide file tree
Showing 23 changed files with 528 additions and 439 deletions.
42 changes: 35 additions & 7 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 5d77204e-e413-4fd0-a14a-bad3aee2247a
management:
docChecksum: a6fee1797b2da7ccbaf7743772a40b56
docChecksum: 5bf578a672589649d8ed83c3927c50a6
docVersion: 0.0.3
speakeasyVersion: 1.399.0
generationVersion: 2.415.8
releaseVersion: 0.6.2
configChecksum: a567cf3757451b3f535919ede5d4d2f5
speakeasyVersion: 1.399.2
generationVersion: 2.416.6
releaseVersion: 0.6.3
configChecksum: 2c841260186552c7e56b0c2f58acf626
repoURL: https://github.com/LukeHagar/plexswift.git
features:
swift:
Expand Down Expand Up @@ -1340,7 +1340,7 @@ examples:
european_union_member: true
in_privacy_restricted_country: true
in_privacy_restricted_region: true
postal_code: 802
postal_code: "802"
subdivisions: Saint Thomas
time_zone: America/St_Thomas
"400":
Expand Down Expand Up @@ -1579,7 +1579,10 @@ examples:
"":
parameters:
query:
X-Plex-Device: Linux
X-Plex-Platform: Chrome
X-Plex-Product: Plex Web
X-Plex-Version: 4.133.0
responses:
"200":
application/json:
Expand All @@ -1606,6 +1609,31 @@ examples:
product: "0"
qr: https://plex.tv/api/v2/pins/qr/7RQZ
trusted: false
"201":
application/json:
authToken: null
clientIdentifier: string
code: 7RQZ
createdAt: "2024-07-16T17:03:05Z"
expiresAt: "2024-07-16T17:18:05Z"
expiresIn: 876
id: 308667304
location:
city: Amsterdam
code: VI
continent_code: NA
coordinates: 18.3381, -64.8941
country: United States Virgin Islands
european_union_member: true
in_privacy_restricted_country: true
in_privacy_restricted_region: true
postal_code: "802"
subdivisions: Saint Thomas
time_zone: America/St_Thomas
newRegistration: null
product: "0"
qr: https://plex.tv/api/v2/pins/qr/7RQZ
trusted: false
"400":
application/json:
errors: []
Expand Down Expand Up @@ -1691,7 +1719,7 @@ examples:
speakeasy-default-get-resized-photo:
parameters:
query:
blur: 4000
blur: 20
height: 165
minSize: 0
opacity: 643869
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
swift:
version: 0.6.2
version: 0.6.3
author: LukeHagar
description: Swift Client SDK Generated by Speakeasy
imports:
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ targets:
plexswift:
source: plexapi
codeSamplesNamespace: code-samples-swift-plexswift
codeSamplesRevisionDigest: sha256:374424e9ecd0976753f67b804f9093838b158cd0f498b0441fc412ab1a95330b
codeSamplesRevisionDigest: sha256:3ba1ba57d33e6d01dcd46d8e2c0fd0be82164b37e769016a64a09cf96bfaca60
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,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.6.2"))
.package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.6.3"))
]
```
<!-- End SDK Installation [installation] -->
Expand Down Expand Up @@ -248,21 +248,25 @@ case .empty:
<!-- Start Global Parameters [global-parameters] -->
## Global Parameters

A parameter is configured globally. This parameter may 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.
Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. 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 `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getServerResources`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getServerResources`. 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 following global parameters are available.

| Name | Type | Required | Description |
| ---- | ---- |:--------:| ----------- |
| xPlexClientIdentifier | String | | The unique identifier for the client application
| clientID | 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)
|
| clientName | String | | The clientName parameter. |
| clientVersion | String | | The clientVersion parameter. |
| clientPlatform | String | | The clientPlatform parameter. |
| deviceName | String | | The deviceName parameter. |


### Example
Expand All @@ -277,7 +281,7 @@ let response = try await client.plex.getServerResources(
request: Operations.GetServerResourcesRequest(
includeHttps: .one,
includeIPv6: .one,
includeRelay: .one,
includeRelay: .one
)
)

Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -602,4 +602,14 @@ Based on:
### Generated
- [swift v0.6.2] .
### Releases
- [Swift Package Manager v0.6.2] https://github.com/LukeHagar/plexswift/releases/tag/v0.6.2 - .
- [Swift Package Manager v0.6.2] https://github.com/LukeHagar/plexswift/releases/tag/v0.6.2 - .

## 2024-09-19 00:07:44
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.399.2 (2.416.6) https://github.com/speakeasy-api/speakeasy
### Generated
- [swift v0.6.3] .
### Releases
- [Swift Package Manager v0.6.3] https://github.com/LukeHagar/plexswift/releases/tag/v0.6.3 - .
26 changes: 21 additions & 5 deletions Sources/Plexswift/configuration/GlobalParameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand All @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plexswift/internal/api/_PlexAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
4 changes: 2 additions & 2 deletions Sources/Plexswift/models/operations/GeoData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Sources/Plexswift/models/operations/GetGeoDataGeoData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
}

Expand Down
Loading

0 comments on commit ce6a7c2

Please sign in to comment.