ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.6

This commit is contained in:
speakeasybot
2025-02-07 00:09:08 +00:00
parent dc8f74bd40
commit 1dff7df598
47 changed files with 933 additions and 24 deletions

View File

@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 5d77204e-e413-4fd0-a14a-bad3aee2247a
management:
docChecksum: 14b35829d4be91a88269761c3ed01426
docChecksum: 7dec92ab9151a1b5a35df5faa81811ba
docVersion: 0.0.3
speakeasyVersion: 1.405.6
generationVersion: 2.428.1
releaseVersion: 0.9.9
configChecksum: 9200bd9ee8c67e5072d90d0fc2cea504
releaseVersion: 0.9.11
configChecksum: 13e55494eeb94833b0c438321b3ef8ff
repoURL: https://github.com/LukeHagar/plexswift.git
features:
swift:
@@ -37,10 +37,17 @@ generatedFiles:
- Sources/Plexswift/internal/api/_SessionsAPI.swift
- Sources/Plexswift/internal/api/_StatisticsAPI.swift
- Sources/Plexswift/internal/api/_UpdaterAPI.swift
- Sources/Plexswift/internal/api/_UsersAPI.swift
- Sources/Plexswift/internal/api/_VideoAPI.swift
- Sources/Plexswift/internal/api/_WatchlistAPI.swift
- Sources/Plexswift/internal/models/ActiveDirection+Serialization.swift
- Sources/Plexswift/internal/models/AddPlaylistContentsRequest+Serialization.swift
- Sources/Plexswift/internal/models/AllLibraries+Serialization.swift
- Sources/Plexswift/internal/models/AllowCameraUpload+Serialization.swift
- Sources/Plexswift/internal/models/AllowChannels+Serialization.swift
- Sources/Plexswift/internal/models/AllowSubtitleAdmin+Serialization.swift
- Sources/Plexswift/internal/models/AllowSync+Serialization.swift
- Sources/Plexswift/internal/models/AllowTuners+Serialization.swift
- Sources/Plexswift/internal/models/ApplyUpdatesRequest+Serialization.swift
- Sources/Plexswift/internal/models/AutoSelectSubtitle+Serialization.swift
- Sources/Plexswift/internal/models/CancelServerActivitiesRequest+Serialization.swift
@@ -125,8 +132,10 @@ generatedFiles:
- Sources/Plexswift/internal/models/GetTopWatchedContentRequest+Serialization.swift
- Sources/Plexswift/internal/models/GetTransientTokenQueryParamType+Serialization.swift
- Sources/Plexswift/internal/models/GetTransientTokenRequest+Serialization.swift
- Sources/Plexswift/internal/models/GetUsersRequest+Serialization.swift
- Sources/Plexswift/internal/models/GetWatchListRequest+Serialization.swift
- Sources/Plexswift/internal/models/HasThumbnail+Serialization.swift
- Sources/Plexswift/internal/models/Home+Serialization.swift
- Sources/Plexswift/internal/models/IncludeCollections+Serialization.swift
- Sources/Plexswift/internal/models/IncludeDetails+Serialization.swift
- Sources/Plexswift/internal/models/IncludeExternalMedia+Serialization.swift
@@ -146,7 +155,9 @@ generatedFiles:
- Sources/Plexswift/internal/models/MinSize+Serialization.swift
- Sources/Plexswift/internal/models/OnlyTransient+Serialization.swift
- Sources/Plexswift/internal/models/OptimizedForStreaming+Serialization.swift
- Sources/Plexswift/internal/models/Owned+Serialization.swift
- Sources/Plexswift/internal/models/PathParamTaskName+Serialization.swift
- Sources/Plexswift/internal/models/Pending+Serialization.swift
- Sources/Plexswift/internal/models/PerformSearchRequest+Serialization.swift
- Sources/Plexswift/internal/models/PerformVoiceSearchRequest+Serialization.swift
- Sources/Plexswift/internal/models/PlaylistType+Serialization.swift
@@ -162,6 +173,7 @@ generatedFiles:
- Sources/Plexswift/internal/models/PostUsersSignInDataState+Serialization.swift
- Sources/Plexswift/internal/models/PostUsersSignInDataStatus+Serialization.swift
- Sources/Plexswift/internal/models/PostUsersSignInDataWatchedIndicator+Serialization.swift
- Sources/Plexswift/internal/models/Protected+Serialization.swift
- Sources/Plexswift/internal/models/Protocol+Serialization.swift
- Sources/Plexswift/internal/models/QueryParamFilter+Serialization.swift
- Sources/Plexswift/internal/models/QueryParamForce+Serialization.swift
@@ -171,6 +183,7 @@ generatedFiles:
- Sources/Plexswift/internal/models/QueryParamOnlyTransient+Serialization.swift
- Sources/Plexswift/internal/models/QueryParamSmart+Serialization.swift
- Sources/Plexswift/internal/models/QueryParamType+Serialization.swift
- Sources/Plexswift/internal/models/Restricted+Serialization.swift
- Sources/Plexswift/internal/models/Scope+Serialization.swift
- Sources/Plexswift/internal/models/SearchTypes+Serialization.swift
- Sources/Plexswift/internal/models/Security+Serialization.swift
@@ -209,6 +222,12 @@ generatedFiles:
- Sources/Plexswift/models/operations/AddPlaylistContentsResponse.swift
- Sources/Plexswift/models/operations/AddPlaylistContentsResponseBody.swift
- Sources/Plexswift/models/operations/AddPlaylistContentsUnauthorized.swift
- Sources/Plexswift/models/operations/AllLibraries.swift
- Sources/Plexswift/models/operations/AllowCameraUpload.swift
- Sources/Plexswift/models/operations/AllowChannels.swift
- Sources/Plexswift/models/operations/AllowSubtitleAdmin.swift
- Sources/Plexswift/models/operations/AllowSync.swift
- Sources/Plexswift/models/operations/AllowTuners.swift
- Sources/Plexswift/models/operations/ApplyUpdatesBadRequest.swift
- Sources/Plexswift/models/operations/ApplyUpdatesErrors.swift
- Sources/Plexswift/models/operations/ApplyUpdatesRequest.swift
@@ -786,6 +805,7 @@ generatedFiles:
- Sources/Plexswift/models/operations/GetTopWatchedContentResponseBody.swift
- Sources/Plexswift/models/operations/GetTopWatchedContentRole.swift
- Sources/Plexswift/models/operations/GetTopWatchedContentUnauthorized.swift
- Sources/Plexswift/models/operations/GetTopWatchedContentUser.swift
- Sources/Plexswift/models/operations/GetTranscodeSessionsBadRequest.swift
- Sources/Plexswift/models/operations/GetTranscodeSessionsErrors.swift
- Sources/Plexswift/models/operations/GetTranscodeSessionsMediaContainer.swift
@@ -812,6 +832,15 @@ generatedFiles:
- Sources/Plexswift/models/operations/GetUserFriendsPlexErrors.swift
- Sources/Plexswift/models/operations/GetUserFriendsResponse.swift
- Sources/Plexswift/models/operations/GetUserFriendsUnauthorized.swift
- Sources/Plexswift/models/operations/GetUsersBadRequest.swift
- Sources/Plexswift/models/operations/GetUsersErrors.swift
- Sources/Plexswift/models/operations/GetUsersMediaContainer.swift
- Sources/Plexswift/models/operations/GetUsersRequest.swift
- Sources/Plexswift/models/operations/GetUsersResponse.swift
- Sources/Plexswift/models/operations/GetUsersResponseBody.swift
- Sources/Plexswift/models/operations/GetUsersServer.swift
- Sources/Plexswift/models/operations/GetUsersUnauthorized.swift
- Sources/Plexswift/models/operations/GetUsersUsersErrors.swift
- Sources/Plexswift/models/operations/GetWatchListBadRequest.swift
- Sources/Plexswift/models/operations/GetWatchListErrors.swift
- Sources/Plexswift/models/operations/GetWatchListRequest.swift
@@ -821,6 +850,7 @@ generatedFiles:
- Sources/Plexswift/models/operations/GetWatchListWatchlistErrors.swift
- Sources/Plexswift/models/operations/Guids.swift
- Sources/Plexswift/models/operations/HasThumbnail.swift
- Sources/Plexswift/models/operations/Home.swift
- Sources/Plexswift/models/operations/Hub.swift
- Sources/Plexswift/models/operations/Image.swift
- Sources/Plexswift/models/operations/IncludeCollections.swift
@@ -872,9 +902,11 @@ generatedFiles:
- Sources/Plexswift/models/operations/OnlyTransient.swift
- Sources/Plexswift/models/operations/Operator.swift
- Sources/Plexswift/models/operations/OptimizedForStreaming.swift
- Sources/Plexswift/models/operations/Owned.swift
- Sources/Plexswift/models/operations/Part.swift
- Sources/Plexswift/models/operations/PastSubscription.swift
- Sources/Plexswift/models/operations/PathParamTaskName.swift
- Sources/Plexswift/models/operations/Pending.swift
- Sources/Plexswift/models/operations/PerformSearchBadRequest.swift
- Sources/Plexswift/models/operations/PerformSearchErrors.swift
- Sources/Plexswift/models/operations/PerformSearchRequest.swift
@@ -914,6 +946,7 @@ generatedFiles:
- Sources/Plexswift/models/operations/PostUsersSignInDataUserProfile.swift
- Sources/Plexswift/models/operations/PostUsersSignInDataWatchedIndicator.swift
- Sources/Plexswift/models/operations/Producer.swift
- Sources/Plexswift/models/operations/Protected.swift
- Sources/Plexswift/models/operations/Protocol.swift
- Sources/Plexswift/models/operations/Provider.swift
- Sources/Plexswift/models/operations/QueryParamFilter.swift
@@ -927,6 +960,7 @@ generatedFiles:
- Sources/Plexswift/models/operations/Ratings.swift
- Sources/Plexswift/models/operations/Release.swift
- Sources/Plexswift/models/operations/ResponseBody.swift
- Sources/Plexswift/models/operations/Restricted.swift
- Sources/Plexswift/models/operations/Role.swift
- Sources/Plexswift/models/operations/Scope.swift
- Sources/Plexswift/models/operations/SearchResult.swift
@@ -2041,5 +2075,29 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]}
get-users:
"":
parameters:
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
X-Plex-Product: "Plex for Roku"
X-Plex-Device: "Roku 3"
X-Plex-Device-Name: "Chrome"
X-Plex-Device-Screen-Resolution: "1487x1165,2560x1440"
X-Plex-Version: "2.4.1"
X-Plex-Platform: "Roku"
X-Plex-Features: "external-media,indirect-media,hub-style-list"
X-Plex-Model: "4200X"
X-Plex-Session-Id: "97e136ef-4ddd-4ff3-89a7-a5820c96c2ca"
X-Plex-Language: "en"
X-Plex-Platform-Version: "4.3 build 1057"
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
responses:
"200":
application/xml: "0xa9CdebeF9E"
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]}
examplesVersion: 1.0.0
generatedTests: {}

