mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 04:20:52 +00:00
migrated to v15
This commit is contained in:
23
USAGE.md
Normal file
23
USAGE.md
Normal file
@@ -0,0 +1,23 @@
|
||||
<!-- Start SDK Example Usage [usage] -->
|
||||
```swift
|
||||
import Foundation
|
||||
import Plexswift
|
||||
|
||||
let client = Client(security: .accessToken("<YOUR_API_KEY_HERE>"))
|
||||
|
||||
let response = try await client.server.getServerCapabilities()
|
||||
|
||||
switch response.data {
|
||||
case .twoHundredApplicationJsonObject(let twoHundredApplicationJsonObject):
|
||||
// Handle response
|
||||
break
|
||||
case .fourHundredAndOneApplicationJsonObject(let fourHundredAndOneApplicationJsonObject):
|
||||
// Handle response
|
||||
break
|
||||
case .empty:
|
||||
// Handle empty response
|
||||
break
|
||||
}
|
||||
|
||||
```
|
||||
<!-- End SDK Example Usage [usage] -->
|
||||
Reference in New Issue
Block a user