diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 8befdfc..a240777 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: 5d77204e-e413-4fd0-a14a-bad3aee2247a management: docChecksum: a91eaf9ec1e6a3a6f4bf0571f5b18bae docVersion: 0.0.3 - speakeasyVersion: 1.228.1 - generationVersion: 2.292.0 - releaseVersion: 0.1.0 - configChecksum: b2cfa34ed4663bdec9d08c57f8e59960 + speakeasyVersion: 1.246.1 + generationVersion: 2.302.1 + releaseVersion: 0.1.1 + configChecksum: 37c5f191d3f2f642a81bb7a339bc3034 repoURL: https://github.com/LukeHagar/plexswift.git features: swift: @@ -15,7 +15,7 @@ features: globalServerURLs: 2.82.1 globals: 2.81.3 methodServerURLs: 3.0.1 - nameOverrides: 2.81.1 + nameOverrides: 2.81.2 generatedFiles: - Sources/Plexswift/internal/api/_ServerAPI.swift - Sources/Plexswift/internal/api/_MediaAPI.swift diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 85dc82d..ce560d5 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true swift: - version: 0.1.0 + version: 0.1.1 author: LukeHagar description: Swift Client SDK Generated by Speakeasy imports: diff --git a/Makefile b/Makefile deleted file mode 100644 index ef1f1ee..0000000 --- a/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -.PHONY: * - -all: speakeasy - - -speakeasy: check-speakeasy - speakeasy generate sdk --lang swift -o . -s ./openapi.yaml - -speakeasy-validate: check-speakeasy - speakeasy validate openapi -s ./openapi.yaml - -openapi: - curl https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml > ./openapi.yaml - -# This will replace the generation source in your workflow file with your local schema path -generate-from-local: - @if ! which sed >/dev/null; then \ - echo "sed is not installed. Please install it using the following command:"; \ - echo "For Ubuntu/Debian: apt-get install sed"; \ - echo "For macOS: sed is pre-installed"; \ - exit 1; \ - fi - @sed -i '' '/openapi_docs: |/{n;s|-.*|- ./openapi.yaml|;}' ./.github/workflows/speakeasy_sdk_generation.yml - -check-speakeasy: - @command -v speakeasy >/dev/null 2>&1 || { echo >&2 "speakeasy CLI is not installed. Please install before continuing."; exit 1; } diff --git a/README.md b/README.md index 7be4411..d2428f8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ - + ![Platform](https://img.shields.io/badge/Platform-iOS-lightgray) ![Swift Version](https://img.shields.io/badge/Swift-5.6-orange.svg) @@ -13,16 +13,8 @@ An Open API Spec for interacting with Plex.tv and Plex Servers The SDK supports iOS 13 and later. - -## 🏗 **Welcome to your new SDK!** 🏗 - -It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps: -- [ ] 🛠 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks) -- [ ] ♻️ Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy) -- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/productionize-sdks/publish-sdks) -- [ ] ✨ When ready to productionize, delete this section from the README - + ## SDK Installation ### Swift Package Manager @@ -31,12 +23,14 @@ 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.1.0")) + .package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.1.1")) ] ``` + + ## SDK Example Usage ### Example @@ -62,24 +56,26 @@ case .empty: } ``` + -## Available Resources and Operations +## Available Resources and Operations + ## Authentication ### Global Security Schemes The SDK supports the following security scheme globally through the `Shared.Security` type: -| Name | Type | Scheme | -| -------------- | -------------- | -------------- | -| `.accessToken` | apiKey | API key | +| Name | Type | Scheme | +| -------------- | ------ | ------- | +| `.accessToken` | apiKey | API key | You can set the appropriate security parameters by passing a `Shared.Security` value for the `security` parameter when initializing the `Client` instance. For example: @@ -104,27 +100,28 @@ case .empty: } ``` + + ## 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 `""` 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 +| 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 @@ -136,7 +133,7 @@ let client = Client() let response = try await client.plex.getPin( request: Operations.GetPinRequest( - strong: false, + strong: false, ) ) @@ -153,6 +150,7 @@ case .empty: } ``` + diff --git a/Sources/Plexswift/internal/client/URLRequestBuilder.swift b/Sources/Plexswift/internal/client/URLRequestBuilder.swift index 3630b92..9909993 100644 --- a/Sources/Plexswift/internal/client/URLRequestBuilder.swift +++ b/Sources/Plexswift/internal/client/URLRequestBuilder.swift @@ -62,7 +62,7 @@ final class URLRequestBuilder: URLRequestConfiguration { urlRequest.setValue(contentType, forHTTPHeaderField: "Content-Type") } - urlRequest.setValue("speakeasy-sdk/swift 0.0.1 2.281.2 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)