View File

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

View File

@@ -9,8 +9,8 @@ sources:
- main
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10
sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55
sourceRevisionDigest: sha256:e6ab335dd91a4165f4510e4a3af8a55819c6310b7e66251266d2384376f3ccae
sourceBlobDigest: sha256:89d1b1133e400c89f0d06efe5e5168f5ba25a413e1ab8380d442d6b233e2e5a9
tags:
- latest
- main
@@ -18,10 +18,10 @@ targets:
plexswift:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10
sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55
sourceRevisionDigest: sha256:e6ab335dd91a4165f4510e4a3af8a55819c6310b7e66251266d2384376f3ccae
sourceBlobDigest: sha256:89d1b1133e400c89f0d06efe5e5168f5ba25a413e1ab8380d442d6b233e2e5a9
codeSamplesNamespace: code-samples-swift-plexswift
codeSamplesRevisionDigest: sha256:a5941e7dd8124eb7deca3b089dbb00bdd37dfacb849675cd1acd0888538742d0
codeSamplesRevisionDigest: sha256:64579b8fbcfab80b7f0ffc43044c9ef8b89629cef77e28e9a3c4a75294c57ad7
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest

View File

@@ -62,7 +62,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.9.9"))
.package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.9.11"))
]
```
<!-- End SDK Installation [installation] -->
@@ -222,6 +222,10 @@ case .empty:
* [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
* [applyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates
### [Users](docs/sdks/users/README.md)
* [getUsers](docs/sdks/users/README.md#getusers) - Get list of all connected users
### [Video](docs/sdks/video/README.md)
* [getTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item

View File

@@ -823,3 +823,13 @@ Based on:
- [swift v0.9.9] .
### Releases
- [Swift Package Manager v0.9.9] https://github.com/LukeHagar/plexswift/releases/tag/v0.9.9 - .
## 2025-02-07 00:08:01
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.405.6 (2.428.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [swift v0.9.11] .
### Releases
- [Swift Package Manager v0.9.11] https://github.com/LukeHagar/plexswift/releases/tag/v0.9.11 - .

View File

@@ -79,6 +79,7 @@ import FoundationNetworking
/// - ``statistics``
/// - ``sessions``
/// - ``updater``
/// - ``users``
///
public final class Client {
internal struct APIResponse {

View File

@@ -92,6 +92,7 @@ case .empty:
- ``StatisticsAPI``
- ``SessionsAPI``
- ``UpdaterAPI``
- ``UsersAPI``
### Server configuration
- ``PlexServers/GetCompanionsData``
@@ -103,6 +104,7 @@ case .empty:
- ``WatchlistServers/GetWatchList``
- ``AuthenticationServers/GetTokenDetails``
- ``AuthenticationServers/PostUsersSignInData``
- ``UsersServers/GetUsers``
### Shared models
@@ -130,6 +132,7 @@ case .empty:
- ``Operations/GetSearchLibraryBadRequest``
- ``Operations/GetServerResourcesBadRequest``
- ``Operations/GetThumbImageBadRequest``
- ``Operations/GetUsersBadRequest``
- ``Operations/GetWatchListBadRequest``
- ``Operations/GetAvailableClientsBadRequest``
- ``Operations/GetBandwidthStatisticsBadRequest``
@@ -210,6 +213,7 @@ case .empty:
- ``Operations/GetServerIdentityResponse``
- ``Operations/GetServerResourcesResponse``
- ``Operations/GetThumbImageResponse``
- ``Operations/GetUsersResponse``
- ``Operations/GetWatchListResponse``
- ``Operations/GetAvailableClientsResponse``
- ``Operations/GetBandwidthStatisticsResponse``
@@ -276,6 +280,12 @@ case .empty:
- ``Operations/AddPlaylistContentsRequest``
- ``Operations/AddPlaylistContentsResponseBody``
- ``Operations/AddPlaylistContentsUnauthorized``
- ``Operations/AllLibraries``
- ``Operations/AllowCameraUpload``
- ``Operations/AllowChannels``
- ``Operations/AllowSubtitleAdmin``
- ``Operations/AllowSync``
- ``Operations/AllowTuners``
- ``Operations/ApplyUpdatesErrors``
- ``Operations/ApplyUpdatesRequest``
- ``Operations/ApplyUpdatesUnauthorized``
@@ -529,6 +539,13 @@ case .empty:
- ``Operations/GetThumbImageMediaErrors``
- ``Operations/GetThumbImageRequest``
- ``Operations/GetThumbImageUnauthorized``
- ``Operations/GetUsersErrors``
- ``Operations/GetUsersMediaContainer``
- ``Operations/GetUsersRequest``
- ``Operations/GetUsersResponseBody``
- ``Operations/GetUsersServer``
- ``Operations/GetUsersUnauthorized``
- ``Operations/GetUsersUsersErrors``
- ``Operations/GetWatchListErrors``
- ``Operations/GetWatchListRequest``
- ``Operations/GetWatchListResponseBody``
@@ -748,6 +765,7 @@ case .empty:
- ``Operations/GetTopWatchedContentResponseBody``
- ``Operations/GetTopWatchedContentRole``
- ``Operations/GetTopWatchedContentUnauthorized``
- ``Operations/GetTopWatchedContentUser``
- ``Operations/GetTranscodeSessionsErrors``
- ``Operations/GetTranscodeSessionsMediaContainer``
- ``Operations/GetTranscodeSessionsResponseBody``
@@ -768,6 +786,7 @@ case .empty:
- ``Operations/GetUserFriendsUnauthorized``
- ``Operations/Guids``
- ``Operations/HasThumbnail``
- ``Operations/Home``
- ``Operations/Hub``
- ``Operations/Image``
- ``Operations/IncludeCollections``
@@ -811,9 +830,11 @@ case .empty:
- ``Operations/OnlyTransient``
- ``Operations/Operator``
- ``Operations/OptimizedForStreaming``
- ``Operations/Owned``
- ``Operations/Part``
- ``Operations/PastSubscription``
- ``Operations/PathParamTaskName``
- ``Operations/Pending``
- ``Operations/PerformSearchErrors``
- ``Operations/PerformSearchRequest``
- ``Operations/PerformSearchSearchErrors``
@@ -847,6 +868,7 @@ case .empty:
- ``Operations/PostUsersSignInDataUserProfile``
- ``Operations/PostUsersSignInDataWatchedIndicator``
- ``Operations/Producer``
- ``Operations/Protected``
- ``Operations/`Protocol```
- ``Operations/Provider``
- ``Operations/QueryParamFilter``
@@ -860,6 +882,7 @@ case .empty:
- ``Operations/Ratings``
- ``Operations/Release``
- ``Operations/ResponseBody``
- ``Operations/Restricted``
- ``Operations/Role``
- ``Operations/Scope``
- ``Operations/SearchResult``

View File

@@ -0,0 +1,63 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
class _UsersAPI: UsersAPI {
private let client: Client
init(client: Client) {
self.client = client
}
public func getUsers(request: Operations.GetUsersRequest, server: UsersServers.GetUsers?) async throws -> Response<Operations.GetUsersResponse> {
return try await client.makeRequest(
with: try server?.server() ?? UsersServers.GetUsers.default(),
configureRequest: { configuration in
try configureGetUsersRequest(with: configuration, request: request)
},
handleResponse: handleGetUsersResponse
)
}
}
// MARK: - Request Configuration
private func configureGetUsersRequest(with configuration: URLRequestConfiguration, request: Operations.GetUsersRequest) throws {
configuration.path = "/users"
configuration.method = .get
configuration.headerParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
// MARK: - Response Handlers
private func handleGetUsersResponse(response: Client.APIResponse) throws -> Operations.GetUsersResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/xml"), let data = response.data {
return .body(data)
}
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetUsersBadRequest.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 401 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .unauthorized(try JSONDecoder().decode(Operations.GetUsersUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.AllLibraries: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.AllowCameraUpload: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.AllowChannels: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.AllowSubtitleAdmin: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.AllowSync: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.AllowTuners: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -0,0 +1,35 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetUsersRequest: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
switch format {
case .header:
return serializeModel(with: try serializedHeaderParameters(), format: format)
case .path, .query, .multipart, .form:
throw SerializationError.invalidSerializationParameter(type: "Operations.GetUsersRequest", format: format.formatDescription)
}
}
}
extension Operations.GetUsersRequest: HeaderParameterSerializable {
func serializedHeaderParameters() throws -> [SerializedParameter] {
return [
SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try clientID.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Token", serialized: try xPlexToken.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Features", serialized: try clientFeatures?.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Product", serialized: try clientName?.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Version", serialized: try clientVersion?.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Device-Name", serialized: try deviceName?.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Device", serialized: try deviceNickname?.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Device-Screen-Resolution", serialized: try deviceScreenResolution?.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Model", serialized: try model?.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Platform", serialized: try platform?.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Platform-Version", serialized: try platformVersion?.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Language", serialized: try xPlexLanguage?.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Session-Id", serialized: try xPlexSessionId?.serialize(with: .header(explode: false)))
]
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.Home: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.Owned: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.Pending: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.Protected: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.Restricted: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the user has access to all libraries.
public enum AllLibraries: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the user is allowed to upload from a camera.
public enum AllowCameraUpload: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the user has access to channels.
public enum AllowChannels: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the user can manage subtitles.
public enum AllowSubtitleAdmin: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the user is allowed to sync media.
public enum AllowSync: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the user is allowed to use tuners.
public enum AllowTuners: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -36,14 +36,14 @@ extension Operations {
public let title: String?
public let type: String?
public let updatedAt: Int?
public let user: [Operations.User]?
public let user: [Operations.GetTopWatchedContentUser]?
public let viewedLeafCount: Int?
public let year: Int?
/// Creates an object with the specified parameters
///
///
public init(addedAt: Int? = nil, art: String? = nil, audienceRating: Double? = nil, audienceRatingImage: String? = nil, childCount: Int? = nil, contentRating: String? = nil, country: [Operations.GetTopWatchedContentCountry]? = nil, duration: Int? = nil, genre: [Operations.GetTopWatchedContentGenre]? = nil, globalViewCount: Int? = nil, guid: String? = nil, guids: [Operations.GetTopWatchedContentGuids]? = nil, index: Int? = nil, key: String? = nil, leafCount: Int? = nil, librarySectionID: Int? = nil, librarySectionKey: String? = nil, librarySectionTitle: String? = nil, originallyAvailableAt: Date? = nil, ratingKey: String? = nil, role: [Operations.GetTopWatchedContentRole]? = nil, slug: String? = nil, studio: String? = nil, summary: String? = nil, tagline: String? = nil, thumb: String? = nil, title: String? = nil, type: String? = nil, updatedAt: Int? = nil, user: [Operations.User]? = nil, viewedLeafCount: Int? = nil, year: Int? = nil) {
public init(addedAt: Int? = nil, art: String? = nil, audienceRating: Double? = nil, audienceRatingImage: String? = nil, childCount: Int? = nil, contentRating: String? = nil, country: [Operations.GetTopWatchedContentCountry]? = nil, duration: Int? = nil, genre: [Operations.GetTopWatchedContentGenre]? = nil, globalViewCount: Int? = nil, guid: String? = nil, guids: [Operations.GetTopWatchedContentGuids]? = nil, index: Int? = nil, key: String? = nil, leafCount: Int? = nil, librarySectionID: Int? = nil, librarySectionKey: String? = nil, librarySectionTitle: String? = nil, originallyAvailableAt: Date? = nil, ratingKey: String? = nil, role: [Operations.GetTopWatchedContentRole]? = nil, slug: String? = nil, studio: String? = nil, summary: String? = nil, tagline: String? = nil, thumb: String? = nil, title: String? = nil, type: String? = nil, updatedAt: Int? = nil, user: [Operations.GetTopWatchedContentUser]? = nil, viewedLeafCount: Int? = nil, year: Int? = nil) {
self.addedAt = addedAt
self.art = art
self._audienceRating = DecimalSerialized<Double?>(wrappedValue: audienceRating)
@@ -146,7 +146,7 @@ extension Operations.GetTopWatchedContentMetadata: Codable {
self.title = try container.decodeIfPresent(String.self, forKey: .title)
self.type = try container.decodeIfPresent(String.self, forKey: .type)
self.updatedAt = try container.decodeIfPresent(Int.self, forKey: .updatedAt)
self.user = try container.decodeIfPresent([Operations.User].self, forKey: .user)
self.user = try container.decodeIfPresent([Operations.GetTopWatchedContentUser].self, forKey: .user)
self.viewedLeafCount = try container.decodeIfPresent(Int.self, forKey: .viewedLeafCount)
self.year = try container.decodeIfPresent(Int.self, forKey: .year)
}

View File

@@ -0,0 +1,23 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetTopWatchedContentUser {
public let id: Int?
/// Creates an object with the specified parameters
///
///
public init(id: Int? = nil) {
self.id = id
}
}}
extension Operations.GetTopWatchedContentUser: Codable {
enum CodingKeys: String, CodingKey {
case id
}
}

View File

@@ -0,0 +1,23 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Bad Request - A parameter was not specified, or was specified incorrectly.
public struct GetUsersBadRequest {
public let errors: [Operations.GetUsersErrors]?
/// Creates a request model with the specified parameters
///
///
public init(errors: [Operations.GetUsersErrors]? = nil) {
self.errors = errors
}
}}
extension Operations.GetUsersBadRequest: Codable {
enum CodingKeys: String, CodingKey {
case errors
}
}

View File

@@ -0,0 +1,29 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetUsersErrors {
public let code: Int?
public let message: String?
public let status: Int?
/// Creates an object with the specified parameters
///
///
public init(code: Int? = nil, message: String? = nil, status: Int? = nil) {
self.code = code
self.message = message
self.status = status
}
}}
extension Operations.GetUsersErrors: Codable {
enum CodingKeys: String, CodingKey {
case code
case message
case status
}
}

View File

@@ -0,0 +1,36 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Container holding user and server details.
public struct GetUsersMediaContainer {
/// The friendly name of the Plex instance.
public let friendlyName: String
public let identifier: String
/// Unique Machine identifier of the Plex server.
public let machineIdentifier: String
/// Number of users in the current response.
public let size: Int
/// Total number of users.
public let totalSize: Int
/// List of users with access to the Plex server.
public let user: [Operations.User]
/// Creates an object with the specified parameters
///
/// - Parameter friendlyName: The friendly name of the Plex instance.
/// - Parameter machineIdentifier: Unique Machine identifier of the Plex server.
/// - Parameter size: Number of users in the current response.
/// - Parameter totalSize: Total number of users.
/// - Parameter user: List of users with access to the Plex server.
///
public init(friendlyName: String, identifier: String, machineIdentifier: String, size: Int, totalSize: Int, user: [Operations.User]) {
self.friendlyName = friendlyName
self.identifier = identifier
self.machineIdentifier = machineIdentifier
self.size = size
self.totalSize = totalSize
self.user = user
}
}}

View File

@@ -0,0 +1,66 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetUsersRequest: APIValue {
/// An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
public let clientID: String
/// An authentication token, obtained from plex.tv
public let xPlexToken: String
/// The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list)
public let clientFeatures: String?
/// The name of the client application. (Plex Web, Plex Media Server, etc.)
public let clientName: String?
/// The version of the client application.
public let clientVersion: String?
/// The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.)
public let deviceName: String?
/// A relatively friendly name for the client device
public let deviceNickname: String?
/// The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440)
public let deviceScreenResolution: String?
/// A potentially less friendly identifier for the device model
public let model: String?
/// The platform of the client application.
public let platform: String?
/// The version of the platform
public let platformVersion: String?
/// The language of the client application.
public let xPlexLanguage: String?
/// The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca)
public let xPlexSessionId: String?
/// Creates an object with the specified parameters
///
/// - Parameter clientID: An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
/// - Parameter xPlexToken: An authentication token, obtained from plex.tv
/// - Parameter clientFeatures: The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list)
/// - Parameter clientName: The name of the client application. (Plex Web, Plex Media Server, etc.)
/// - Parameter clientVersion: The version of the client application.
/// - Parameter deviceName: The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.)
/// - Parameter deviceNickname: A relatively friendly name for the client device
/// - Parameter deviceScreenResolution: The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440)
/// - Parameter model: A potentially less friendly identifier for the device model
/// - Parameter platform: The platform of the client application.
/// - Parameter platformVersion: The version of the platform
/// - Parameter xPlexLanguage: The language of the client application.
/// - Parameter xPlexSessionId: The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca)
///
public init(clientID: String, xPlexToken: String, clientFeatures: String? = nil, clientName: String? = nil, clientVersion: String? = nil, deviceName: String? = nil, deviceNickname: String? = nil, deviceScreenResolution: String? = nil, model: String? = nil, platform: String? = nil, platformVersion: String? = nil, xPlexLanguage: String? = nil, xPlexSessionId: String? = nil) {
self.clientID = clientID
self.xPlexToken = xPlexToken
self.clientFeatures = clientFeatures
self.clientName = clientName
self.clientVersion = clientVersion
self.deviceName = deviceName
self.deviceNickname = deviceNickname
self.deviceScreenResolution = deviceScreenResolution
self.model = model
self.platform = platform
self.platformVersion = platformVersion
self.xPlexLanguage = xPlexLanguage
self.xPlexSessionId = xPlexSessionId
}
}}

View File

@@ -0,0 +1,41 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A response model
public enum GetUsersResponse {
case empty
case badRequest(Operations.GetUsersBadRequest)
case body(Data)
case unauthorized(Operations.GetUsersUnauthorized)
var isEmpty: Bool {
if case .empty = self {
return true
} else {
return false
}
}
public func badRequest() throws -> Operations.GetUsersBadRequest {
guard case .badRequest(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value
}
public func body() throws -> Data {
guard case .body(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value
}
public func unauthorized() throws -> Operations.GetUsersUnauthorized {
guard case .unauthorized(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value
}
}}

View File

@@ -0,0 +1,18 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Successful response with media container data in XML
public struct GetUsersResponseBody {
/// Container holding user and server details.
public let mediaContainer: Operations.GetUsersMediaContainer?
/// Creates an object with the specified parameters
///
/// - Parameter mediaContainer: Container holding user and server details.
///
public init(mediaContainer: Operations.GetUsersMediaContainer? = nil) {
self.mediaContainer = mediaContainer
}
}}

View File

@@ -0,0 +1,42 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetUsersServer {
public let allLibraries: Operations.AllLibraries
/// Unique ID of the server of the connected user
public let id: Int
public let lastSeenAt: Int
/// Machine identifier of the Plex server.
public let machineIdentifier: String
/// Name of the Plex server of the connected user.
public let name: String
/// Number of libraries in the server this user has access to.
public let numLibraries: Int
public let owned: Operations.Owned
public let pending: Operations.Pending
/// ID of the actual Plex server.
public let serverId: Int
/// Creates an object with the specified parameters
///
/// - Parameter id: Unique ID of the server of the connected user
/// - Parameter machineIdentifier: Machine identifier of the Plex server.
/// - Parameter name: Name of the Plex server of the connected user.
/// - Parameter numLibraries: Number of libraries in the server this user has access to.
/// - Parameter serverId: ID of the actual Plex server.
///
public init(allLibraries: Operations.AllLibraries, id: Int, lastSeenAt: Int, machineIdentifier: String, name: String, numLibraries: Int, owned: Operations.Owned, pending: Operations.Pending, serverId: Int) {
self.allLibraries = allLibraries
self.id = id
self.lastSeenAt = lastSeenAt
self.machineIdentifier = machineIdentifier
self.name = name
self.numLibraries = numLibraries
self.owned = owned
self.pending = pending
self.serverId = serverId
}
}}

View File

@@ -0,0 +1,23 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
public struct GetUsersUnauthorized {
public let errors: [Operations.GetUsersUsersErrors]?
/// Creates an object with the specified parameters
///
///
public init(errors: [Operations.GetUsersUsersErrors]? = nil) {
self.errors = errors
}
}}
extension Operations.GetUsersUnauthorized: Codable {
enum CodingKeys: String, CodingKey {
case errors
}
}

View File

@@ -0,0 +1,29 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetUsersUsersErrors {
public let code: Int?
public let message: String?
public let status: Int?
/// Creates an object with the specified parameters
///
///
public init(code: Int? = nil, message: String? = nil, status: Int? = nil) {
self.code = code
self.message = message
self.status = status
}
}}
extension Operations.GetUsersUsersErrors: Codable {
enum CodingKeys: String, CodingKey {
case code
case message
case status
}
}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the user is part of a home group.
public enum Home: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the user owns the server.
public enum Owned: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the server is pending approval.
public enum Pending: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates whether the account is protected.
public enum Protected: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the user has restricted access.
public enum Restricted: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -5,19 +5,74 @@ import Foundation
extension Operations {
/// A model object
public struct User {
public let id: Int?
public let allowCameraUpload: Operations.AllowCameraUpload
public let allowChannels: Operations.AllowChannels
public let allowSubtitleAdmin: Operations.AllowSubtitleAdmin
public let allowSync: Operations.AllowSync
public let allowTuners: Operations.AllowTuners
/// User's email address.
public let email: String
public let home: Operations.Home
/// User's unique ID.
public let id: Int
public let protected: Operations.Protected
public let restricted: Operations.Restricted
/// List of servers owned by the user.
public let server: [Operations.GetUsersServer]
/// URL to the user's avatar image.
public let thumb: String
/// User's display name.
public let title: String
/// User's username.
public let username: String
/// Filters applied for all content.
public let filterAll: String?
/// Filters applied for movies.
public let filterMovies: String?
/// Filters applied for music.
public let filterMusic: String?
/// Filters applied for photos.
public let filterPhotos: String?
/// Filters applied for television.
public let filterTelevision: String?
/// ID of the user's recommendation playlist.
public let recommendationsPlaylistId: String?
/// Creates an object with the specified parameters
///
/// - Parameter email: User's email address.
/// - Parameter id: User's unique ID.
/// - Parameter server: List of servers owned by the user.
/// - Parameter thumb: URL to the user's avatar image.
/// - Parameter title: User's display name.
/// - Parameter username: User's username.
/// - Parameter filterAll: Filters applied for all content.
/// - Parameter filterMovies: Filters applied for movies.
/// - Parameter filterMusic: Filters applied for music.
/// - Parameter filterPhotos: Filters applied for photos.
/// - Parameter filterTelevision: Filters applied for television.
/// - Parameter recommendationsPlaylistId: ID of the user's recommendation playlist.
///
public init(id: Int? = nil) {
public init(allowCameraUpload: Operations.AllowCameraUpload, allowChannels: Operations.AllowChannels, allowSubtitleAdmin: Operations.AllowSubtitleAdmin, allowSync: Operations.AllowSync, allowTuners: Operations.AllowTuners, email: String, home: Operations.Home, id: Int, protected: Operations.Protected, restricted: Operations.Restricted, server: [Operations.GetUsersServer], thumb: String, title: String, username: String, filterAll: String? = nil, filterMovies: String? = nil, filterMusic: String? = nil, filterPhotos: String? = nil, filterTelevision: String? = nil, recommendationsPlaylistId: String? = nil) {
self.allowCameraUpload = allowCameraUpload
self.allowChannels = allowChannels
self.allowSubtitleAdmin = allowSubtitleAdmin
self.allowSync = allowSync
self.allowTuners = allowTuners
self.email = email
self.home = home
self.id = id
self.protected = protected
self.restricted = restricted
self.server = server
self.thumb = thumb
self.title = title
self.username = username
self.filterAll = filterAll
self.filterMovies = filterMovies
self.filterMusic = filterMusic
self.filterPhotos = filterPhotos
self.filterTelevision = filterTelevision
self.recommendationsPlaylistId = recommendationsPlaylistId
}
}}
extension Operations.User: Codable {
enum CodingKeys: String, CodingKey {
case id
}
}

View File

@@ -33,6 +33,7 @@ import Foundation
/// - ``statistics``
/// - ``sessions``
/// - ``updater``
/// - ``users``
///
public protocol PlexswiftAPI {
@@ -95,6 +96,7 @@ public protocol PlexswiftAPI {
/// Updates to the status can be observed via the Event API.
///
var updater: UpdaterAPI { get }
var users: UsersAPI { get }
}
// MARK: - ServerAPI
@@ -1397,3 +1399,57 @@ public protocol UpdaterAPI {
/// - Throws: An error of type ``PlexswiftError``
func applyUpdates(request: Operations.ApplyUpdatesRequest) async throws -> Response<Operations.ApplyUpdatesResponse>
}
// MARK: - UsersAPI
public enum UsersServers {
/// Describes the available servers that can be used when making 'get-users' requests.
///
/// Use this type when making calls to ``UsersAPI/getUsers(request:server:)`` to customize the server which is used.
public enum GetUsers: Servers, ServerConvertible {
/// Supported server value.
///
/// Corresponds to `https://plex.tv/api`
case server1
/// Defines the raw URL strings for each server option.
///
/// > Note: You do not need to use these values directly.
///
/// The available URL strings are defined as:
/// ```swift
/// public static let urlStrings = [
/// "https://plex.tv/api"
/// ]
/// ```
public static let urlStrings = [
"https://plex.tv/api"
]
static func `default`() throws -> Server {
return try UsersServers.GetUsers.server1.server()
}
func server() throws -> Server {
switch self {
case .server1:
return try type(of: self).server(at: 0, substituting: nil)
}
}
}
}
/// ## Topics
///
/// ### API calls
///
/// - ``getUsers(request:server:)``
///
public protocol UsersAPI {
/// Get list of all users that are friends and have library access with the provided Plex authentication token
///
/// - Parameter request: A ``Operations/GetUsersRequest`` object describing the input to the API operation
/// - Parameter server: An optional server override to use for this operation
/// - Returns: A ``Operations/GetUsersResponse`` object describing the result of the API operation
/// - Throws: An error of type ``PlexswiftError``
func getUsers(request: Operations.GetUsersRequest, server: UsersServers.GetUsers?) async throws -> Response<Operations.GetUsersResponse>
}

View File

@@ -70,6 +70,10 @@ extension Client: PlexswiftAPI {
public var updater: UpdaterAPI {
return _UpdaterAPI(client: self)
}
public var users: UsersAPI {
return _UsersAPI(client: self)
}
}
// MARK: - Request Configuration

View File

@@ -62,7 +62,7 @@ final class URLRequestBuilder: URLRequestConfiguration {
urlRequest.setValue(contentType, forHTTPHeaderField: "Content-Type")
}
urlRequest.setValue("speakeasy-sdk/swift 0.9.9 2.428.1 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName)
urlRequest.setValue("speakeasy-sdk/swift 0.9.11 2.428.1 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName)
addSecurityParameters(to: &urlRequest)

View File

@@ -1440,6 +1440,12 @@ actions:
// Handle empty response
break
}
- target: $["paths"]["/users"]["get"]
update:
x-codeSamples:
- lang: swift
label: users
source: "import Foundation\nimport Plexswift\n\nlet client = Client()\n\nlet response = try await client.users.getUsers(\n request: Operations.GetUsersRequest(\n clientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\", \n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\", \n clientFeatures: \"external-media,indirect-media,hub-style-list\", \n clientName: \"Plex for Roku\", \n clientVersion: \"2.4.1\", \n deviceName: \"Chrome\", \n deviceNickname: \"Roku 3\", \n deviceScreenResolution: \"1487x1165,2560x1440\", \n model: \"4200X\", \n platform: \"Roku\", \n platformVersion: \"4.3 build 1057\", \n xPlexLanguage: \"en\", \n xPlexSessionId: \"97e136ef-4ddd-4ff3-89a7-a5820c96c2ca\"\n )\n)\n\nswitch response.data {\ncase .body(let body):\n // Handle response\n break\ncase .badRequest(let badRequest):\n // Handle response\n break\ncase .unauthorized(let unauthorized):\n // Handle response\n break\ncase .empty:\n // Handle empty response\n break\n}"
- target: $["paths"]["/users/signin"]["post"]
update:
x-codeSamples: