diff --git a/Examples/swift-demo-wallet/README.md b/Examples/swift-demo-wallet/README.md index 62595e08..1b641e67 100644 --- a/Examples/swift-demo-wallet/README.md +++ b/Examples/swift-demo-wallet/README.md @@ -1,39 +1,58 @@ -# Swift Demo Wallet +# Swift Demo Wallet -The Swift Demo Wallet is a sample iOS/macOS application that demonstrates how to build a simple wallet experience using Turnkey infrastructure. It showcases session handling, wallet creation/import, and transaction signing in a native SwiftUI application. +A minimal iOS/macOS application demonstrating how to build an embedded wallet experience using Turnkey infrastructure and Auth Proxy. ---- +## What this demo shows -## Quick Start +A high-level summary of the user experience and what you can see on screen: -### 1. Clone the Repository +- **Authentication**: Log in with passkeys, OTP (email/SMS), or OAuth (Google, Apple, Discord, X) +- **Session Management**: Automatic session handling with secure key storage in Secure Enclave +- **Wallet Operations**: Create, import, and export wallets with mnemonic phrases +- **Message Signing**: Sign messages and raw payloads with wallet accounts +- **User Management**: Update email/phone and view wallet details -``` +## Getting started + +### 1/ Cloning the example + +Make sure you have Xcode 15+ installed. + +```bash git clone https://github.com/tkhq/swift-sdk -cd Examples/swift-demo-wallet +cd swift-sdk/Examples/swift-demo-wallet ``` -### 2. Open the Project +### 2/ Setting up Turnkey -Open the `Examples/swift-demo-wallet` folder and build the project in Xcode. +1. Set up your Turnkey organization and account. You'll need your **parent organization ID**. +2. Enable **Auth Proxy** from your Turnkey dashboard: + - Choose the user auth methods (Email OTP, SMS OTP, OAuth providers) + - Configure redirect URLs for OAuth (if using) + - Copy your **Auth Proxy Config ID** for the next step +3. (Optional) For passkey authentication, set up your **RP ID** domain with associated domains -### 3. Configure Constants +### 3/ Configure Constants -Edit `Helpers/Constants.swift` and fill in the required values: +Edit `swift-demo-wallet/Helpers/Constants.swift` and add your values: ```swift enum Constants { enum App { static let appName = "Swift Demo Wallet App" - static let rpId = "" // e.g. passkeyapp.tkhqlabs.xyz - static let backendBaseUrl = "" // e.g. http://localhost:3000 + static let rpId = "" // required for passkeys } enum Turnkey { static let organizationId = "" - static let sessionDuration = "900" // session duration in seconds static let apiUrl = "https://api.turnkey.com" + + // Auth Proxy Configuration + static let authProxyUrl = "https://auth.turnkey.com" + static let authProxyConfigId = "" + // Default accounts to create when using the "Create Wallet" button + // Customize this array to create wallets with different curves, paths, or address formats static let defaultEthereumAccounts: [Components.Schemas.WalletAccountParams] = [ Components.Schemas.WalletAccountParams( curve: .CURVE_SECP256K1, @@ -51,65 +70,16 @@ enum Constants { } ``` ---- - -## Backend Setup - -### Why Do We Need a Backend? - -Turnkey requires authentication requests (sign-up/login) to be validated (stamped) using your root user API key-pair. Since this key-pair must remain private, it cannot be used directly in the frontend. Instead, authentication requests must be processed and stamped through a backend server before being forwarded to Turnkey. - -### 1. Configure Environment Variables - -Create a `.env` file inside the `example-server` folder: - -``` -PORT="3000" - -TURNKEY_API_URL="https://api.turnkey.com" -TURNKEY_ORGANIZATION_ID="" - -TURNKEY_API_PUBLIC_KEY="" -TURNKEY_API_PRIVATE_KEY="" -``` - -### 2. Start the Server +### 4/ Running the demo -``` -cd example-server -npm install -npm run start -``` - ---- - -## Passkey Setup - -To enable passkey authentication, you must configure your domain and app settings correctly: - -### Associated Domains - -1. In your app's `Signing & Capabilities` tab, add the `Associated Domains` capability. -2. Add your domain: - -``` -webcredentials: -``` - -3. Host an `apple-app-site-association` file at `https:///.well-known/apple-app-site-association` - -4. Ensure your `rpId` in Constants.swift matches the domain: - -```swift -static let rpId = "" -``` +Open `swift-demo-wallet.xcodeproj` in Xcode and run the app on your device or simulator. --- ## Requirements -- iOS 17+ / macOS 13.0+ -- Swift 5.7+ +- iOS 17+ / macOS 14.0+ +- Swift 5.9+ - Xcode 15+ --- diff --git a/Examples/swift-demo-wallet/example-server/.env.example b/Examples/swift-demo-wallet/example-server/.env.example deleted file mode 100644 index f2b78401..00000000 --- a/Examples/swift-demo-wallet/example-server/.env.example +++ /dev/null @@ -1,7 +0,0 @@ -PORT="3000" - -TURNKEY_API_URL="https://api.turnkey.com" -TURNKEY_ORGANIZATION_ID="" - -TURNKEY_API_PUBLIC_KEY="" -TURNKEY_API_PRIVATE_KEY="" \ No newline at end of file diff --git a/Examples/swift-demo-wallet/example-server/index.ts b/Examples/swift-demo-wallet/example-server/index.ts deleted file mode 100644 index 40e2a5b4..00000000 --- a/Examples/swift-demo-wallet/example-server/index.ts +++ /dev/null @@ -1,48 +0,0 @@ -import express, { Request, Response } from "express"; -import cors from "cors"; -import dotenv from "dotenv"; -import bodyParser from "body-parser"; -import { - sendOtp, - verifyOtp, - createSubOrg, - oAuth, -} from "./src/handler.js"; - -dotenv.config(); - -const app = express(); -const PORT = process.env.PORT || 3000; - -// Middleware -app.use(cors()); -app.use(bodyParser.json()); - -async function handleRequest( - req: Request, - res: Response, - handler: (req: Request) => Promise, -) { - try { - const result = await handler(req); - res.json(result); - } catch (error: any) { - console.error("Server error:", error.message); - res.status(500).json({ error: error.message } as any); - } -} - -app.post("/auth/createSubOrg", (req, res) => - handleRequest(req, res, createSubOrg), -); - -app.post("/auth/sendOtp", (req, res) => - handleRequest(req, res, sendOtp), -); -app.post("/auth/verifyOtp", (req, res) => handleRequest(req, res, verifyOtp)); - -app.post("/auth/oAuth", (req, res) => handleRequest(req, res, oAuth)); - -app.listen(PORT, () => - console.log(`✅ Server running on http://localhost:${PORT}`), -); diff --git a/Examples/swift-demo-wallet/example-server/package-lock.json b/Examples/swift-demo-wallet/example-server/package-lock.json deleted file mode 100644 index 0c76407f..00000000 --- a/Examples/swift-demo-wallet/example-server/package-lock.json +++ /dev/null @@ -1,2002 +0,0 @@ -{ - "name": "example-server", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "example-server", - "dependencies": { - "@turnkey/sdk-server": "^4.0.0", - "cors": "^2.8.5", - "dotenv": "^16.4.7", - "express": "^4.21.2", - "jsonwebtoken": "^9.0.2" - }, - "devDependencies": { - "@types/body-parser": "^1.19.5", - "@types/cors": "^2.8.17", - "@types/express": "^5.0.0", - "@types/jsonwebtoken": "^9.0.9", - "nodemon": "^3.1.9", - "ts-node": "^10.9.2", - "typescript": "^5.7.3" - } - }, - "node_modules/@adraffy/ens-normalize": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.0.tgz", - "integrity": "sha512-/3DDPKHqqIqxUULp8yP4zODUY1i+2xvVWsv8A79xGWdCAG+8sb0hRh0Rk2QyOJUnnbyPUAZYcpBuRe3nS2OIUg==", - "optional": true - }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "node_modules/@noble/ciphers": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.5.3.tgz", - "integrity": "sha512-B0+6IIHiqEs3BPMT0hcRmHvEj2QHOLu+uwt+tqDDeVd0oyVzh7BPrDcPjRnV1PV/5LaknXJJQvOuRGR0zQJz+w==", - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/curves": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", - "integrity": "sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==", - "dependencies": { - "@noble/hashes": "1.7.1" - }, - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.1.tgz", - "integrity": "sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==", - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/base": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.4.tgz", - "integrity": "sha512-5Yy9czTO47mqz+/J8GM6GIId4umdCk1wc1q8rKERQulIoc8VP9pzDcghv10Tl2E7R96ZUx/PhND3ESYUQX8NuQ==", - "optional": true, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip32": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.2.tgz", - "integrity": "sha512-t96EPDMbtGgtb7onKKqxRLfE5g05k7uHnHRM2xdE6BP/ZmxaLtPek4J4KfVn/90IQNrU1IOAqMgiDtUdtbe3nw==", - "optional": true, - "dependencies": { - "@noble/curves": "~1.8.1", - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip39": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.4.tgz", - "integrity": "sha512-TFM4ni0vKvCfBpohoh+/lY05i9gRbSwXWngAsF4CABQxoaOHijxuaZ2R6cStDQ5CHtHO9aGJTr4ksVJASRRyMA==", - "optional": true, - "dependencies": { - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.4" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@tsconfig/node10": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", - "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", - "dev": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true - }, - "node_modules/@turnkey/api-key-stamper": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/@turnkey/api-key-stamper/-/api-key-stamper-0.4.5.tgz", - "integrity": "sha512-8UeYt/2WtMrK2uSFzjiRXdCVc9SmKlMVuA4f1Z+SlxcsW0wlEpNM/7bd8N4VVVAjoE8Yy50Vhk3ylfQFtlaKsQ==", - "license": "Apache-2.0", - "dependencies": { - "@noble/curves": "^1.3.0", - "@turnkey/encoding": "0.4.0", - "sha256-uint8array": "^0.10.7" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@turnkey/crypto": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@turnkey/crypto/-/crypto-2.3.1.tgz", - "integrity": "sha512-fHKCw0inuThEKIpZnC8pvz16egZHf08wES0LdSkM9XrGDcI7p0eqF7nAHgfAMW/0qNVZD8AKW+g/5O97HBwZ4w==", - "dependencies": { - "@noble/ciphers": "0.5.3", - "@noble/curves": "1.4.0", - "@noble/hashes": "1.4.0", - "@turnkey/encoding": "0.4.0", - "bs58": "^5.0.0", - "bs58check": "3.0.1" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@turnkey/crypto/node_modules/@noble/curves": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", - "integrity": "sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==", - "dependencies": { - "@noble/hashes": "1.4.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@turnkey/crypto/node_modules/@noble/hashes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", - "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@turnkey/encoding": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@turnkey/encoding/-/encoding-0.4.0.tgz", - "integrity": "sha512-ptLgcpWVt34KTPx0omF2QLJrosW6I//clCJ4G2+yngYFCzrdR0yBchV/BOcfME67mK1v3MmauyXl9AAnQTmB4Q==", - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@turnkey/http": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@turnkey/http/-/http-3.4.0.tgz", - "integrity": "sha512-7sXPlOlF3YVqLFoBm2YyaO5d0aQXpfsij2BgtOHfhLmPkMWm5yMz2T7UlI3lf67SftwweOQ+5/ZkD9oJwi95tg==", - "license": "Apache-2.0", - "dependencies": { - "@turnkey/api-key-stamper": "0.4.5", - "@turnkey/encoding": "0.4.0", - "@turnkey/webauthn-stamper": "0.5.0", - "cross-fetch": "^3.1.5" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@turnkey/sdk-server": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@turnkey/sdk-server/-/sdk-server-4.0.0.tgz", - "integrity": "sha512-vZaMvkz+OGJ2Rj2L617Ad47u1NONVwYkSFXDmVZDdhqLFkLe2y/kVZ950RgoEmp0ejWSfd12sHlbG7/ChG4zfw==", - "license": "Apache-2.0", - "dependencies": { - "@turnkey/api-key-stamper": "0.4.5", - "@turnkey/http": "3.4.0", - "@turnkey/wallet-stamper": "1.0.3", - "buffer": "^6.0.3", - "cross-fetch": "^3.1.5" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@turnkey/wallet-stamper": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@turnkey/wallet-stamper/-/wallet-stamper-1.0.3.tgz", - "integrity": "sha512-8DMuVPo/u8oIzQ9Snsa24ZQO3nXVMfpd8VnlPLfZiW2jjZHPFyBGCJOYSArfp+W2xoudpYVu//JElBAVxk/u/g==", - "dependencies": { - "@turnkey/crypto": "2.3.1", - "@turnkey/encoding": "0.4.0" - }, - "optionalDependencies": { - "viem": "^2.21.35" - } - }, - "node_modules/@turnkey/webauthn-stamper": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@turnkey/webauthn-stamper/-/webauthn-stamper-0.5.0.tgz", - "integrity": "sha512-iUbTUwD4f4ibdLy5PWWb7ITEz4S4VAP9/mNjFhoRY3cKVVTDfmykrVTKjPOIHWzDgAmLtgrLvySIIC9ZBVENBw==", - "license": "Apache-2.0", - "dependencies": { - "sha256-uint8array": "^0.10.7" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@types/body-parser": { - "version": "1.19.5", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", - "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", - "dev": true, - "dependencies": { - "@types/connect": "*", - "@types/node": "*" - } - }, - "node_modules/@types/connect": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", - "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/cors": { - "version": "2.8.17", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", - "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/express": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.1.tgz", - "integrity": "sha512-UZUw8vjpWFXuDnjFTh7/5c2TWDlQqeXHi6hcN7F2XSVT5P+WmUnnbFS3KA6Jnc6IsEqI2qCVu2bK0R0J4A8ZQQ==", - "dev": true, - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^5.0.0", - "@types/serve-static": "*" - } - }, - "node_modules/@types/express-serve-static-core": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz", - "integrity": "sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==", - "dev": true, - "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*", - "@types/send": "*" - } - }, - "node_modules/@types/http-errors": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", - "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", - "dev": true - }, - "node_modules/@types/jsonwebtoken": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.9.tgz", - "integrity": "sha512-uoe+GxEuHbvy12OUQct2X9JenKM3qAscquYymuQN4fMWG9DBQtykrQEFcAbVACF7qaLw9BePSodUL0kquqBJpQ==", - "dev": true, - "dependencies": { - "@types/ms": "*", - "@types/node": "*" - } - }, - "node_modules/@types/mime": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", - "dev": true - }, - "node_modules/@types/ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", - "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", - "dev": true - }, - "node_modules/@types/node": { - "version": "22.13.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.17.tgz", - "integrity": "sha512-nAJuQXoyPj04uLgu+obZcSmsfOenUg6DxPKogeUy6yNCFwWaj5sBF8/G/pNo8EtBJjAfSVgfIlugR/BCOleO+g==", - "dev": true, - "dependencies": { - "undici-types": "~6.20.0" - } - }, - "node_modules/@types/qs": { - "version": "6.9.18", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz", - "integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==", - "dev": true - }, - "node_modules/@types/range-parser": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", - "dev": true - }, - "node_modules/@types/send": { - "version": "0.17.4", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", - "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", - "dev": true, - "dependencies": { - "@types/mime": "^1", - "@types/node": "*" - } - }, - "node_modules/@types/serve-static": { - "version": "1.15.7", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", - "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", - "dev": true, - "dependencies": { - "@types/http-errors": "*", - "@types/node": "*", - "@types/send": "*" - } - }, - "node_modules/abitype": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.8.tgz", - "integrity": "sha512-ZeiI6h3GnW06uYDLx0etQtX/p8E24UaHHBj57RSjK7YBFe7iuVn07EDpOeP451D06sF27VOz9JJPlIKJmXgkEg==", - "optional": true, - "funding": { - "url": "https://github.com/sponsors/wevm" - }, - "peerDependencies": { - "typescript": ">=5.0.4", - "zod": "^3 >=3.22.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - }, - "zod": { - "optional": true - } - } - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/acorn": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", - "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", - "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", - "dev": true, - "dependencies": { - "acorn": "^8.11.0" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/base-x": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.1.tgz", - "integrity": "sha512-uAZ8x6r6S3aUM9rbHGVOIsR15U/ZSc82b3ymnCPsT45Gk1DDvhDPdIgB5MrhirZWt+5K0EEPQH985kNqZgNPFw==" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/bs58": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", - "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", - "dependencies": { - "base-x": "^4.0.0" - } - }, - "node_modules/bs58check": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-3.0.1.tgz", - "integrity": "sha512-hjuuJvoWEybo7Hn/0xOrczQKKEKD63WguEjlhLExYs2wUBcebDC1jDNK17eEAD2lYfw82d5ASC1d7K3SWszjaQ==", - "dependencies": { - "@noble/hashes": "^1.2.0", - "bs58": "^5.0.0" - } - }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dev": true, - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/cross-fetch": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.2.0.tgz", - "integrity": "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==", - "license": "MIT", - "dependencies": { - "node-fetch": "^2.7.0" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/dotenv": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", - "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "optional": true - }, - "node_modules/express": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", - "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.12", - "proxy-addr": "~2.0.7", - "qs": "6.13.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/finalhandler": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", - "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", - "dev": true - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/isows": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.6.tgz", - "integrity": "sha512-lPHCayd40oW98/I0uvgaHKWCSvkzY27LjWLbtzOm64yQ+G3Q5npjjbdppU65iZXkK1Zt+kH9pfegli0AYfwYYw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/wevm" - } - ], - "optional": true, - "peerDependencies": { - "ws": "*" - } - }, - "node_modules/jsonwebtoken": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", - "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", - "dependencies": { - "jws": "^3.2.2", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", - "ms": "^2.1.1", - "semver": "^7.5.4" - }, - "engines": { - "node": ">=12", - "npm": ">=6" - } - }, - "node_modules/jsonwebtoken/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" - }, - "node_modules/lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" - }, - "node_modules/lodash.isinteger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" - }, - "node_modules/lodash.isnumber": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" - }, - "node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" - }, - "node_modules/lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" - }, - "node_modules/lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" - }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/nodemon": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.9.tgz", - "integrity": "sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg==", - "dev": true, - "dependencies": { - "chokidar": "^3.5.2", - "debug": "^4", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.1.2", - "pstree.remy": "^1.1.8", - "semver": "^7.5.3", - "simple-update-notifier": "^2.0.0", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5" - }, - "bin": { - "nodemon": "bin/nodemon.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nodemon" - } - }, - "node_modules/nodemon/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/nodemon/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ox": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/ox/-/ox-0.6.9.tgz", - "integrity": "sha512-wi5ShvzE4eOcTwQVsIPdFr+8ycyX+5le/96iAJutaZAvCes1J0+RvpEPg5QDPDiaR0XQQAvZVl7AwqQcINuUug==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/wevm" - } - ], - "optional": true, - "dependencies": { - "@adraffy/ens-normalize": "^1.10.1", - "@noble/curves": "^1.6.0", - "@noble/hashes": "^1.5.0", - "@scure/bip32": "^1.5.0", - "@scure/bip39": "^1.4.0", - "abitype": "^1.0.6", - "eventemitter3": "5.0.1" - }, - "peerDependencies": { - "typescript": ">=5.4.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", - "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/pstree.remy": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", - "dev": true - }, - "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "dependencies": { - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.19.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/sha256-uint8array": { - "version": "0.10.7", - "resolved": "https://registry.npmjs.org/sha256-uint8array/-/sha256-uint8array-0.10.7.tgz", - "integrity": "sha512-1Q6JQU4tX9NqsDGodej6pkrUVQVNapLZnvkwIhddH/JqzBZF1fSaxSWNY6sziXBE8aEa2twtGkXUrwzGeZCMpQ==", - "license": "MIT" - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/simple-update-notifier": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", - "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", - "dev": true, - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/touch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", - "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", - "dev": true, - "bin": { - "nodetouch": "bin/nodetouch.js" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" - }, - "node_modules/ts-node": { - "version": "10.9.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", - "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/typescript": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", - "devOptional": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undefsafe": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", - "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", - "dev": true - }, - "node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "dev": true - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/viem": { - "version": "2.24.3", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.24.3.tgz", - "integrity": "sha512-FAoW0hqqpGOlZvfL6GbizDNUd6ZvUyNYYF8HouXbGATrO0RLLh28MOElFNF63hg++uZi2R/EcISs0bvY185z8g==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/wevm" - } - ], - "optional": true, - "dependencies": { - "@noble/curves": "1.8.1", - "@noble/hashes": "1.7.1", - "@scure/bip32": "1.6.2", - "@scure/bip39": "1.5.4", - "abitype": "1.0.8", - "isows": "1.0.6", - "ox": "0.6.9", - "ws": "8.18.1" - }, - "peerDependencies": { - "typescript": ">=5.0.4" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/ws": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", - "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", - "optional": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "engines": { - "node": ">=6" - } - } - } -} diff --git a/Examples/swift-demo-wallet/example-server/package.json b/Examples/swift-demo-wallet/example-server/package.json deleted file mode 100644 index cfde9280..00000000 --- a/Examples/swift-demo-wallet/example-server/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "module", - "name": "example-server", - "scripts": { - "start": "node --loader ts-node/esm index.ts" - }, - "dependencies": { - "@turnkey/sdk-server": "^4.0.0", - "cors": "^2.8.5", - "dotenv": "^16.4.7", - "express": "^4.21.2", - "jsonwebtoken": "^9.0.2" - }, - "devDependencies": { - "@types/body-parser": "^1.19.5", - "@types/cors": "^2.8.17", - "@types/express": "^5.0.0", - "@types/jsonwebtoken": "^9.0.9", - "nodemon": "^3.1.9", - "ts-node": "^10.9.2", - "typescript": "^5.7.3" - } -} diff --git a/Examples/swift-demo-wallet/example-server/src/handler.ts b/Examples/swift-demo-wallet/example-server/src/handler.ts deleted file mode 100644 index 0356e7b2..00000000 --- a/Examples/swift-demo-wallet/example-server/src/handler.ts +++ /dev/null @@ -1,177 +0,0 @@ -import { Request } from "express"; -import dotenv from "dotenv"; -import { DEFAULT_ETHEREUM_ACCOUNTS, Turnkey } from "@turnkey/sdk-server"; -import { decodeJwt } from "./util.js"; -import { - CreateSubOrgParams, - CreateSubOrgResponse, - SendOtpParams, - OtpType, - FilterType, - VerifyOtpResponse, - VerifyOtpParams, - SendOtpResponse, - OAuthParams, - OAuthResponse, -} from "./types.js"; - -dotenv.config(); - -export const turnkeyConfig = { - apiBaseUrl: process.env.TURNKEY_API_URL ?? "", - defaultOrganizationId: process.env.TURNKEY_ORGANIZATION_ID ?? "", - apiPublicKey: process.env.TURNKEY_API_PUBLIC_KEY ?? "", - apiPrivateKey: process.env.TURNKEY_API_PRIVATE_KEY ?? "", -}; - -const turnkey = new Turnkey(turnkeyConfig).apiClient(); - -export async function sendOtp( - req: Request<{}, {}, SendOtpParams> -): Promise { - const { otpType, contact, userIdentifier } = req.body; - - const sendOtpResponse = await turnkey.initOtp({ - otpType: otpType, - contact: contact, - smsCustomization: { template: "Your Turnkey Demo OTP is {{.OtpCode}}" }, - otpLength: 6, - userIdentifier, - }); - - return { - otpId: sendOtpResponse.otpId, - }; -} - -export async function verifyOtp( - req: Request<{}, {}, VerifyOtpParams> -): Promise { - const { otpId, otpCode, otpType, contact, publicKey, expirationSeconds } = - req.body; - - const verifyResponse = await turnkey.verifyOtp({ - otpId, - otpCode, - expirationSeconds, - }); - - let organizationId = turnkeyConfig.defaultOrganizationId; - - const { organizationIds } = await turnkey.getSubOrgIds({ - filterType: - otpType === OtpType.Email ? FilterType.Email : FilterType.PhoneNumber, - filterValue: contact, - }); - - if (organizationIds.length > 0) { - organizationId = organizationIds[0]; - } else { - const createSubOrgParams = - otpType === OtpType.Email ? { email: contact } : { phone: contact }; - - const subOrgResponse = await createSubOrg({ - body: createSubOrgParams, - } as Request); - organizationId = subOrgResponse.subOrganizationId; - } - - const sessionResponse = await turnkey.otpLogin({ - organizationId, - verificationToken: verifyResponse!.verificationToken, - publicKey, - expirationSeconds, - }); - - return { token: sessionResponse.session }; -} - -export async function createSubOrg( - req: Request<{}, {}, CreateSubOrgParams> -): Promise { - const { email, phone, passkey, oauth, apiKeys } = req.body; - - const authenticators = passkey - ? [ - { - authenticatorName: "Passkey", - challenge: passkey.challenge, - attestation: passkey.attestation, - }, - ] - : []; - - const oauthProviders = oauth - ? [ - { - providerName: oauth.providerName, - oidcToken: oauth.oidcToken, - }, - ] - : []; - - let userEmail = email; - const userPhoneNumber = phone; - - const subOrganizationName = `Sub Org - ${new Date().toISOString()}`; - - const result = await turnkey.createSubOrganization({ - organizationId: turnkeyConfig.defaultOrganizationId, - subOrganizationName, - rootUsers: [ - { - userName: "User", - userEmail, - userPhoneNumber, - authenticators, - oauthProviders: oauthProviders, - apiKeys: apiKeys ?? [], - }, - ], - rootQuorumThreshold: 1, - wallet: { - walletName: "Default Wallet", - accounts: DEFAULT_ETHEREUM_ACCOUNTS, - }, - }); - - return { subOrganizationId: result.subOrganizationId }; -} - -export async function oAuth( - req: Request<{}, {}, OAuthParams> -): Promise { - const { publicKey, providerName, oidcToken, expirationSeconds } = req.body; - - let organizationId = turnkeyConfig.defaultOrganizationId; - - const { organizationIds } = await turnkey.getSubOrgIds({ - filterType: "OIDC_TOKEN", - filterValue: oidcToken, - }); - - if (organizationIds.length > 0) { - organizationId = organizationIds[0]; - } else { - const createSubOrgParams = { - oauth: { - providerName, - oidcToken, - }, - }; - - const subOrgResponse = await createSubOrg({ - body: createSubOrgParams, - } as Request); - organizationId = subOrgResponse.subOrganizationId; - } - - const sessionResponse = await turnkey.oauthLogin({ - publicKey, - organizationId, - oidcToken, - expirationSeconds, - }); - - return { token: sessionResponse.session }; -} diff --git a/Examples/swift-demo-wallet/example-server/src/types.ts b/Examples/swift-demo-wallet/example-server/src/types.ts deleted file mode 100644 index ae2c7638..00000000 --- a/Examples/swift-demo-wallet/example-server/src/types.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { type TurnkeyApiTypes } from "@turnkey/sdk-server"; - -export enum OtpType { - Email = "OTP_TYPE_EMAIL", - Sms = "OTP_TYPE_SMS", -} - -export enum FilterType { - Email = "EMAIL", - PhoneNumber = "PHONE_NUMBER", -} - -export type SendOtpParams = { - otpType: "OTP_TYPE_EMAIL" | "OTP_TYPE_SMS"; - contact: string; - userIdentifier: string; -}; - -export type SendOtpResponse = { - otpId: string; -}; - -export type CreateSubOrgParams = { - email: string; - phone?: string; - passkey?: { - name?: string; - challenge: string; - attestation: Attestation; - }; - oauth?: { - providerName: string; - oidcToken: string; - }; - apiKeys?: { - apiKeyName: string; - publicKey: string; - curveType: ApiKeyCurveType; - expirationSeconds?: string; - }[]; -}; - -export type CreateSubOrgResponse = { - subOrganizationId: string; -}; - -export type VerifyOtpParams = { - otpId: string; - otpCode: string; - otpType: OtpType; - contact: string; - publicKey: string; - expirationSeconds: string; -}; - -export type VerifyOtpResponse = { - token?: string; -}; - -export type OAuthParams = { - publicKey: string; - providerName: string; - oidcToken: string; - expirationSeconds: string; -}; - -export type OAuthResponse = { - token: string; -} - -export type Attestation = TurnkeyApiTypes["v1Attestation"]; -export type ApiKeyCurveType = TurnkeyApiTypes["v1ApiKeyCurve"]; diff --git a/Examples/swift-demo-wallet/example-server/src/util.ts b/Examples/swift-demo-wallet/example-server/src/util.ts deleted file mode 100644 index e19c6422..00000000 --- a/Examples/swift-demo-wallet/example-server/src/util.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { decode, JwtPayload } from "jsonwebtoken"; - -export const decodeJwt = (credential: string): JwtPayload | null => { - const decoded = decode(credential); - - if (decoded && typeof decoded === "object" && "email" in decoded) { - return decoded as JwtPayload; - } - - return null; -}; diff --git a/Examples/swift-demo-wallet/example-server/tsconfig.json b/Examples/swift-demo-wallet/example-server/tsconfig.json deleted file mode 100644 index 8347ae81..00000000 --- a/Examples/swift-demo-wallet/example-server/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "moduleResolution": "NodeNext", - "esModuleInterop": true, - "resolveJsonModule": true, - "strict": true - } -} diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/AppView.swift b/Examples/swift-demo-wallet/swift-demo-wallet/AppView.swift index e5aa902e..f435f5dd 100644 --- a/Examples/swift-demo-wallet/swift-demo-wallet/AppView.swift +++ b/Examples/swift-demo-wallet/swift-demo-wallet/AppView.swift @@ -2,7 +2,7 @@ import SwiftUI import TurnkeySwift enum AuthRoute: Hashable { - case otp(otpId: String, contact: String, publicKey: String) + case otp(otpId: String, contact: String, otpType: OtpType) } enum MainRoute: Hashable { @@ -13,14 +13,22 @@ enum MainRoute: Hashable { struct AuthFlow: View { @StateObject private var nav = NavigationCoordinator() + @EnvironmentObject private var turnkey: TurnkeyContext var body: some View { NavigationStack(path: $nav.path) { AuthView() .navigationDestination(for: AuthRoute.self) { route in switch route { - case let .otp(id, contact, publicKey): - OtpView(otpId: id, contact: contact, publicKey: publicKey) + case let .otp(id, contact, otpType): + OtpView(otpId: id, contact: contact, otpType: otpType) { otpCode in + try await turnkey.completeOtp( + otpId: id, + otpCode: otpCode, + contact: contact, + otpType: otpType + ) + } } } } diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/Contents.json b/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/Contents.json index 73c00596..74d6a722 100644 --- a/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/Contents.json +++ b/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/discord-icon.imageset/Contents.json b/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/discord-icon.imageset/Contents.json new file mode 100644 index 00000000..b9f97b8e --- /dev/null +++ b/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/discord-icon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images": [ + { + "filename": "discord-icon.png", + "idiom": "universal", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/discord-icon.imageset/discord-icon.png b/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/discord-icon.imageset/discord-icon.png new file mode 100644 index 00000000..c49cc20a Binary files /dev/null and b/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/discord-icon.imageset/discord-icon.png differ diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/x-icon.imageset/Contents.json b/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/x-icon.imageset/Contents.json new file mode 100644 index 00000000..263b7f49 --- /dev/null +++ b/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/x-icon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images": [ + { + "filename": "x-icon.png", + "idiom": "universal", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/x-icon.imageset/x-icon.png b/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/x-icon.imageset/x-icon.png new file mode 100644 index 00000000..2c2d7e86 Binary files /dev/null and b/Examples/swift-demo-wallet/swift-demo-wallet/Assets.xcassets/x-icon.imageset/x-icon.png differ diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Contexts/AuthContext.swift b/Examples/swift-demo-wallet/swift-demo-wallet/Contexts/AuthContext.swift deleted file mode 100644 index f6db65f6..00000000 --- a/Examples/swift-demo-wallet/swift-demo-wallet/Contexts/AuthContext.swift +++ /dev/null @@ -1,308 +0,0 @@ -import Foundation -import AuthenticationServices -import Combine -import TurnkeyPasskeys -import TurnkeyHttp -import TurnkeyCrypto -import TurnkeySwift - -enum AuthError: Error { - case passkeysNotSupported - case invalidURL - case serverError - case missingSubOrgId - case missingSession -} - -@MainActor -final class AuthContext: ObservableObject { - - // ui observable state - @Published var isLoading = false - @Published var error: String? - - // private refs - private let turnkey: TurnkeyContext - private let backendURL = URL(string: Constants.App.backendBaseUrl)! - - init(turnkey: TurnkeyContext = .shared) { - self.turnkey = turnkey - } - - enum OtpType: String, Codable { - case email = "OTP_TYPE_EMAIL" - case sms = "OTP_TYPE_SMS" - } - - struct CreateSubOrgRequest: Codable { - var passkey: PasskeyRegistrationResult? - var apiKeys: [ApiKeyPayload]? - var oAuthProviders: [OAuthProvider]? - - struct ApiKeyPayload: Codable { - var apiKeyName: String - var publicKey: String - var curveType: Components.Schemas.ApiKeyCurve - var expirationSeconds: String? - } - - struct OAuthProvider: Codable { - let providerName: String - let oidcToken: String - } - - } - - struct CreateSubOrgResponse: Codable { - let subOrganizationId: String - } - - struct SendOtpRequest: Codable { - let otpType: OtpType - let contact: String - let userIdentifier: String - } - - struct SendOtpResponse: Codable { - let otpId: String - } - - struct VerifyOtpRequest: Codable { - let otpId: String - let otpCode: String - let otpType: OtpType - let contact: String - let publicKey: String - let expirationSeconds: String - } - - struct VerifyOtpResponse: Codable { - let token: String - } - - struct OAuthLoginRequest: Codable { - let publicKey: String - let providerName: String - let oidcToken: String - let expirationSeconds: String - } - - struct OAuthLoginResponse: Codable { - let token: String - } - - func sendOtp(contact: String, type: OtpType) async throws -> (otpId: String, publicKey: String) { - startLoading() - defer { stopLoading() } - - let publicKey = try turnkey.createKeyPair() - - let body = SendOtpRequest( - otpType: type, - contact: contact, - userIdentifier: publicKey - ) - - var request = URLRequest(url: backendURL.appendingPathComponent("/auth/sendOtp")) - request.httpMethod = "POST" - request.setValue("application/json", forHTTPHeaderField: "Content-Type") - request.httpBody = try JSONEncoder().encode(body) - - let (data, response) = try await URLSession.shared.data(for: request) - guard (response as? HTTPURLResponse)?.statusCode == 200 else { - throw AuthError.serverError - } - - let result = try JSONDecoder().decode(SendOtpResponse.self, from: data) - return (otpId: result.otpId, publicKey: publicKey) - } - - func verifyOtp( - otpId: String, - otpCode: String, - filterType: OtpType, - contact: String, - publicKey: String - ) async throws { - startLoading() - defer { stopLoading() } - - let body = VerifyOtpRequest( - otpId: otpId, - otpCode: otpCode, - otpType: filterType, - contact: contact, - publicKey: publicKey, - expirationSeconds: Constants.Turnkey.sessionDuration - ) - - var request = URLRequest(url: backendURL.appendingPathComponent("/auth/verifyOtp")) - request.httpMethod = "POST" - request.setValue("application/json", forHTTPHeaderField: "Content-Type") - request.httpBody = try JSONEncoder().encode(body) - - let (data, response) = try await URLSession.shared.data(for: request) - guard (response as? HTTPURLResponse)?.statusCode == 200 else { - throw AuthError.serverError - } - - let result = try JSONDecoder().decode(VerifyOtpResponse.self, from: data) - try await turnkey.createSession(jwt: result.token, refreshedSessionTTLSeconds: Constants.Turnkey.sessionDuration) - } - - func signUpWithPasskey(anchor: ASPresentationAnchor) async throws { - guard isPasskeySupported else { throw AuthError.passkeysNotSupported } - startLoading() - defer { stopLoading() } - - let registration = try await createPasskey( - user: PasskeyUser(id: UUID().uuidString, name: "Anonymous User", displayName: "Anonymous User"), - rp: RelyingParty(id: Constants.App.rpId, name: Constants.App.appName), - presentationAnchor: anchor - ) - - // for one-tap passkey sign-up, we generate a temporary API key pair - // which is added as an authentication method for the new sub-org user - // this allows us to stamp the session creation request immediately after - // without prompting the user - let (_, publicKeyCompressed, privateKey) = TurnkeyCrypto.generateP256KeyPair() - - let apiKey = CreateSubOrgRequest.ApiKeyPayload( - apiKeyName: "Tempoarary API Key", - publicKey: publicKeyCompressed, - curveType: Components.Schemas.ApiKeyCurve.API_KEY_CURVE_P256, - expirationSeconds: Constants.Turnkey.sessionDuration - ) - - let requestBody = CreateSubOrgRequest( - passkey: registration, - apiKeys: [apiKey] - ) - - let subOrgId = try await createSubOrganization(body: requestBody) - - let ephemeralClient = TurnkeyClient( - apiPrivateKey: privateKey, - apiPublicKey: publicKeyCompressed, - baseUrl: Constants.Turnkey.apiUrl - ) - - try await stampLoginAndCreateSession( - anchor: anchor, - organizationId: subOrgId, - expiresInSeconds: Constants.Turnkey.sessionDuration, - client: ephemeralClient - ) - } - - func loginWithPasskey(anchor: ASPresentationAnchor) async throws { - guard isPasskeySupported else { throw AuthError.passkeysNotSupported } - startLoading() - defer { stopLoading() } - - try await stampLoginAndCreateSession( - anchor: anchor, - organizationId: Constants.Turnkey.organizationId, - expiresInSeconds: Constants.Turnkey.sessionDuration - ) - } - - func loginWithGoogle(anchor: ASPresentationAnchor) async throws { - startLoading() - defer { stopLoading() } - - let publicKey = try turnkey.createKeyPair() - let nonce = publicKey - .data(using: .utf8)! - .sha256() - .map { String(format: "%02x", $0) } - .joined() - - let oidcToken = try await turnkey.startGoogleOAuthFlow( - clientId: Constants.Google.clientId, - nonce: nonce, - scheme: Constants.App.scheme, - anchor: anchor - ) - - let oAuthBody = OAuthLoginRequest( - publicKey: publicKey, - providerName: "google", - oidcToken: oidcToken, - expirationSeconds: Constants.Turnkey.sessionDuration - ) - - var request = URLRequest(url: backendURL.appendingPathComponent("/auth/oAuth")) - request.httpMethod = "POST" - request.setValue("application/json", forHTTPHeaderField: "Content-Type") - request.httpBody = try JSONEncoder().encode(oAuthBody) - - let (data, response) = try await URLSession.shared.data(for: request) - guard (response as? HTTPURLResponse)?.statusCode == 200 else { - throw AuthError.serverError - } - - let result = try JSONDecoder().decode(OAuthLoginResponse.self, from: data) - try await turnkey.createSession(jwt: result.token, refreshedSessionTTLSeconds: Constants.Turnkey.sessionDuration) - } - - - private func createSubOrganization(body: CreateSubOrgRequest) async throws -> String { - var request = URLRequest(url: backendURL.appendingPathComponent("/auth/createSubOrg")) - request.httpMethod = "POST" - request.setValue("application/json", forHTTPHeaderField: "Content-Type") - request.httpBody = try JSONEncoder().encode(body) - - let (data, response) = try await URLSession.shared.data(for: request) - guard (response as? HTTPURLResponse)?.statusCode == 200 else { - throw AuthError.serverError - } - - return try JSONDecoder().decode(CreateSubOrgResponse.self, from: data).subOrganizationId - } - - private func stampLoginAndCreateSession( - anchor: ASPresentationAnchor, - organizationId: String, - expiresInSeconds: String, - client: TurnkeyClient? = nil - ) async throws { - let client = client ?? TurnkeyClient( - rpId: Constants.App.rpId, - presentationAnchor: anchor, - baseUrl: Constants.Turnkey.apiUrl - ) - - let publicKey = try turnkey.createKeyPair() - - do { - let resp = try await client.stampLogin( - organizationId: organizationId, - publicKey: publicKey, - expirationSeconds: expiresInSeconds, - invalidateExisting: true - ) - - guard - case let .json(body) = resp.body, - let jwt = body.activity.result.stampLoginResult?.session - else { - throw AuthError.serverError - } - - try await turnkey.createSession(jwt: jwt, refreshedSessionTTLSeconds: Constants.Turnkey.sessionDuration) - - } catch let error as TurnkeyRequestError { - throw error - } - } - - private func startLoading() { - isLoading = true - error = nil - } - - private func stopLoading() { - isLoading = false - } -} diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/DemoWalletApp.swift b/Examples/swift-demo-wallet/swift-demo-wallet/DemoWalletApp.swift index 35874349..3b5c55b1 100644 --- a/Examples/swift-demo-wallet/swift-demo-wallet/DemoWalletApp.swift +++ b/Examples/swift-demo-wallet/swift-demo-wallet/DemoWalletApp.swift @@ -4,21 +4,36 @@ import TurnkeySwift @main struct DemoWalletApp: App { @StateObject private var turnkey: TurnkeyContext - @StateObject private var auth: AuthContext @StateObject private var toast = ToastContext() init() { - TurnkeyContext.configure(apiUrl: Constants.Turnkey.apiUrl) + let config = TurnkeyConfig( + apiUrl: Constants.Turnkey.apiUrl, + authProxyUrl: Constants.Turnkey.authProxyUrl, + authProxyConfigId: Constants.Turnkey.authProxyConfigId, + rpId: Constants.App.rpId, + organizationId: Constants.Turnkey.organizationId, + auth: .init( + oauth: .init( + appScheme: Constants.App.scheme, + providers: .init( + google: .init(clientId: Constants.Google.clientId), + apple: .init(clientId: Constants.Apple.clientId), + x: .init(clientId: Constants.X.clientId), + discord: .init(clientId: Constants.Discord.clientId) + ) + ) + ) + ) + TurnkeyContext.configure(config) let turnkey = TurnkeyContext.shared _turnkey = StateObject(wrappedValue: turnkey) - _auth = StateObject(wrappedValue: AuthContext(turnkey: turnkey)) } var body: some Scene { WindowGroup { AppView() - .environmentObject(auth) .environmentObject(turnkey) .environmentObject(toast) } diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Helpers/Constants.swift b/Examples/swift-demo-wallet/swift-demo-wallet/Helpers/Constants.swift index 0b45070e..242055ab 100644 --- a/Examples/swift-demo-wallet/swift-demo-wallet/Helpers/Constants.swift +++ b/Examples/swift-demo-wallet/swift-demo-wallet/Helpers/Constants.swift @@ -1,35 +1,49 @@ import Foundation import TurnkeyHttp +import TurnkeyTypes enum Constants { - enum App { - static let appName = "Swift Demo Wallet App" - static let rpId = "" - static let scheme = "swift-demo-wallet" - static let backendBaseUrl = "http://localhost:3000" - } - - enum Turnkey { - static let organizationId = "" - static let sessionDuration = "900" - static let apiUrl = "https://api.turnkey.com" - static let defaultEthereumAccounts: [Components.Schemas.WalletAccountParams] = [ - Components.Schemas.WalletAccountParams( - curve: Components.Schemas.Curve.CURVE_SECP256K1, - pathFormat: Components.Schemas.PathFormat.PATH_FORMAT_BIP32, - path: "m/44'/60'/0'/0/0", - addressFormat: Components.Schemas.AddressFormat.ADDRESS_FORMAT_ETHEREUM - ) - ] - } - - enum Ethereum { - static let rpcURL = "https://rpc.sepolia.org" - static let coingeckoURL = "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd" - } + enum App { + static let rpId = "" + static let scheme = "swift-demo-wallet" + } + + enum Turnkey { + static let organizationId = "" + static let apiUrl = "https://api.turnkey.com" + + static let authProxyUrl = "https://authproxy.turnkey.com" + static let authProxyConfigId = "" - enum Google { - static let clientId = "" - } + static let defaultEthereumAccounts: [v1WalletAccountParams] = [ + v1WalletAccountParams( + addressFormat: v1AddressFormat.address_format_ethereum, + curve: v1Curve.curve_secp256k1, + path: "m/44'/60'/0'/0/0", + pathFormat: v1PathFormat.path_format_bip32 + ) + ] + } + + enum Ethereum { + static let rpcURL = "https://rpc.sepolia.org" + static let coingeckoURL = "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd" + } + + enum Google { + static let clientId = "" + } + + enum Apple { + static let clientId = "" + } + + enum X { + static let clientId = "" + } + + enum Discord { + static let clientId = "" + } } diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Views/AuthView.swift b/Examples/swift-demo-wallet/swift-demo-wallet/Views/AuthView.swift index 188bf699..e5de5724 100644 --- a/Examples/swift-demo-wallet/swift-demo-wallet/Views/AuthView.swift +++ b/Examples/swift-demo-wallet/swift-demo-wallet/Views/AuthView.swift @@ -1,57 +1,66 @@ import SwiftUI import AuthenticationServices import PhoneNumberKit +import TurnkeySwift +import TurnkeyHttp struct AuthView: View { @EnvironmentObject private var coordinator: NavigationCoordinator - @EnvironmentObject private var auth: AuthContext + @EnvironmentObject private var turnkey: TurnkeyContext @EnvironmentObject private var toast: ToastContext - + @State private var email = "" @State private var phone = "" @State private var selectedCountry = "US" - + @State private var error: String? = nil + var body: some View { VStack { Spacer() - + VStack(spacing: 24) { VStack(spacing: 16) { Text("Log in or sign up") .font(.title3.bold()) .multilineTextAlignment(.center) .padding(.vertical, 8) - - GoogleButton(action: handleLoginWithGoogle) - OrSeparator() + HStack(spacing: 12) { + SocialIconButton(image: Image(systemName: "applelogo"), action: handleLoginWithApple) + SocialIconButton(image: Image("google-icon"), action: handleLoginWithGoogle) + SocialIconButton(image: Image("x-icon"), action: handleLoginWithX) + SocialIconButton(image: Image("discord-icon"), action: handleLoginWithDiscord) + } + .frame(height: 48) + OrSeparator() + EmailInputView(email: $email) - + LightGrayButton( title: "Continue", action: handleContinueWithEmail, isDisabled: !isValidEmail(email) ) - + OrSeparator() - + PhoneInputView( selectedCountry: $selectedCountry, phoneNumber: $phone ) - + LightGrayButton( title: "Continue", action: handleContinueWithPhone, isDisabled: !isValidPhone(phone, region: selectedCountry) ) - + OrSeparator() - + Button("Log in with passkey", action: handleLoginWithPasskey) .buttonStyle(BlackBorderButton()) - + Button("Sign up with passkey", action: handleSignUpWithPasskey) .font(.system(size: 14, weight: .semibold)) .foregroundColor(.blue) @@ -62,19 +71,36 @@ struct AuthView: View { .shadow(color: .black.opacity(0.05), radius: 8, x: 0, y: 4) .padding(.horizontal, 20) } - + Spacer() } .background(Color.gray.opacity(0.05).ignoresSafeArea()) - .onChange(of: auth.error) { - if let error = auth.error { - toast.show(message: error, type: .error) - auth.error = nil + .onChange(of: error) { + if let message = error { + toast.show(message: message, type: .error) + error = nil } } } - + private func handleLoginWithGoogle() { + Task { + guard let anchor = defaultAnchor() else { + toast.show(message: "No window available", type: .error) + return + } + + do { + try await turnkey.handleGoogleOAuth(anchor: anchor) + } catch { + let message = formatError(error, fallback: "Failed to log in with Google") + print("[AuthView] Google login error: \(message)") + self.error = message + } + } + } + + private func handleLoginWithApple() { Task { guard let anchor = defaultAnchor() else { toast.show(message: "No window available", type: .error) @@ -82,65 +108,113 @@ struct AuthView: View { } do { - try await auth.loginWithGoogle(anchor: anchor) + try await turnkey.handleAppleOAuth(anchor: anchor) } catch { - auth.error = "Failed to log in with Google" + let message = formatError(error, fallback: "Failed to log in with Apple") + print("[AuthView] Apple login error: \(message)") + self.error = message } } } - private func handleContinueWithEmail() { + private func handleLoginWithX() { Task { + guard let anchor = defaultAnchor() else { + toast.show(message: "No window available", type: .error) + return + } + do { - let (otpId, publicKey) = try await auth.sendOtp(contact: email, type: .email) - coordinator.push(AuthRoute.otp(otpId: otpId, contact: email, publicKey: publicKey)) + try await turnkey.handleXOauth(anchor: anchor) } catch { - auth.error = "Failed to send OTP" + let message = formatError(error, fallback: "Failed to log in with X") + print("[AuthView] X login error: \(message)") + self.error = message } } } + private func handleLoginWithDiscord() { + Task { + guard let anchor = defaultAnchor() else { + toast.show(message: "No window available", type: .error) + return + } + + do { + try await turnkey.handleDiscordOAuth(anchor: anchor) + } catch { + let message = formatError(error, fallback: "Failed to log in with Discord") + print("[AuthView] Discord login error: \(message)") + self.error = message + } + } + } + + private func handleContinueWithEmail() { + Task { + do { + let resp = try await turnkey.initOtp(contact: email, otpType: OtpType.email) + coordinator.push(AuthRoute.otp(otpId: resp.otpId, contact: email, otpType: .email)) + } catch { + let message = formatError(error, fallback: "Failed to send OTP") + print("[AuthView] Email OTP error: \(message)") + self.error = message + } + } + } + private func handleContinueWithPhone() { Task { do { - let (otpId, publicKey) = try await auth.sendOtp(contact: phone, type: .sms) - coordinator.push(AuthRoute.otp(otpId: otpId, contact: phone, publicKey: publicKey)) + guard let formattedPhone = formatToE164(phone, region: selectedCountry) else { + self.error = "Invalid phone number" + return + } + let resp = try await turnkey.initOtp(contact: formattedPhone, otpType: OtpType.sms) + coordinator.push(AuthRoute.otp(otpId: resp.otpId, contact: formattedPhone, otpType: .sms)) } catch { - auth.error = "Failed to send OTP" + let message = formatError(error, fallback: "Failed to send OTP") + print("[AuthView] SMS OTP error: \(message)") + self.error = message } } } - + private func handleLoginWithPasskey() { Task { guard let anchor = defaultAnchor() else { toast.show(message: "No window available", type: .error) return } - + do { - try await auth.loginWithPasskey(anchor: anchor) + try await turnkey.loginWithPasskey(anchor: anchor) } catch { - auth.error = "Failed to log in with passkey" + let message = formatError(error, fallback: "Failed to log in with passkey") + print("[AuthView] Passkey login error: \(message)") + self.error = message } } } - + private func handleSignUpWithPasskey() { Task { guard let anchor = defaultAnchor() else { toast.show(message: "No window available", type: .error) return } - + do { - try await auth.signUpWithPasskey(anchor: anchor) + try await turnkey.signUpWithPasskey(anchor: anchor) } catch { - auth.error = "Failed to sign up with passkey" + let message = formatError(error, fallback: "Failed to sign up with passkey") + print("[AuthView] Passkey signup error: \(message)") + self.error = message } } } - + private func defaultAnchor() -> ASPresentationAnchor? { UIApplication.shared .connectedScenes @@ -150,11 +224,22 @@ struct AuthView: View { .first(where: { $0.isKeyWindow }) } + private func formatError(_ error: Error, fallback: String) -> String { + if let turnkeyError = error.turnkeyRequestError { + return "\(fallback): \(turnkeyError.fullMessage)" + } + if let localized = (error as? LocalizedError)?.errorDescription { + return "\(fallback): \(localized)" + } + return "\(fallback): \(String(describing: error))" + } + private struct OrSeparator: View { + var label: String = "OR" var body: some View { HStack { Rectangle().frame(height: 1).foregroundColor(.gray.opacity(0.3)) - Text("OR") + Text(label) .font(.caption) .foregroundColor(.gray) .padding(.horizontal, 4) @@ -162,12 +247,12 @@ struct AuthView: View { } } } - + private struct LightGrayButton: View { let title: String let action: () -> Void let isDisabled: Bool - + var body: some View { Button(action: action) { Text(title) @@ -182,7 +267,7 @@ struct AuthView: View { .opacity(isDisabled ? 0.5 : 1.0) } } - + private struct BlackBorderButton: ButtonStyle { func makeBody(configuration: Configuration) -> some View { configuration.label @@ -199,37 +284,29 @@ struct AuthView: View { .opacity(configuration.isPressed ? 0.8 : 1.0) } } - - private struct GoogleButton: View { + + private struct SocialIconButton: View { + let image: Image let action: () -> Void var body: some View { Button(action: action) { ZStack { - HStack { - Image("google-icon") - .resizable() - .frame(width: 40, height: 40) - .padding(.leading, 12) - - Spacer() - } - - Text("Continue with Google") - .font(.system(size: 16, weight: .medium)) + Color.white + image + .resizable() + .scaledToFit() + .frame(width: 20, height: 20) .foregroundColor(.black) } - .padding(.vertical, 6) - .frame(maxWidth: .infinity) - .background(Color.white) - .overlay( - RoundedRectangle(cornerRadius: 10) - .stroke(Color.black.opacity(0.2), lineWidth: 1) - ) - .cornerRadius(10) } .frame(maxWidth: .infinity) + .background(Color.white) + .overlay( + RoundedRectangle(cornerRadius: 10) + .stroke(Color.black.opacity(0.2), lineWidth: 1) + ) + .cornerRadius(10) } } - } diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Views/DashboardView.swift b/Examples/swift-demo-wallet/swift-demo-wallet/Views/DashboardView.swift index 0df16997..4f781862 100644 --- a/Examples/swift-demo-wallet/swift-demo-wallet/Views/DashboardView.swift +++ b/Examples/swift-demo-wallet/swift-demo-wallet/Views/DashboardView.swift @@ -30,37 +30,35 @@ struct DashboardView: View { ScrollView { VStack(spacing: 0) { - if let wallets = turnkey.user?.wallets { - ForEach(wallets, id: \.id) { wallet in - let address = wallet.accounts.first?.address ?? "" - let balance = balances[address] ?? 0 - let balanceUSD = balance * ethPriceUSD - - - WalletCardView( - walletId: wallet.id, - walletName: wallet.name, - address: address, - balanceUSD: balanceUSD, - balanceETH: balance, - onExport: handleExportPressed, - onSign: handleSignMessagePressed - ) - .padding() - .task { - if !address.isEmpty && balances[address] == nil { - do { - let fetched = try await Ethereum.getBalance(for: address) - await MainActor.run { - balances[address] = fetched - } - } catch { - await MainActor.run { - balances[address] = 0 - } - // we are using a free api, so rate limits are very common - // so we fail silently and default to 0 + ForEach(turnkey.wallets, id: \.id) { wallet in + let address = wallet.accounts.first?.address ?? "" + let balance = balances[address] ?? 0 + let balanceUSD = balance * ethPriceUSD + + + WalletCardView( + walletId: wallet.id, + walletName: wallet.walletName, + address: address, + balanceUSD: balanceUSD, + balanceETH: balance, + onExport: handleExportPressed, + onSign: handleSignMessagePressed + ) + .padding() + .task { + if !address.isEmpty && balances[address] == nil { + do { + let fetched = try await Ethereum.getBalance(for: address) + await MainActor.run { + balances[address] = fetched + } + } catch { + await MainActor.run { + balances[address] = 0 } + // we are using a free api, so rate limits are very common + // so we fail silently and default to 0 } } } diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Views/OtpView.swift b/Examples/swift-demo-wallet/swift-demo-wallet/Views/OtpView.swift index 320380f5..f21052fe 100644 --- a/Examples/swift-demo-wallet/swift-demo-wallet/Views/OtpView.swift +++ b/Examples/swift-demo-wallet/swift-demo-wallet/Views/OtpView.swift @@ -1,8 +1,9 @@ import SwiftUI +import TurnkeySwift struct OtpView: View { @EnvironmentObject private var coordinator: NavigationCoordinator - @EnvironmentObject private var auth: AuthContext + @EnvironmentObject private var turnkey: TurnkeyContext @EnvironmentObject private var toast: ToastContext @Environment(\.dismiss) private var dismiss @@ -11,14 +12,15 @@ struct OtpView: View { let otpId: String let contact: String - let publicKey: String + let otpType: OtpType + let onComplete: (String) async throws -> Void private var otpCode: String { otpDigits.joined() } private var isEmail: Bool { - contact.contains("@") + otpType == .email } var body: some View { @@ -81,14 +83,8 @@ struct OtpView: View { private func handleContinue() { Task { do { - let filterType: AuthContext.OtpType = isEmail ? .email : .sms - try await auth.verifyOtp( - otpId: otpId, - otpCode: otpCode, - filterType: filterType, - contact: contact, - publicKey: publicKey - ) + try await onComplete(otpCode) + dismiss() } catch { toast.show(message: "Invalid code. Please try again.", type: .error) } diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Views/SettingsView.swift b/Examples/swift-demo-wallet/swift-demo-wallet/Views/SettingsView.swift index c035b0c1..23bd45cf 100644 --- a/Examples/swift-demo-wallet/swift-demo-wallet/Views/SettingsView.swift +++ b/Examples/swift-demo-wallet/swift-demo-wallet/Views/SettingsView.swift @@ -7,79 +7,241 @@ struct SettingsView: View { @Environment(\.presentationMode) var presentationMode - @State private var email = "" - @State private var phone = "" - @State private var selectedCountry = "US" - @State private var didInitialize = false + @State private var showUpdateEmail = false + @State private var showUpdatePhone = false + @State private var showOtpView = false + @State private var otpId = "" + @State private var otpContact = "" + @State private var otpType: OtpType = .email + @State private var updateType: UpdateType? + + enum UpdateType { + case email + case phone + } var body: some View { VStack(alignment: .leading, spacing: 24) { VStack(alignment: .leading, spacing: 20) { VStack(alignment: .leading, spacing: 8) { Text("Email") - .font(.system(size: 14)) + .font(.system(size: 14, weight: .semibold)) .foregroundColor(.black) - EmailInputView(email: $email) + HStack { + Text(turnkey.user?.userEmail ?? "Not set") + .font(.system(size: 14)) + .foregroundColor(.gray) + + Spacer() + + Button("Update") { + showUpdateEmail = true + } + .font(.system(size: 14)) + } + .padding() + .background(Color.gray.opacity(0.1)) + .cornerRadius(8) } VStack(alignment: .leading, spacing: 8) { Text("Phone") - .font(.system(size: 14)) + .font(.system(size: 14, weight: .semibold)) .foregroundColor(.black) - PhoneInputView(selectedCountry: $selectedCountry, phoneNumber: $phone) + HStack { + Text(turnkey.user?.userPhoneNumber ?? "Not set") + .font(.system(size: 14)) + .foregroundColor(.gray) + + Spacer() + + Button("Update") { + showUpdatePhone = true + } + .font(.system(size: 14)) + } + .padding() + .background(Color.gray.opacity(0.1)) + .cornerRadius(8) } } .padding(.horizontal) - Button(action: handleUpdatePressed) { - Text("Update") - .font(.system(size: 14, weight: .semibold)) - .foregroundColor(.white) - .frame(maxWidth: .infinity) - .padding(.vertical, 12) - .background(Color.blue) - .cornerRadius(10) - } - .padding(.horizontal) - .padding(.top, 8) - Spacer() } .navigationTitle("Settings") .navigationBarTitleDisplayMode(.inline) .padding() - .onAppear { - if !didInitialize { - email = turnkey.user?.email ?? "" - - if let fullNumber = turnkey.user?.phoneNumber, - let parsed = parsePhone(fullNumber) { - phone = parsed.nationalNumber - selectedCountry = parsed.regionCode - } else { - phone = "" - selectedCountry = "US" - } - - didInitialize = true + .navigationDestination(isPresented: $showOtpView) { + OtpView( + otpId: otpId, + contact: otpContact, + otpType: otpType, + onComplete: handleOtpComplete + ) + } + .sheet(isPresented: $showUpdateEmail) { + UpdateEmailView(onUpdate: handleEmailUpdate) + } + .sheet(isPresented: $showUpdatePhone) { + UpdatePhoneView(onUpdate: handlePhoneUpdate) + } + } + + private func handleEmailUpdate(newEmail: String) { + Task { + do { + let result = try await turnkey.initOtp(contact: newEmail, otpType: .email) + otpId = result.otpId + otpContact = newEmail + otpType = .email + updateType = .email + showUpdateEmail = false + showOtpView = true + } catch { + toast.show(message: "Failed to send verification code", type: .error) } } - } - private func handleUpdatePressed() { + private func handlePhoneUpdate(newPhone: String) { Task { do { - // combines the country code and number - let formattedPhone = formatToE164(phone, region: selectedCountry) - - try await turnkey.updateUser(email: email, phone: formattedPhone) + let result = try await turnkey.initOtp(contact: newPhone, otpType: .sms) + otpId = result.otpId + otpContact = newPhone + otpType = .sms + updateType = .phone + showUpdatePhone = false + showOtpView = true } catch { - toast.show(message: "Failed to update user", type: .error) + toast.show(message: "Failed to send verification code", type: .error) + } + } + } + + private func handleOtpComplete(otpCode: String) async throws { + guard let updateType = updateType else { return } + + let verifyResult = try await turnkey.verifyOtp(otpId: otpId, otpCode: otpCode) + let verificationToken = verifyResult.credentialBundle + + switch updateType { + case .email: + try await turnkey.updateUserEmail(email: otpContact, verificationToken: verificationToken) + toast.show(message: "Email updated successfully", type: .success) + case .phone: + try await turnkey.updateUserPhoneNumber(phone: otpContact, verificationToken: verificationToken) + toast.show(message: "Phone updated successfully", type: .success) + } + + // we reset state + self.updateType = nil + } +} + +struct UpdateEmailView: View { + @Environment(\.dismiss) private var dismiss + @State private var email = "" + let onUpdate: (String) -> Void + + var body: some View { + NavigationView { + VStack(spacing: 24) { + VStack(alignment: .leading, spacing: 8) { + Text("New Email") + .font(.system(size: 14)) + .foregroundColor(.black) + + EmailInputView(email: $email) + } + .padding(.horizontal) + .padding(.top, 24) + + Button(action: { + onUpdate(email) + }) { + Text("Send Verification Code") + .font(.system(size: 14, weight: .semibold)) + .foregroundColor(.white) + .frame(maxWidth: .infinity) + .padding(.vertical, 12) + .background(isValidEmail(email) ? Color.blue : Color.gray) + .cornerRadius(10) + } + .disabled(!isValidEmail(email)) + .padding(.horizontal) + + Spacer() + } + .navigationTitle("Update Email") + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .cancellationAction) { + Button("Cancel") { + dismiss() + } + } } } } +} + +struct UpdatePhoneView: View { + @Environment(\.dismiss) private var dismiss + @EnvironmentObject private var toast: ToastContext + @State private var phone = "" + @State private var selectedCountry = "US" + let onUpdate: (String) -> Void + + private var isValidPhoneNumber: Bool { + !phone.isEmpty && isValidPhone(phone, region: selectedCountry) + } + var body: some View { + NavigationView { + VStack(spacing: 24) { + VStack(alignment: .leading, spacing: 8) { + Text("New Phone Number") + .font(.system(size: 14)) + .foregroundColor(.black) + + PhoneInputView(selectedCountry: $selectedCountry, phoneNumber: $phone) + } + .padding(.horizontal) + .padding(.top, 24) + + Button(action: { + guard let formattedPhone = formatToE164(phone, region: selectedCountry) else { + toast.show(message: "Invalid phone number", type: .error) + return + } + onUpdate(formattedPhone) + }) { + Text("Send Verification Code") + .font(.system(size: 14, weight: .semibold)) + .foregroundColor(.white) + .frame(maxWidth: .infinity) + .padding(.vertical, 12) + .background(isValidPhoneNumber ? Color.blue : Color.gray) + .cornerRadius(10) + } + .disabled(!isValidPhoneNumber) + .padding(.horizontal) + + Spacer() + } + .navigationTitle("Update Phone") + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .cancellationAction) { + Button("Cancel") { + dismiss() + } + } + } + } + } } diff --git a/Examples/swift-demo-wallet/swift-demo-wallet/Views/SignMessageView.swift b/Examples/swift-demo-wallet/swift-demo-wallet/Views/SignMessageView.swift index aa05d1a5..f821f062 100644 --- a/Examples/swift-demo-wallet/swift-demo-wallet/Views/SignMessageView.swift +++ b/Examples/swift-demo-wallet/swift-demo-wallet/Views/SignMessageView.swift @@ -1,4 +1,5 @@ import SwiftUI +import TurnkeyTypes import TurnkeyHttp import TurnkeySwift import TurnkeyEncoding @@ -80,16 +81,13 @@ struct SignMessageView: View { private func handleSignPressed() { Task { do { - let digest = Ethereum.keccak256Digest(of: message) - let digestHex = digest.toHexString() - - let result = try await turnkey.signRawPayload( + let result = try await turnkey.signMessage( signWith: walletAddress, - payload: digestHex, - encoding: .PAYLOAD_ENCODING_HEXADECIMAL, - hashFunction: .HASH_FUNCTION_NO_OP + addressFormat: v1AddressFormat.address_format_ethereum, + message: message, + addEthereumPrefix: true ) - + toast.show(message: "signed message", type: .success) await MainActor.run { signatureR = result.r signatureS = result.s diff --git a/Package.resolved b/Package.resolved index 90777447..b29edc2d 100644 --- a/Package.resolved +++ b/Package.resolved @@ -27,42 +27,6 @@ "version" : "5.3.0" } }, - { - "identity" : "openapikit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/mattpolzin/OpenAPIKit", - "state" : { - "revision" : "a75aa4166d916f1cb4a192e928a18f7b6d3516bc", - "version" : "3.5.2" - } - }, - { - "identity" : "swift-algorithms", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-algorithms", - "state" : { - "revision" : "87e50f483c54e6efd60e885f7f5aa946cee68023", - "version" : "1.2.1" - } - }, - { - "identity" : "swift-argument-parser", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-argument-parser", - "state" : { - "revision" : "41982a3656a71c768319979febd796c6fd111d5c", - "version" : "1.5.0" - } - }, - { - "identity" : "swift-collections", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-collections", - "state" : { - "revision" : "c1805596154bb3a265fd91b8ac0c4433b4348fb0", - "version" : "1.2.0" - } - }, { "identity" : "swift-http-types", "kind" : "remoteSourceControl", @@ -71,51 +35,6 @@ "revision" : "a0a57e949a8903563aba4615869310c0ebf14c03", "version" : "1.4.0" } - }, - { - "identity" : "swift-numerics", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-numerics.git", - "state" : { - "revision" : "e0ec0f5f3af6f3e4d5e7a19d2af26b481acb6ba8", - "version" : "1.0.3" - } - }, - { - "identity" : "swift-openapi-generator", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-openapi-generator.git", - "state" : { - "revision" : "02cab48b66b4b412013827c2938adaf0eb67dc8d", - "version" : "1.7.2" - } - }, - { - "identity" : "swift-openapi-runtime", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-openapi-runtime", - "state" : { - "revision" : "8f33cc5dfe81169fb167da73584b9c72c3e8bc23", - "version" : "1.8.2" - } - }, - { - "identity" : "swift-openapi-urlsession", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-openapi-urlsession", - "state" : { - "revision" : "6fac6f7c428d5feea2639b5f5c8b06ddfb79434b", - "version" : "1.1.0" - } - }, - { - "identity" : "yams", - "kind" : "remoteSourceControl", - "location" : "https://github.com/jpsim/Yams", - "state" : { - "revision" : "3d6871d5b4a5cd519adf233fbb576e0a2af71c17", - "version" : "5.4.0" - } } ], "version" : 2 diff --git a/Package.swift b/Package.swift index 32c95965..03615f1d 100644 --- a/Package.swift +++ b/Package.swift @@ -6,6 +6,7 @@ let package = Package( platforms: [.macOS(.v14), .iOS(.v17), .tvOS(.v16), .watchOS(.v9), .visionOS(.v1)], products: [ .library(name: "TurnkeyEncoding", targets: ["TurnkeyEncoding"]), + .library(name: "TurnkeyTypes", targets: ["TurnkeyTypes"]), .library(name: "TurnkeyHttp", targets: ["TurnkeyHttp"]), .library(name: "TurnkeyCrypto", targets: ["TurnkeyCrypto"]), .library(name: "TurnkeyPasskeys", targets: ["TurnkeyPasskeys"]), @@ -13,30 +14,28 @@ let package = Package( .library(name: "TurnkeySwift", targets: ["TurnkeySwift"]), ], dependencies: [ - .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.0.0"), - .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.0.0"), - .package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.0"), .package(url: "https://github.com/anquii/Base58Check.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-http-types", from: "1.0.2"), ], targets: [ .target(name: "TurnkeyEncoding", dependencies: []), + .target(name: "TurnkeyTypes", dependencies: []), .target( name: "TurnkeyHttp", dependencies: [ + "TurnkeyTypes", "TurnkeyStamper", .product(name: "HTTPTypes", package: "swift-http-types"), - .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), - .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), ]), .target( name: "TurnkeyCrypto", dependencies: [ + "TurnkeyEncoding", .product(name: "Base58Check", package: "Base58Check") ] ), - .target(name: "TurnkeyPasskeys", dependencies: ["TurnkeyEncoding", "TurnkeyCrypto"]), - .target(name: "TurnkeyStamper", dependencies: ["TurnkeyPasskeys"]), + .target(name: "TurnkeyPasskeys", dependencies: ["TurnkeyEncoding", "TurnkeyCrypto", "TurnkeyTypes"]), + .target(name: "TurnkeyStamper", dependencies: ["TurnkeyPasskeys", "TurnkeyCrypto"]), .target( name: "TurnkeySwift", dependencies: [ diff --git a/README.md b/README.md index 91fd43bc..9f5fccf5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,12 @@ You can find it at: **Path:** `Examples/swift-demo-wallet` -For setup instructions, refer to the [demo app README](./Examples/swift-demo-wallet/README.md). +For setup instructions, refer to the [Demo App README](./Examples/swift-demo-wallet/README.md). + +--- + +## Development + +Code generation for types and client methods is handled by custom Swift executables in the [`Scripts/`](./Scripts) directory. See the [Scripts README](./Scripts/README.md) for details. --- diff --git a/Scripts/Makefile b/Scripts/Makefile new file mode 100644 index 00000000..067dc39b --- /dev/null +++ b/Scripts/Makefile @@ -0,0 +1,32 @@ +.PHONY: build types clients codegen format clean + +# Build the codegen executables +build: + @swift build -q 2>&1 | grep -v "found.*file(s) which are unhandled" || true + +# Generate types only +types: build + @echo "🔨 Generating types..." + @cd .. && Scripts/.build/debug/typegen | grep -E "^(✅|❌)" || true + +# Generate clients only +clients: build + @echo "🔨 Generating clients..." + @cd .. && Scripts/.build/debug/clientgen | grep -E "^(✅|❌)" || true + +# Generate everything +generate: types clients format + @echo "✨ Code generation complete!" + +# Format generated code +format: + @echo "🎨 Formatting..." + @swift-format ../Sources/TurnkeyTypes/Generated/ -i -r 2>/dev/null + @swift-format ../Sources/TurnkeyHttp/Public/TurnkeyClient+Public.swift -i 2>/dev/null + @swift-format ../Sources/TurnkeyHttp/Public/TurnkeyClient+AuthProxy.swift -i 2>/dev/null + +# Clean build artifacts +clean: + @rm -rf .build 2>/dev/null || true + +.DEFAULT_GOAL := codegen diff --git a/Scripts/Package.swift b/Scripts/Package.swift new file mode 100644 index 00000000..14ba35e4 --- /dev/null +++ b/Scripts/Package.swift @@ -0,0 +1,27 @@ +// swift-tools-version: 5.9 +import PackageDescription + +let package = Package( + name: "TurnkeyCodegen", + platforms: [.macOS(.v13)], + products: [ + .executable(name: "typegen", targets: ["Typegen"]), + .executable(name: "clientgen", targets: ["Clientgen"]), + ], + targets: [ + .target( + name: "Internal", + path: "Sources/Internal" + ), + .executableTarget( + name: "Typegen", + dependencies: ["Internal"], + path: "Sources/Typegen" + ), + .executableTarget( + name: "Clientgen", + dependencies: ["Internal"], + path: "Sources/Clientgen" + ), + ] +) diff --git a/Scripts/README.md b/Scripts/README.md new file mode 100644 index 00000000..e3896899 --- /dev/null +++ b/Scripts/README.md @@ -0,0 +1,39 @@ +# Code Generation + +Code generation is handled by custom Swift executables in this directory. See details below. + +## Usage + +```bash +make generate +``` + +That's it! This generates types, clients, and formats everything. + +## What Gets Generated + +- **Types**: `Sources/TurnkeyTypes/Generated/Types.swift` +- **Clients**: + - `Sources/TurnkeyHttp/Public/TurnkeyClient+Public.swift` + - `Sources/TurnkeyHttp/Public/TurnkeyClient+AuthProxy.swift` + +## ⚠️ When to Update Constants + +When syncing from the monorepo, update `Scripts/Sources/Internal/Constants.swift` if: +- An activity type version changed (e.g., `V2` → `V3`) +- A new activity was created with all optional parameters + +Then run `make generate` to regenerate code. + +## Structure + +``` +Scripts/ +├── Sources/ +│ ├── Internal/ +│ │ ├── Constants.swift # Config constants +│ │ └── Resources/ # Swagger specs +│ ├── Typegen/main.swift # Type generator +│ └── Clientgen/main.swift # Client generator +└── Package.swift # Swift package config +``` diff --git a/Scripts/Sources/Clientgen/main.swift b/Scripts/Sources/Clientgen/main.swift new file mode 100644 index 00000000..0ef4a5c3 --- /dev/null +++ b/Scripts/Sources/Clientgen/main.swift @@ -0,0 +1,382 @@ +import Foundation +import Internal + +// MARK: - Configuration + +// Assume we're running from the project root (swift-sdk/) +let CURRENT_DIR = URL(fileURLWithPath: FileManager.default.currentDirectoryPath) + +let PUBLIC_API_SWAGGER_PATH = CURRENT_DIR + .appendingPathComponent("Scripts/Sources/Internal/Resources/public_api.swagger.json") + +let AUTH_PROXY_SWAGGER_PATH = CURRENT_DIR + .appendingPathComponent("Scripts/Sources/Internal/Resources/auth_proxy.swagger.json") + +let PUBLIC_OUTPUT_PATH = CURRENT_DIR + .appendingPathComponent("Sources/TurnkeyHttp/Public/TurnkeyClient+Public.swift") + +let AUTHPROXY_OUTPUT_PATH = CURRENT_DIR + .appendingPathComponent("Sources/TurnkeyHttp/Public/TurnkeyClient+AuthProxy.swift") + +// Import constants from Internal module +let VERSIONED_ACTIVITY_TYPES = CodegenConfig.versionedActivityTypes + +// Methods that have only optional parameters (client method names without 't' prefix) +let METHODS_WITH_ONLY_OPTIONAL_PARAMETERS = [ + "getActivities", + "getApiKeys", + "getOrganization", + "getPolicies", + "getPrivateKeys", + "getSubOrgIds", + "getUsers", + "getWallets", + "getWhoami", + "listPrivateKeys", +] + +// MARK: - Swagger Models + +struct SwaggerSpec: Codable { + let swagger: String + let info: Info + let paths: [String: PathItem] + let definitions: [String: Definition] + let tags: [Tag]? + + struct Info: Codable { + let title: String + let version: String + } + + struct Tag: Codable { + let name: String + let description: String? + } + + struct PathItem: Codable { + let post: Operation? + let get: Operation? + } + + struct Operation: Codable { + let operationId: String + let summary: String? + let description: String? + let parameters: [Parameter]? + } + + struct Parameter: Codable { + let name: String + let `in`: String + let required: Bool? + let schema: Box? + } + + struct Schema: Codable { + let ref: String? + let type: String? + let items: Box? + let properties: [String: Box]? + + private enum CodingKeys: String, CodingKey { + case ref = "$ref" + case type, items, properties + } + } + + struct Definition: Codable { + let type: String? + let properties: [String: Box]? + let required: [String]? + let enumValues: [String]? + + private enum CodingKeys: String, CodingKey { + case type, properties, required + case enumValues = "enum" + } + } +} + +// Box wrapper for recursive types +class Box: Codable { + let value: T + + init(_ value: T) { + self.value = value + } + + required init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + value = try container.decode(T.self) + } + + func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(value) + } +} + +struct VersionInfo { + let fullName: String + let formattedKeyName: String + let versionSuffix: String +} + +// MARK: - Helper Functions + +func loadSwaggerSpec(from url: URL) throws -> SwaggerSpec { + let data = try Data(contentsOf: url) + let decoder = JSONDecoder() + return try decoder.decode(SwaggerSpec.self, from: data) +} + +func camelCase(_ str: String) -> String { + let parts = str.components(separatedBy: "_") + guard let first = parts.first else { return str } + let rest = parts.dropFirst().map { $0.prefix(1).uppercased() + $0.dropFirst() } + return ([first] + rest).joined() +} + +func snakeCase(_ str: String) -> String { + // Convert PascalCase/camelCase to snake_case + var result = "" + for (index, char) in str.enumerated() { + if char.isUppercase && index > 0 { + result += "_" + } + result += char.lowercased() + } + return result +} + +func methodTypeFromMethodName(_ methodName: String) -> String { + if ["approveActivity", "rejectActivity"].contains(methodName) { + return "activityDecision" + } + if methodName.hasPrefix("get") || methodName.hasPrefix("list") || methodName.hasPrefix("test") { + return "query" + } + return "activity" +} + +// Helper that extracts latest versions (matching JS extractLatestVersions) +func extractLatestVersions(definitions: [String: SwaggerSpec.Definition]) -> [String: VersionInfo] { + var latestVersions: [String: VersionInfo] = [:] + + // Regex to separate version prefix, base name, and optional version suffix + let keyVersionRegex = try! NSRegularExpression(pattern: "^(v\\d+)([A-Z][A-Za-z0-9]*?)(V\\d+)?$") + + for key in definitions.keys { + let range = NSRange(key.startIndex.. (latestVersions[baseName]?.versionSuffix ?? "") { + latestVersions[baseName] = VersionInfo( + fullName: fullName, + formattedKeyName: formattedKeyName, + versionSuffix: versionSuffix + ) + } + } + + return latestVersions +} + +// MARK: - Code Generation + +func generatePublicClientFile(swagger: SwaggerSpec) -> String { + var output = """ + // @generated by Clientgen. DO NOT EDIT BY HAND + + import Foundation + import TurnkeyTypes + + public extension TurnkeyClient { + + """ + + let namespace = swagger.tags?.first?.name ?? "PublicApiService" + let latestVersions = extractLatestVersions(definitions: swagger.definitions) + + // Sort paths for consistent output + let sortedPaths = swagger.paths.sorted { $0.key < $1.key } + + for (endpointPath, pathItem) in sortedPaths { + guard let operation = pathItem.post else { continue } + let operationId = operation.operationId + + // Remove namespace prefix + let operationNameWithoutNamespace = operationId.replacingOccurrences( + of: "\(namespace)_", + with: "" + ) + + if operationNameWithoutNamespace == "NOOPCodegenAnchor" { + continue + } + + // Convert to camelCase method name + let methodName = operationNameWithoutNamespace.prefix(1).lowercased() + + operationNameWithoutNamespace.dropFirst() + + let methodType = methodTypeFromMethodName(methodName) + let inputType = "T\(operationNameWithoutNamespace)Body" + let responseType = "T\(operationNameWithoutNamespace)Response" + + // Add method documentation + if let summary = operation.summary { + output += "\n /// \(summary)\n" + } + if let description = operation.description { + output += " /// \(description)\n" + } + + let hasOptionalParams = METHODS_WITH_ONLY_OPTIONAL_PARAMETERS.contains(methodName) + let defaultParam = hasOptionalParams ? " = .init()" : "" + + if methodType == "query" { + // Query method + output += """ + func \(methodName)(_ input: \(inputType)\(defaultParam)) async throws -> \(responseType) { + return try await request("\(endpointPath)", body: input) + } + + + """ + } else if methodType == "activity" { + // Activity method - needs type, organizationId, timestampMs wrapping + let unversionedActivityType = "ACTIVITY_TYPE_\(snakeCase(operationNameWithoutNamespace).uppercased())" + let activityType = VERSIONED_ACTIVITY_TYPES[unversionedActivityType] ?? unversionedActivityType + + let resultKey = operationNameWithoutNamespace + "Result" + let versionedResultKey = latestVersions[resultKey]?.formattedKeyName ?? camelCase(resultKey) + + output += """ + func \(methodName)(_ input: \(inputType)) async throws -> \(responseType) { + return try await activity("\(endpointPath)", body: input, activityType: "\(activityType)", resultKey: "\(versionedResultKey)") + } + + + """ + } else if methodType == "activityDecision" { + // Activity decision method + let unversionedActivityType = "ACTIVITY_TYPE_\(snakeCase(operationNameWithoutNamespace).uppercased())" + let activityType = VERSIONED_ACTIVITY_TYPES[unversionedActivityType] ?? unversionedActivityType + + output += """ + func \(methodName)(_ input: \(inputType)) async throws -> \(responseType) { + return try await activityDecision("\(endpointPath)", body: input, activityType: "\(activityType)") + } + + + """ + } + } + + output += "}\n" + return output +} + +func generateAuthProxyClientFile(swagger: SwaggerSpec) -> String { + var output = """ + // @generated by Clientgen. DO NOT EDIT BY HAND + + import Foundation + import TurnkeyTypes + + public extension TurnkeyClient { + + """ + + let namespace = swagger.tags?.first?.name ?? "AuthProxyService" + + // Sort paths for consistent output + let sortedPaths = swagger.paths.sorted { $0.key < $1.key } + + for (endpointPath, pathItem) in sortedPaths { + guard let operation = pathItem.post else { continue } + let operationId = operation.operationId + + // Remove namespace prefix + let operationNameWithoutNamespace = operationId.replacingOccurrences( + of: "\(namespace)_", + with: "" + ) + + // Convert to camelCase with "proxy" prefix + let methodName = "proxy" + + operationNameWithoutNamespace.prefix(1).uppercased() + + operationNameWithoutNamespace.dropFirst() + + let inputType = "ProxyT\(operationNameWithoutNamespace)Body" + let responseType = "ProxyT\(operationNameWithoutNamespace)Response" + + // Add method documentation + if let summary = operation.summary { + output += "\n /// \(summary)\n" + } + if let description = operation.description { + output += " /// \(description)\n" + } + + let hasOptionalParams = METHODS_WITH_ONLY_OPTIONAL_PARAMETERS.contains(methodName) + let defaultParam = hasOptionalParams ? " = .init()" : "" + + output += """ + func \(methodName)(_ input: \(inputType)\(defaultParam)) async throws -> \(responseType) { + return try await authProxyRequest("\(endpointPath)", body: input) + } + + + """ + } + + output += "}\n" + return output +} + +// MARK: - Main + +print("🚀 Starting Client Code Generation for Swift...") + +do { + print("📖 Reading Swagger specifications...") + let publicSwagger = try loadSwaggerSpec(from: PUBLIC_API_SWAGGER_PATH) + let authProxySwagger = try loadSwaggerSpec(from: AUTH_PROXY_SWAGGER_PATH) + + print("✅ Parsed Swagger specifications") + print(" - Public API: \(publicSwagger.paths.count) endpoints") + print(" - Auth Proxy: \(authProxySwagger.paths.count) endpoints") + + print("\n🔨 Generating client methods...") + + // Generate Public API client + let publicClient = generatePublicClientFile(swagger: publicSwagger) + try publicClient.write(to: PUBLIC_OUTPUT_PATH, atomically: true, encoding: .utf8) + print("✅ Generated public client at: \(PUBLIC_OUTPUT_PATH.path)") + + // Generate Auth Proxy client + let authProxyClient = generateAuthProxyClientFile(swagger: authProxySwagger) + try authProxyClient.write(to: AUTHPROXY_OUTPUT_PATH, atomically: true, encoding: .utf8) + print("✅ Generated auth proxy client at: \(AUTHPROXY_OUTPUT_PATH.path)") + + print("\n✨ Client generation complete!") + +} catch { + print("❌ Error: \(error)") + exit(1) +} diff --git a/Scripts/Sources/Internal/Constants.swift b/Scripts/Sources/Internal/Constants.swift new file mode 100644 index 00000000..ed1e603a --- /dev/null +++ b/Scripts/Sources/Internal/Constants.swift @@ -0,0 +1,32 @@ +import Foundation + +public enum CodegenConfig { + public static let versionedActivityTypes: [String: String] = [ + "ACTIVITY_TYPE_CREATE_AUTHENTICATORS": "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2", + "ACTIVITY_TYPE_CREATE_API_KEYS": "ACTIVITY_TYPE_CREATE_API_KEYS_V2", + "ACTIVITY_TYPE_CREATE_POLICY": "ACTIVITY_TYPE_CREATE_POLICY_V3", + "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS": "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION": "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7", + "ACTIVITY_TYPE_CREATE_USERS": "ACTIVITY_TYPE_CREATE_USERS_V3", + "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD": "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2", + "ACTIVITY_TYPE_SIGN_TRANSACTION": "ACTIVITY_TYPE_SIGN_TRANSACTION_V2", + "ACTIVITY_TYPE_EMAIL_AUTH": "ACTIVITY_TYPE_EMAIL_AUTH_V2", + "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION": "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2", + "ACTIVITY_TYPE_UPDATE_POLICY": "ACTIVITY_TYPE_UPDATE_POLICY_V2", + "ACTIVITY_TYPE_INIT_OTP_AUTH": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2", + ] + + public static let methodsWithOnlyOptionalParameters = [ + "tGetActivities", + "tGetApiKeys", + "tGetOrganization", + "tGetPolicies", + "tGetPrivateKeys", + "tGetSubOrgIds", + "tGetUsers", + "tGetWallets", + "tGetWhoami", + "tListPrivateKeys", + "tListUserTags", + ] +} diff --git a/Scripts/Sources/Internal/Resources/auth_proxy.swagger.json b/Scripts/Sources/Internal/Resources/auth_proxy.swagger.json new file mode 100644 index 00000000..e9ec59d6 --- /dev/null +++ b/Scripts/Sources/Internal/Resources/auth_proxy.swagger.json @@ -0,0 +1,865 @@ +{ + "swagger": "2.0", + "info": { + "title": "services/auth_proxy/v1/proxy_api.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "AuthProxyService" + } + ], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/v1/account": { + "post": { + "summary": "Get Account", + "description": "Return organization id associated with a given phone number, email, public key, credential ID or OIDC token.", + "operationId": "AuthProxyService_GetAccount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetAccountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetAccountRequest" + } + } + ], + "tags": ["Accounts"] + } + }, + "/v1/oauth2_authenticate": { + "post": { + "summary": "OAuth 2.0 Authenticate", + "description": "Authenticate with an OAuth 2.0 provider and receive an OIDC token issued by Turnkey in response.", + "operationId": "AuthProxyService_OAuth2Authenticate", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1OAuth2AuthenticateResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1OAuth2AuthenticateRequest" + } + } + ], + "tags": ["Auth"] + } + }, + "/v1/oauth_login": { + "post": { + "summary": "OAuth Login", + "description": "Login using an OIDC token and public key.", + "operationId": "AuthProxyService_OAuthLogin", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1OAuthLoginResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1OAuthLoginRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/v1/otp_init": { + "post": { + "summary": "Init OTP", + "description": "Initialize an OTP (email or SMS) for a user.", + "operationId": "AuthProxyService_InitOtp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1InitOtpResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitOtpRequest" + } + } + ], + "tags": ["Auth"] + } + }, + "/v1/otp_login": { + "post": { + "summary": "OTP Login", + "description": "Login using a verification token and public key.", + "operationId": "AuthProxyService_OtpLogin", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1OtpLoginResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1OtpLoginRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/v1/otp_verify": { + "post": { + "summary": "Verify OTP", + "description": "Verify the OTP code previously sent to the user's contact and return a verification token.", + "operationId": "AuthProxyService_VerifyOtp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1VerifyOtpResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1VerifyOtpRequest" + } + } + ], + "tags": ["Auth"] + } + }, + "/v1/signup": { + "post": { + "summary": "Signup", + "description": "Onboard a new user.", + "operationId": "AuthProxyService_Signup", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SignupResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SignupRequest" + } + } + ], + "tags": ["Auth"] + } + }, + "/v1/wallet_kit_config": { + "post": { + "summary": "Get WalletKit Config", + "description": "Get wallet kit settings and feature toggles for the calling organization.", + "operationId": "AuthProxyService_GetWalletKitConfig", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetWalletKitConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetWalletKitConfigRequest" + } + } + ], + "tags": ["Wallet Kit"] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1AddressFormat": { + "type": "string", + "enum": [ + "ADDRESS_FORMAT_UNCOMPRESSED", + "ADDRESS_FORMAT_COMPRESSED", + "ADDRESS_FORMAT_ETHEREUM", + "ADDRESS_FORMAT_SOLANA", + "ADDRESS_FORMAT_COSMOS", + "ADDRESS_FORMAT_TRON", + "ADDRESS_FORMAT_SUI", + "ADDRESS_FORMAT_APTOS", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR", + "ADDRESS_FORMAT_SEI", + "ADDRESS_FORMAT_XLM", + "ADDRESS_FORMAT_DOGE_MAINNET", + "ADDRESS_FORMAT_DOGE_TESTNET", + "ADDRESS_FORMAT_TON_V3R2", + "ADDRESS_FORMAT_TON_V4R2", + "ADDRESS_FORMAT_TON_V5R1", + "ADDRESS_FORMAT_XRP" + ] + }, + "v1ApiKeyCurve": { + "type": "string", + "enum": [ + "API_KEY_CURVE_P256", + "API_KEY_CURVE_SECP256K1", + "API_KEY_CURVE_ED25519" + ] + }, + "v1ApiKeyParamsV2": { + "type": "object", + "properties": { + "apiKeyName": { + "type": "string", + "description": "Human-readable name for an API Key." + }, + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to sign messages and transactions." + }, + "curveType": { + "$ref": "#/definitions/v1ApiKeyCurve", + "description": "The curve type to be used for processing API key signatures." + }, + "expirationSeconds": { + "type": "string", + "description": "Optional window (in seconds) indicating how long the API Key should last." + } + }, + "required": ["apiKeyName", "publicKey", "curveType"] + }, + "v1AppProof": { + "type": "object", + "properties": { + "scheme": { + "$ref": "#/definitions/v1SignatureScheme", + "description": "Scheme of signing key." + }, + "publicKey": { + "type": "string", + "description": "Ephemeral public key." + }, + "proofPayload": { + "type": "string", + "description": "JSON serialized AppProofPayload." + }, + "signature": { + "type": "string", + "description": "Signature over hashed proof_payload." + } + }, + "required": ["scheme", "publicKey", "proofPayload", "signature"] + }, + "v1Attestation": { + "type": "object", + "properties": { + "credentialId": { + "type": "string", + "description": "The cbor encoded then base64 url encoded id of the credential." + }, + "clientDataJson": { + "type": "string", + "description": "A base64 url encoded payload containing metadata about the signing context and the challenge." + }, + "attestationObject": { + "type": "string", + "description": "A base64 url encoded payload containing authenticator data and any attestation the webauthn provider chooses." + }, + "transports": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AuthenticatorTransport" + }, + "description": "The type of authenticator transports." + } + }, + "required": [ + "credentialId", + "clientDataJson", + "attestationObject", + "transports" + ] + }, + "v1AuthenticatorParamsV2": { + "type": "object", + "properties": { + "authenticatorName": { + "type": "string", + "description": "Human-readable name for an Authenticator." + }, + "challenge": { + "type": "string", + "description": "Challenge presented for authentication purposes." + }, + "attestation": { + "$ref": "#/definitions/v1Attestation", + "description": "The attestation that proves custody of the authenticator and provides metadata about it." + } + }, + "required": ["authenticatorName", "challenge", "attestation"] + }, + "v1AuthenticatorTransport": { + "type": "string", + "enum": [ + "AUTHENTICATOR_TRANSPORT_BLE", + "AUTHENTICATOR_TRANSPORT_INTERNAL", + "AUTHENTICATOR_TRANSPORT_NFC", + "AUTHENTICATOR_TRANSPORT_USB", + "AUTHENTICATOR_TRANSPORT_HYBRID" + ] + }, + "v1Curve": { + "type": "string", + "enum": ["CURVE_SECP256K1", "CURVE_ED25519"] + }, + "v1GetAccountRequest": { + "type": "object", + "properties": { + "filterType": { + "type": "string", + "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY'" + }, + "filterValue": { + "type": "string", + "description": "The value of the filter to apply for the specified type. For example, a specific email or name string." + }, + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact. Used to verify access to PII (email/phone number) when filter_type is 'EMAIL' or 'PHONE_NUMBER'." + } + }, + "required": ["filterType", "filterValue"] + }, + "v1GetAccountResponse": { + "type": "object", + "properties": { + "organizationId": { + "type": "string" + } + } + }, + "v1GetWalletKitConfigRequest": { + "type": "object" + }, + "v1GetWalletKitConfigResponse": { + "type": "object", + "properties": { + "enabledProviders": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of enabled authentication providers (e.g., 'facebook', 'google', 'apple', 'email', 'sms', 'passkey', 'wallet')", + "title": "Enabled Providers" + }, + "sessionExpirationSeconds": { + "type": "string", + "description": "Session expiration duration in seconds", + "title": "Session Expiration" + }, + "organizationId": { + "type": "string", + "description": "The organization ID this configuration applies to", + "title": "Organization ID" + }, + "oauthClientIds": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Mapping of social login providers to their OAuth client IDs.", + "title": "OAuth Client IDs" + }, + "oauthRedirectUrl": { + "type": "string", + "description": "OAuth redirect URL to be used for social login flows.", + "title": "OAuth Redirect URL" + }, + "otpAlphanumeric": { + "type": "boolean" + }, + "otpLength": { + "type": "string" + } + }, + "required": [ + "enabledProviders", + "sessionExpirationSeconds", + "organizationId" + ] + }, + "v1InitOtpRequest": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Enum to specifiy whether to send OTP via SMS or email" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + } + }, + "required": ["otpType", "contact"] + }, + "v1InitOtpResponse": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "Unique identifier for an OTP authentication" + } + }, + "required": ["otpId"] + }, + "v1OAuth2AuthenticateRequest": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/definitions/v1Oauth2Provider", + "description": "The OAuth 2.0 provider to authenticate with" + }, + "authCode": { + "type": "string", + "description": "The auth_code provided by the OAuth 2.0 to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow" + }, + "redirectUri": { + "type": "string", + "description": "The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider" + }, + "codeVerifier": { + "type": "string", + "description": "The code verifier used by OAuth 2.0 PKCE providers" + }, + "nonce": { + "type": "string", + "description": "An optional nonce used by the client to prevent replay/substitution of an ID token" + }, + "clientId": { + "type": "string", + "description": "The client ID registered with the OAuth 2.0 provider" + } + }, + "required": [ + "provider", + "authCode", + "redirectUri", + "codeVerifier", + "clientId" + ] + }, + "v1OAuth2AuthenticateResponse": { + "type": "object", + "properties": { + "oidcToken": { + "type": "string", + "description": "A Turnkey issued OIDC token to be used with the LoginWithOAuth activity" + } + }, + "required": ["oidcToken"] + }, + "v1OAuthLoginRequest": { + "type": "object", + "properties": { + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token" + }, + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request" + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Login API keys" + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization. If provided, this organization id will be used directly. If omitted, uses the OIDC token to look up the associated organization id." + } + }, + "required": ["oidcToken", "publicKey"] + }, + "v1OAuthLoginResponse": { + "type": "object", + "properties": { + "session": { + "type": "string", + "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + } + }, + "required": ["session"] + }, + "v1Oauth2Provider": { + "type": "string", + "enum": ["OAUTH2_PROVIDER_X", "OAUTH2_PROVIDER_DISCORD"] + }, + "v1OauthProviderParams": { + "type": "object", + "properties": { + "providerName": { + "type": "string", + "description": "Human-readable name to identify a Provider." + }, + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token" + } + }, + "required": ["providerName", "oidcToken"] + }, + "v1OtpLoginRequest": { + "type": "object", + "properties": { + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests)" + }, + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token" + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Login API keys" + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization. If provided, this organization id will be used directly. If omitted, uses the verification token to look up the verified sub-organization based on the contact and verification type." + }, + "clientSignature": { + "type": "string", + "description": "Optional signature associated with the public key passed into the verification step. This must be a hex-encoded ECDSA signature over the verification token. Only required if a public key was provided during the verification step." + } + }, + "required": ["verificationToken", "publicKey"] + }, + "v1OtpLoginResponse": { + "type": "object", + "properties": { + "session": { + "type": "string", + "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + } + }, + "required": ["session"] + }, + "v1PathFormat": { + "type": "string", + "enum": ["PATH_FORMAT_BIP32"] + }, + "v1SignatureScheme": { + "type": "string", + "enum": ["SIGNATURE_SCHEME_EPHEMERAL_KEY_P256"] + }, + "v1SignupRequest": { + "type": "object", + "properties": { + "userEmail": { + "type": "string" + }, + "userPhoneNumber": { + "type": "string" + }, + "userTag": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "organizationName": { + "type": "string" + }, + "verificationToken": { + "type": "string" + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKeyParamsV2" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + }, + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + }, + "wallet": { + "$ref": "#/definitions/v1WalletParams", + "description": "The wallet to create for the sub-organization" + } + }, + "required": ["apiKeys", "authenticators", "oauthProviders"] + }, + "v1SignupResponse": { + "type": "object", + "properties": { + "organizationId": { + "type": "string" + }, + "wallet": { + "$ref": "#/definitions/v1WalletResult", + "description": "Wallet created for the sub-organization, if provided in the request", + "title": "Wallet" + }, + "userId": { + "type": "string", + "description": "Root user ID created for this sub-organization", + "title": "User ID" + }, + "appProofs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AppProof" + }, + "description": "A list of app proofs generated by enclaves during activity execution, providing verifiable attestations of performed operations." + } + }, + "required": ["organizationId", "userId"] + }, + "v1VerifyOtpRequest": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "ID representing the result of an init OTP activity." + }, + "otpCode": { + "type": "string", + "description": "OTP sent out to a user's contact (email or SMS)" + }, + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be added to the JWT response and verified in subsequent requests via a client proof signature" + } + }, + "required": ["otpId", "otpCode"] + }, + "v1VerifyOtpResponse": { + "type": "object", + "properties": { + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests)" + } + }, + "required": ["verificationToken"] + }, + "v1WalletAccountParams": { + "type": "object", + "properties": { + "curve": { + "$ref": "#/definitions/v1Curve", + "description": "Cryptographic curve used to generate a wallet Account." + }, + "pathFormat": { + "$ref": "#/definitions/v1PathFormat", + "description": "Path format used to generate a wallet Account." + }, + "path": { + "type": "string", + "description": "Path used to generate a wallet Account." + }, + "addressFormat": { + "$ref": "#/definitions/v1AddressFormat", + "description": "Address format used to generate a wallet Acccount." + } + }, + "required": ["curve", "pathFormat", "path", "addressFormat"] + }, + "v1WalletParams": { + "type": "object", + "properties": { + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WalletAccountParams" + }, + "description": "A list of wallet Accounts. This field, if not needed, should be an empty array in your request body." + }, + "mnemonicLength": { + "type": "integer", + "format": "int32", + "description": "Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24." + } + }, + "required": ["walletName", "accounts"] + }, + "v1WalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of account addresses." + } + }, + "required": ["walletId", "addresses"] + } + } +} diff --git a/Scripts/Sources/Internal/Resources/public_api.swagger.json b/Scripts/Sources/Internal/Resources/public_api.swagger.json new file mode 100644 index 00000000..15a198c4 --- /dev/null +++ b/Scripts/Sources/Internal/Resources/public_api.swagger.json @@ -0,0 +1,11971 @@ +{ + "swagger": "2.0", + "info": { + "title": "API Reference", + "description": "Review our [API Introduction](../api-introduction) to get started.", + "version": "1.0", + "contact": {} + }, + "tags": [ + { + "name": "PublicApiService" + }, + { + "name": "Organizations", + "description": "An Organization is the highest level of hierarchy in Turnkey. It can contain many Users, Private Keys, and Policies managed by a Root Quorum. The Root Quorum consists of a set of Users with a consensus threshold. This consensus threshold must be reached by Quorum members in order for any actions to take place.\n\nSee [Root Quorum](../concepts/users/root-quorum) for more information" + }, + { + "name": "Invitations", + "description": "Invitations allow you to invite Users into your Organization via email. Alternatively, Users can be added directly without an Invitation if their ApiKey or Authenticator credentials are known ahead of time.\n\nSee [Users](./api#tag/Users) for more information" + }, + { + "name": "Policies", + "description": "Policies allow for deep customization of the security of your Organization. They can be used to grant permissions or restrict usage of Users and Private Keys. The Policy Engine analyzes all of your Policies on each request to determine whether an Activity is allowed.\n\nSee [Policy Overview](../managing-policies/overview) for more information" + }, + { + "name": "Wallets", + "description": "Wallets contain collections of deterministically generated cryptographic public / private key pairs that share a common seed. Turnkey securely holds the common seed, but only you can access it. In most cases, Wallets should be preferred over Private Keys since they can be represented by a mnemonic phrase, used across a variety of cryptographic curves, and can derive many addresses.\n\nDerived addresses can be used to create digital signatures using the corresponding underlying private key. See [Signing](./api#tag/Signing) for more information" + }, + { + "name": "Signing", + "description": "Signers allow you to create digital signatures. Signatures are used to validate the authenticity and integrity of a digital message. Turnkey makes it easy to produce signatures by allowing you to sign with an address. If Turnkey doesn't yet support an address format you need, you can generate and sign with the public key instead by using the address format `ADDRESS_FORMAT_COMPRESSED`." + }, + { + "name": "Private Keys", + "description": "Private Keys are cryptographic public / private key pairs that can be used for cryptocurrency needs or more generalized encryption. Turnkey securely holds all private key materials for you, but only you can access them.\n\nThe Private Key ID or any derived address can be used to create digital signatures. See [Signing](./api#tag/Signing) for more information" + }, + { + "name": "Private Key Tags", + "description": "Private Key Tags allow you to easily group and permission Private Keys through Policies." + }, + { + "name": "Users", + "description": "Users are responsible for any action taken within an Organization. They can have ApiKey or Auuthenticator credentials, allowing you to onboard teammates to the Organization, or create API-only Users to run as part of your infrastructure." + }, + { + "name": "User Tags", + "description": "User Key Tags allow you to easily group and permission Users through Policies." + }, + { + "name": "Authenticators", + "description": "Authenticators are WebAuthN hardware devices, such as a Macbook TouchID or Yubikey, that can be used to authenticate requests." + }, + { + "name": "API Keys", + "description": "API Keys are used to authenticate requests\n\nSee our [CLI](https://github.com/tkhq/tkcli) for instructions on generating API Keys" + }, + { + "name": "Activities", + "description": "Activities encapsulate all the possible actions that can be taken with Turnkey. Some examples include adding a new user, creating a private key, and signing a transaction.\n\nActivities that modify your Organization are processed asynchronously. To confirm processing is complete and retrieve the Activity results, these activities must be polled until that status has been updated to a finalized state: `COMPLETED` when the activity is successful or `FAILED` when the activity has failed" + }, + { + "name": "Consensus", + "description": "Policies can enforce consensus requirements for Activities. For example, adding a new user requires two admins to approve the request.\n\nActivities that have been proposed, but don't yet meet the Consesnsus requirements will have the status: `REQUIRES_CONSENSUS`. Activities in this state can be approved or rejected using the unique fingerprint generated when an Activity is created." + } + ], + "host": "api.turnkey.com", + "schemes": ["https"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/public/v1/query/get_activity": { + "post": { + "summary": "Get activity", + "description": "Get details about an activity.", + "operationId": "PublicApiService_GetActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetActivityRequest" + } + } + ], + "tags": ["Activities"] + } + }, + "/public/v1/query/get_api_key": { + "post": { + "summary": "Get API key", + "description": "Get details about an API key.", + "operationId": "PublicApiService_GetApiKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetApiKeyResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetApiKeyRequest" + } + } + ], + "tags": ["API keys"] + } + }, + "/public/v1/query/get_api_keys": { + "post": { + "summary": "Get API keys", + "description": "Get details about API keys for a user.", + "operationId": "PublicApiService_GetApiKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetApiKeysResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetApiKeysRequest" + } + } + ], + "tags": ["API keys"] + } + }, + "/public/v1/query/get_attestation": { + "post": { + "summary": "Attestation", + "description": "Get the attestation document corresponding to an enclave.", + "operationId": "PublicApiService_GetAttestationDocument", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetAttestationDocumentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetAttestationDocumentRequest" + } + } + ], + "tags": ["Attestation"] + } + }, + "/public/v1/query/get_authenticator": { + "post": { + "summary": "Get authenticator", + "description": "Get details about an authenticator.", + "operationId": "PublicApiService_GetAuthenticator", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetAuthenticatorResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetAuthenticatorRequest" + } + } + ], + "tags": ["Authenticators"] + } + }, + "/public/v1/query/get_authenticators": { + "post": { + "summary": "Get authenticators", + "description": "Get details about authenticators for a user.", + "operationId": "PublicApiService_GetAuthenticators", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetAuthenticatorsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetAuthenticatorsRequest" + } + } + ], + "tags": ["Authenticators"] + } + }, + "/public/v1/query/get_boot_proof": { + "post": { + "summary": "Get a specific boot proof", + "description": "Get the boot proof for a given ephemeral key.", + "operationId": "PublicApiService_GetBootProof", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1BootProofResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetBootProofRequest" + } + } + ], + "tags": ["Boot Proof"] + } + }, + "/public/v1/query/get_latest_boot_proof": { + "post": { + "summary": "Get the latest boot proof for an app", + "description": "Get the latest boot proof for a given enclave app name.", + "operationId": "PublicApiService_GetLatestBootProof", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1BootProofResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetLatestBootProofRequest" + } + } + ], + "tags": ["Boot Proof"] + } + }, + "/public/v1/query/get_oauth2_credential": { + "post": { + "summary": "Get OAuth 2.0 credential", + "description": "Get details about an OAuth 2.0 credential.", + "operationId": "PublicApiService_GetOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetOauth2CredentialResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetOauth2CredentialRequest" + } + } + ], + "tags": ["PublicApiService"] + } + }, + "/public/v1/query/get_oauth_providers": { + "post": { + "summary": "Get Oauth providers", + "description": "Get details about Oauth providers for a user.", + "operationId": "PublicApiService_GetOauthProviders", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetOauthProvidersResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetOauthProvidersRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/query/get_organization": { + "post": { + "summary": "Get organization", + "description": "Get details about an organization.", + "operationId": "PublicApiService_GetOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetOrganizationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetOrganizationRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/query/get_organization_configs": { + "post": { + "summary": "Get configs", + "description": "Get quorum settings and features for an organization.", + "operationId": "PublicApiService_GetOrganizationConfigs", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetOrganizationConfigsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetOrganizationConfigsRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/query/get_policy": { + "post": { + "summary": "Get policy", + "description": "Get details about a policy.", + "operationId": "PublicApiService_GetPolicy", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetPolicyResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetPolicyRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/query/get_policy_evaluations": { + "post": { + "summary": "Get policy evaluations", + "description": "Get the policy evaluations for an activity.", + "operationId": "PublicApiService_GetPolicyEvaluations", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetPolicyEvaluationsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetPolicyEvaluationsRequest" + } + } + ], + "tags": ["Activities"] + } + }, + "/public/v1/query/get_private_key": { + "post": { + "summary": "Get private key", + "description": "Get details about a private key.", + "operationId": "PublicApiService_GetPrivateKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetPrivateKeyResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetPrivateKeyRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/query/get_smart_contract_interface": { + "post": { + "summary": "Get smart contract interface", + "description": "Get details about a smart contract interface.", + "operationId": "PublicApiService_GetSmartContractInterface", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetSmartContractInterfaceResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetSmartContractInterfaceRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/query/get_user": { + "post": { + "summary": "Get user", + "description": "Get details about a user.", + "operationId": "PublicApiService_GetUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetUserResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetUserRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/query/get_wallet": { + "post": { + "summary": "Get wallet", + "description": "Get details about a wallet.", + "operationId": "PublicApiService_GetWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetWalletResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/query/get_wallet_account": { + "post": { + "summary": "Get wallet account", + "description": "Get a single wallet account.", + "operationId": "PublicApiService_GetWalletAccount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetWalletAccountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetWalletAccountRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/query/list_activities": { + "post": { + "summary": "List activities", + "description": "List all activities within an organization.", + "operationId": "PublicApiService_GetActivities", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetActivitiesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetActivitiesRequest" + } + } + ], + "tags": ["Activities"] + } + }, + "/public/v1/query/list_app_proofs": { + "post": { + "summary": "List app proofs for an activity", + "description": "List the app proofs for the given activity.", + "operationId": "PublicApiService_GetAppProofs", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetAppProofsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetAppProofsRequest" + } + } + ], + "tags": ["App Proof"] + } + }, + "/public/v1/query/list_oauth2_credentials": { + "post": { + "summary": "List OAuth 2.0 Credentials", + "description": "List all OAuth 2.0 credentials within an organization.", + "operationId": "PublicApiService_ListOauth2Credentials", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListOauth2CredentialsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ListOauth2CredentialsRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/query/list_policies": { + "post": { + "summary": "List policies", + "description": "List all policies within an organization.", + "operationId": "PublicApiService_GetPolicies", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetPoliciesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetPoliciesRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/query/list_private_key_tags": { + "post": { + "summary": "List private key tags", + "description": "List all private key tags within an organization.", + "operationId": "PublicApiService_ListPrivateKeyTags", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListPrivateKeyTagsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ListPrivateKeyTagsRequest" + } + } + ], + "tags": ["Private Key Tags"] + } + }, + "/public/v1/query/list_private_keys": { + "post": { + "summary": "List private keys", + "description": "List all private keys within an organization.", + "operationId": "PublicApiService_GetPrivateKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetPrivateKeysResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetPrivateKeysRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/query/list_smart_contract_interfaces": { + "post": { + "summary": "List smart contract interfaces", + "description": "List all smart contract interfaces within an organization.", + "operationId": "PublicApiService_GetSmartContractInterfaces", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetSmartContractInterfacesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetSmartContractInterfacesRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/query/list_suborgs": { + "post": { + "summary": "Get sub-organizations", + "description": "Get all suborg IDs associated given a parent org ID and an optional filter.", + "operationId": "PublicApiService_GetSubOrgIds", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetSubOrgIdsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetSubOrgIdsRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/query/list_user_tags": { + "post": { + "summary": "List user tags", + "description": "List all user tags within an organization.", + "operationId": "PublicApiService_ListUserTags", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListUserTagsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ListUserTagsRequest" + } + } + ], + "tags": ["User Tags"] + } + }, + "/public/v1/query/list_users": { + "post": { + "summary": "List users", + "description": "List all users within an organization.", + "operationId": "PublicApiService_GetUsers", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetUsersResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetUsersRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/query/list_verified_suborgs": { + "post": { + "summary": "Get verified sub-organizations", + "description": "Get all email or phone verified suborg IDs associated given a parent org ID.", + "operationId": "PublicApiService_GetVerifiedSubOrgIds", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetVerifiedSubOrgIdsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetVerifiedSubOrgIdsRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/query/list_wallet_accounts": { + "post": { + "summary": "List wallets accounts", + "description": "List all accounts within a wallet.", + "operationId": "PublicApiService_GetWalletAccounts", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetWalletAccountsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetWalletAccountsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/query/list_wallets": { + "post": { + "summary": "List wallets", + "description": "List all wallets within an organization.", + "operationId": "PublicApiService_GetWallets", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetWalletsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetWalletsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/query/whoami": { + "post": { + "summary": "Who am I?", + "description": "Get basic information about your current API or WebAuthN user and their organization. Affords sub-organization look ups via parent organization for WebAuthN or API key users.", + "operationId": "PublicApiService_GetWhoami", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetWhoamiResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetWhoamiRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/approve_activity": { + "post": { + "summary": "Approve activity", + "description": "Approve an activity.", + "operationId": "PublicApiService_ApproveActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ApproveActivityRequest" + } + } + ], + "tags": ["Consensus"] + } + }, + "/public/v1/submit/create_api_keys": { + "post": { + "summary": "Create API keys", + "description": "Add API keys to an existing user.", + "operationId": "PublicApiService_CreateApiKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateApiKeysRequest" + } + } + ], + "tags": ["API Keys"] + } + }, + "/public/v1/submit/create_api_only_users": { + "post": { + "summary": "Create API-only users", + "description": "Create API-only users in an existing organization.", + "operationId": "PublicApiService_CreateApiOnlyUsers", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateApiOnlyUsersRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/create_authenticators": { + "post": { + "summary": "Create authenticators", + "description": "Create authenticators to authenticate requests to Turnkey.", + "operationId": "PublicApiService_CreateAuthenticators", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateAuthenticatorsRequest" + } + } + ], + "tags": ["Authenticators"] + } + }, + "/public/v1/submit/create_invitations": { + "post": { + "summary": "Create invitations", + "description": "Create invitations to join an existing organization.", + "operationId": "PublicApiService_CreateInvitations", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateInvitationsRequest" + } + } + ], + "tags": ["Invitations"] + } + }, + "/public/v1/submit/create_oauth2_credential": { + "post": { + "summary": "Create an OAuth 2.0 Credential", + "description": "Enable authentication for end users with an OAuth 2.0 provider", + "operationId": "PublicApiService_CreateOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateOauth2CredentialRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/create_oauth_providers": { + "post": { + "summary": "Create Oauth providers", + "description": "Create Oauth providers for a specified user.", + "operationId": "PublicApiService_CreateOauthProviders", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateOauthProvidersRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/create_policies": { + "post": { + "summary": "Create policies", + "description": "Create new policies.", + "operationId": "PublicApiService_CreatePolicies", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreatePoliciesRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/create_policy": { + "post": { + "summary": "Create policy", + "description": "Create a new policy.", + "operationId": "PublicApiService_CreatePolicy", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreatePolicyRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/create_private_key_tag": { + "post": { + "summary": "Create private key tag", + "description": "Create a private key tag and add it to private keys.", + "operationId": "PublicApiService_CreatePrivateKeyTag", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreatePrivateKeyTagRequest" + } + } + ], + "tags": ["Private Key Tags"] + } + }, + "/public/v1/submit/create_private_keys": { + "post": { + "summary": "Create private keys", + "description": "Create new private keys.", + "operationId": "PublicApiService_CreatePrivateKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreatePrivateKeysRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/submit/create_read_only_session": { + "post": { + "summary": "Create read only session", + "description": "Create a read only session for a user (valid for 1 hour).", + "operationId": "PublicApiService_CreateReadOnlySession", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateReadOnlySessionRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/create_read_write_session": { + "post": { + "summary": "Create read write session", + "description": "Create a read write session for a user.", + "operationId": "PublicApiService_CreateReadWriteSession", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateReadWriteSessionRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/create_smart_contract_interface": { + "post": { + "summary": "Create smart contract interface", + "description": "Create an ABI/IDL in JSON.", + "operationId": "PublicApiService_CreateSmartContractInterface", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateSmartContractInterfaceRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/create_sub_organization": { + "post": { + "summary": "Create sub-organization", + "description": "Create a new sub-organization.", + "operationId": "PublicApiService_CreateSubOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateSubOrganizationRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/submit/create_user_tag": { + "post": { + "summary": "Create user tag", + "description": "Create a user tag and add it to users.", + "operationId": "PublicApiService_CreateUserTag", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateUserTagRequest" + } + } + ], + "tags": ["User Tags"] + } + }, + "/public/v1/submit/create_users": { + "post": { + "summary": "Create users", + "description": "Create users in an existing organization.", + "operationId": "PublicApiService_CreateUsers", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateUsersRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/create_wallet": { + "post": { + "summary": "Create wallet", + "description": "Create a wallet and derive addresses.", + "operationId": "PublicApiService_CreateWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/create_wallet_accounts": { + "post": { + "summary": "Create wallet accounts", + "description": "Derive additional addresses using an existing wallet.", + "operationId": "PublicApiService_CreateWalletAccounts", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateWalletAccountsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/delete_api_keys": { + "post": { + "summary": "Delete API keys", + "description": "Remove api keys from a user.", + "operationId": "PublicApiService_DeleteApiKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteApiKeysRequest" + } + } + ], + "tags": ["API Keys"] + } + }, + "/public/v1/submit/delete_authenticators": { + "post": { + "summary": "Delete authenticators", + "description": "Remove authenticators from a user.", + "operationId": "PublicApiService_DeleteAuthenticators", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteAuthenticatorsRequest" + } + } + ], + "tags": ["Authenticators"] + } + }, + "/public/v1/submit/delete_invitation": { + "post": { + "summary": "Delete invitation", + "description": "Delete an existing invitation.", + "operationId": "PublicApiService_DeleteInvitation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteInvitationRequest" + } + } + ], + "tags": ["Invitations"] + } + }, + "/public/v1/submit/delete_oauth2_credential": { + "post": { + "summary": "Delete an OAuth 2.0 Credential", + "description": "Disable authentication for end users with an OAuth 2.0 provider", + "operationId": "PublicApiService_DeleteOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteOauth2CredentialRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/delete_oauth_providers": { + "post": { + "summary": "Delete Oauth providers", + "description": "Remove Oauth providers for a specified user.", + "operationId": "PublicApiService_DeleteOauthProviders", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteOauthProvidersRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/delete_policies": { + "post": { + "summary": "Delete policies", + "description": "Delete existing policies.", + "operationId": "PublicApiService_DeletePolicies", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeletePoliciesRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/delete_policy": { + "post": { + "summary": "Delete policy", + "description": "Delete an existing policy.", + "operationId": "PublicApiService_DeletePolicy", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeletePolicyRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/delete_private_key_tags": { + "post": { + "summary": "Delete private key tags", + "description": "Delete private key tags within an organization.", + "operationId": "PublicApiService_DeletePrivateKeyTags", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeletePrivateKeyTagsRequest" + } + } + ], + "tags": ["Private Key Tags"] + } + }, + "/public/v1/submit/delete_private_keys": { + "post": { + "summary": "Delete private keys", + "description": "Delete private keys for an organization.", + "operationId": "PublicApiService_DeletePrivateKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeletePrivateKeysRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/submit/delete_smart_contract_interface": { + "post": { + "summary": "Delete smart contract interface", + "description": "Delete a smart contract interface.", + "operationId": "PublicApiService_DeleteSmartContractInterface", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteSmartContractInterfaceRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/delete_sub_organization": { + "post": { + "summary": "Delete sub-organization", + "description": "Delete a sub-organization.", + "operationId": "PublicApiService_DeleteSubOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteSubOrganizationRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/submit/delete_user_tags": { + "post": { + "summary": "Delete user tags", + "description": "Delete user tags within an organization.", + "operationId": "PublicApiService_DeleteUserTags", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteUserTagsRequest" + } + } + ], + "tags": ["User Tags"] + } + }, + "/public/v1/submit/delete_users": { + "post": { + "summary": "Delete users", + "description": "Delete users within an organization.", + "operationId": "PublicApiService_DeleteUsers", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteUsersRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/delete_wallet_accounts": { + "post": { + "summary": "Delete wallet accounts", + "description": "Delete wallet accounts for an organization.", + "operationId": "PublicApiService_DeleteWalletAccounts", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteWalletAccountsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/delete_wallets": { + "post": { + "summary": "Delete wallets", + "description": "Delete wallets for an organization.", + "operationId": "PublicApiService_DeleteWallets", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteWalletsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/email_auth": { + "post": { + "summary": "Perform email auth", + "description": "Authenticate a user via email.", + "operationId": "PublicApiService_EmailAuth", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1EmailAuthRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/export_private_key": { + "post": { + "summary": "Export private key", + "description": "Export a private key.", + "operationId": "PublicApiService_ExportPrivateKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ExportPrivateKeyRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/submit/export_wallet": { + "post": { + "summary": "Export wallet", + "description": "Export a wallet.", + "operationId": "PublicApiService_ExportWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ExportWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/export_wallet_account": { + "post": { + "summary": "Export wallet account", + "description": "Export a wallet account.", + "operationId": "PublicApiService_ExportWalletAccount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ExportWalletAccountRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/import_private_key": { + "post": { + "summary": "Import private key", + "description": "Import a private key.", + "operationId": "PublicApiService_ImportPrivateKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ImportPrivateKeyRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/submit/import_wallet": { + "post": { + "summary": "Import wallet", + "description": "Import a wallet.", + "operationId": "PublicApiService_ImportWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ImportWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/init_fiat_on_ramp": { + "post": { + "summary": "Init fiat on ramp", + "description": "Initiate a fiat on ramp flow.", + "operationId": "PublicApiService_InitFiatOnRamp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitFiatOnRampRequest" + } + } + ], + "tags": ["On Ramp"] + } + }, + "/public/v1/submit/init_import_private_key": { + "post": { + "summary": "Init import private key", + "description": "Initialize a new private key import.", + "operationId": "PublicApiService_InitImportPrivateKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitImportPrivateKeyRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/submit/init_import_wallet": { + "post": { + "summary": "Init import wallet", + "description": "Initialize a new wallet import.", + "operationId": "PublicApiService_InitImportWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitImportWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/init_otp": { + "post": { + "summary": "Init generic OTP", + "description": "Initiate a generic OTP activity.", + "operationId": "PublicApiService_InitOtp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitOtpRequest" + } + } + ], + "tags": ["User Verification"] + } + }, + "/public/v1/submit/init_otp_auth": { + "post": { + "summary": "Init OTP auth", + "description": "Initiate an OTP auth activity.", + "operationId": "PublicApiService_InitOtpAuth", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitOtpAuthRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/init_user_email_recovery": { + "post": { + "summary": "Init email recovery", + "description": "Initialize a new email recovery.", + "operationId": "PublicApiService_InitUserEmailRecovery", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitUserEmailRecoveryRequest" + } + } + ], + "tags": ["User Recovery"] + } + }, + "/public/v1/submit/oauth": { + "post": { + "summary": "Oauth", + "description": "Authenticate a user with an OIDC token (Oauth).", + "operationId": "PublicApiService_Oauth", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1OauthRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/oauth2_authenticate": { + "post": { + "summary": "OAuth 2.0 authentication", + "description": "Authenticate a user with an OAuth 2.0 provider and receive an OIDC token to use with the LoginWithOAuth or CreateSubOrganization activities", + "operationId": "PublicApiService_Oauth2Authenticate", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1Oauth2AuthenticateRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/oauth_login": { + "post": { + "summary": "Login with Oauth", + "description": "Create an Oauth session for a user.", + "operationId": "PublicApiService_OauthLogin", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1OauthLoginRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/otp_auth": { + "post": { + "summary": "OTP auth", + "description": "Authenticate a user with an OTP code sent via email or SMS.", + "operationId": "PublicApiService_OtpAuth", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1OtpAuthRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/otp_login": { + "post": { + "summary": "Login with OTP", + "description": "Create an OTP session for a user.", + "operationId": "PublicApiService_OtpLogin", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1OtpLoginRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/recover_user": { + "post": { + "summary": "Recover a user", + "description": "Complete the process of recovering a user by adding an authenticator.", + "operationId": "PublicApiService_RecoverUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RecoverUserRequest" + } + } + ], + "tags": ["User Recovery"] + } + }, + "/public/v1/submit/reject_activity": { + "post": { + "summary": "Reject activity", + "description": "Reject an activity.", + "operationId": "PublicApiService_RejectActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RejectActivityRequest" + } + } + ], + "tags": ["Consensus"] + } + }, + "/public/v1/submit/remove_organization_feature": { + "post": { + "summary": "Remove organization feature", + "description": "Remove an organization feature. This activity must be approved by the current root quorum.", + "operationId": "PublicApiService_RemoveOrganizationFeature", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RemoveOrganizationFeatureRequest" + } + } + ], + "tags": ["Features"] + } + }, + "/public/v1/submit/set_organization_feature": { + "post": { + "summary": "Set organization feature", + "description": "Set an organization feature. This activity must be approved by the current root quorum.", + "operationId": "PublicApiService_SetOrganizationFeature", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SetOrganizationFeatureRequest" + } + } + ], + "tags": ["Features"] + } + }, + "/public/v1/submit/sign_raw_payload": { + "post": { + "summary": "Sign raw payload", + "description": "Sign a raw payload.", + "operationId": "PublicApiService_SignRawPayload", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SignRawPayloadRequest" + } + } + ], + "tags": ["Signing"] + } + }, + "/public/v1/submit/sign_raw_payloads": { + "post": { + "summary": "Sign raw payloads", + "description": "Sign multiple raw payloads with the same signing parameters.", + "operationId": "PublicApiService_SignRawPayloads", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SignRawPayloadsRequest" + } + } + ], + "tags": ["Signing"] + } + }, + "/public/v1/submit/sign_transaction": { + "post": { + "summary": "Sign transaction", + "description": "Sign a transaction.", + "operationId": "PublicApiService_SignTransaction", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SignTransactionRequest" + } + } + ], + "tags": ["Signing"] + } + }, + "/public/v1/submit/stamp_login": { + "post": { + "summary": "Login with a stamp", + "description": "Create a session for a user through stamping client side (API key, wallet client, or passkey client).", + "operationId": "PublicApiService_StampLogin", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StampLoginRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/update_oauth2_credential": { + "post": { + "summary": "Update an OAuth 2.0 Credential", + "description": "Update an OAuth 2.0 provider credential", + "operationId": "PublicApiService_UpdateOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateOauth2CredentialRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/update_policy": { + "post": { + "summary": "Update policy", + "description": "Update an existing policy.", + "operationId": "PublicApiService_UpdatePolicy", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdatePolicyRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/update_private_key_tag": { + "post": { + "summary": "Update private key tag", + "description": "Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.", + "operationId": "PublicApiService_UpdatePrivateKeyTag", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagRequest" + } + } + ], + "tags": ["Private Key Tags"] + } + }, + "/public/v1/submit/update_root_quorum": { + "post": { + "summary": "Update root quorum", + "description": "Set the threshold and members of the root quorum. This activity must be approved by the current root quorum.", + "operationId": "PublicApiService_UpdateRootQuorum", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateRootQuorumRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/submit/update_user": { + "post": { + "summary": "Update user", + "description": "Update a user in an existing organization.", + "operationId": "PublicApiService_UpdateUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/update_user_email": { + "post": { + "summary": "Update user's email", + "description": "Update a user's email in an existing organization.", + "operationId": "PublicApiService_UpdateUserEmail", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserEmailRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/update_user_name": { + "post": { + "summary": "Update user's name", + "description": "Update a user's name in an existing organization.", + "operationId": "PublicApiService_UpdateUserName", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserNameRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/update_user_phone_number": { + "post": { + "summary": "Update user's phone number", + "description": "Update a user's phone number in an existing organization.", + "operationId": "PublicApiService_UpdateUserPhoneNumber", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserPhoneNumberRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/update_user_tag": { + "post": { + "summary": "Update user tag", + "description": "Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.", + "operationId": "PublicApiService_UpdateUserTag", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserTagRequest" + } + } + ], + "tags": ["User Tags"] + } + }, + "/public/v1/submit/update_wallet": { + "post": { + "summary": "Update wallet", + "description": "Update a wallet for an organization.", + "operationId": "PublicApiService_UpdateWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/verify_otp": { + "post": { + "summary": "Verify generic OTP", + "description": "Verify a generic OTP.", + "operationId": "PublicApiService_VerifyOtp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1VerifyOtpRequest" + } + } + ], + "tags": ["User Verification"] + } + }, + "/tkhq/api/v1/noop-codegen-anchor": { + "post": { + "operationId": "PublicApiService_NOOPCodegenAnchor", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1NOOPCodegenAnchorResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": ["PublicApiService"] + } + }, + "/tkhq/api/v1/test_rate_limits": { + "post": { + "summary": "Test rate limit", + "description": "Set a rate local rate limit just on the current endpoint, for purposes of testing with Vivosuite.", + "operationId": "PublicApiService_TestRateLimits", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1TestRateLimitsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1TestRateLimitsRequest" + } + } + ], + "tags": ["RateLimit"] + } + } + }, + "definitions": { + "apiApiKeyParams": { + "type": "object", + "properties": { + "apiKeyName": { + "type": "string", + "description": "Human-readable name for an API Key." + }, + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to sign messages and transactions." + }, + "expirationSeconds": { + "type": "string", + "description": "Optional window (in seconds) indicating how long the API Key should last." + } + }, + "required": ["apiKeyName", "publicKey"] + }, + "billingActivateBillingTierIntent": { + "type": "object", + "properties": { + "productId": { + "type": "string", + "description": "The product that the customer wants to subscribe to." + } + }, + "required": ["productId"] + }, + "billingActivateBillingTierResult": { + "type": "object", + "properties": { + "productId": { + "type": "string", + "description": "The id of the product being subscribed to." + } + }, + "required": ["productId"] + }, + "billingDeletePaymentMethodIntent": { + "type": "object", + "properties": { + "paymentMethodId": { + "type": "string", + "description": "The payment method that the customer wants to remove." + } + }, + "required": ["paymentMethodId"] + }, + "billingDeletePaymentMethodResult": { + "type": "object", + "properties": { + "paymentMethodId": { + "type": "string", + "description": "The payment method that was removed." + } + }, + "required": ["paymentMethodId"] + }, + "billingSetPaymentMethodIntent": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "The account number of the customer's credit card." + }, + "cvv": { + "type": "string", + "description": "The verification digits of the customer's credit card." + }, + "expiryMonth": { + "type": "string", + "description": "The month that the credit card expires." + }, + "expiryYear": { + "type": "string", + "description": "The year that the credit card expires." + }, + "cardHolderEmail": { + "type": "string", + "description": "The email that will receive invoices for the credit card." + }, + "cardHolderName": { + "type": "string", + "description": "The name associated with the credit card." + } + }, + "required": [ + "number", + "cvv", + "expiryMonth", + "expiryYear", + "cardHolderEmail", + "cardHolderName" + ] + }, + "billingSetPaymentMethodIntentV2": { + "type": "object", + "properties": { + "paymentMethodId": { + "type": "string", + "description": "The id of the payment method that was created clientside." + }, + "cardHolderEmail": { + "type": "string", + "description": "The email that will receive invoices for the credit card." + }, + "cardHolderName": { + "type": "string", + "description": "The name associated with the credit card." + } + }, + "required": ["paymentMethodId", "cardHolderEmail", "cardHolderName"] + }, + "billingSetPaymentMethodResult": { + "type": "object", + "properties": { + "lastFour": { + "type": "string", + "description": "The last four digits of the credit card added." + }, + "cardHolderName": { + "type": "string", + "description": "The name associated with the payment method." + }, + "cardHolderEmail": { + "type": "string", + "description": "The email address associated with the payment method." + } + }, + "required": ["lastFour", "cardHolderName", "cardHolderEmail"] + }, + "datav1Tag": { + "type": "object", + "properties": { + "tagId": { + "type": "string", + "description": "Unique identifier for a given Tag." + }, + "tagName": { + "type": "string", + "description": "Human-readable name for a Tag." + }, + "tagType": { + "$ref": "#/definitions/v1TagType" + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": ["tagId", "tagName", "tagType", "createdAt", "updatedAt"] + }, + "externalactivityv1PolicyEvaluation": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for a given policy evaluation." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given Activity." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for the Organization the Activity belongs to." + }, + "voteId": { + "type": "string", + "description": "Unique identifier for the Vote associated with this policy evaluation." + }, + "policyEvaluations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/immutablecommonv1PolicyEvaluation" + }, + "description": "Detailed evaluation result for each Policy that was run." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "id", + "activityId", + "organizationId", + "voteId", + "policyEvaluations", + "createdAt" + ] + }, + "externaldatav1Address": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/v1AddressFormat" + }, + "address": { + "type": "string" + } + } + }, + "externaldatav1Credential": { + "type": "object", + "properties": { + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to sign messages and transactions." + }, + "type": { + "$ref": "#/definitions/v1CredentialType" + } + }, + "required": ["publicKey", "type"] + }, + "externaldatav1Quorum": { + "type": "object", + "properties": { + "threshold": { + "type": "integer", + "format": "int32", + "description": "Count of unique approvals required to meet quorum." + }, + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique identifiers of quorum set members." + } + }, + "required": ["threshold", "userIds"] + }, + "externaldatav1Timestamp": { + "type": "object", + "properties": { + "seconds": { + "type": "string" + }, + "nanos": { + "type": "string" + } + }, + "required": ["seconds", "nanos"] + }, + "immutableactivityv1Address": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/v1AddressFormat" + }, + "address": { + "type": "string" + } + } + }, + "immutablecommonv1PolicyEvaluation": { + "type": "object", + "properties": { + "policyId": { + "type": "string" + }, + "outcome": { + "$ref": "#/definitions/v1Outcome" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1AcceptInvitationIntent": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation object." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "authenticator": { + "$ref": "#/definitions/v1AuthenticatorParams", + "description": "WebAuthN hardware devices that can be used to log in to the Turnkey web app." + } + }, + "required": ["invitationId", "userId", "authenticator"] + }, + "v1AcceptInvitationIntentV2": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation object." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "authenticator": { + "$ref": "#/definitions/v1AuthenticatorParamsV2", + "description": "WebAuthN hardware devices that can be used to log in to the Turnkey web app." + } + }, + "required": ["invitationId", "userId", "authenticator"] + }, + "v1AcceptInvitationResult": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + } + }, + "required": ["invitationId", "userId"] + }, + "v1AccessType": { + "type": "string", + "enum": ["ACCESS_TYPE_WEB", "ACCESS_TYPE_API", "ACCESS_TYPE_ALL"] + }, + "v1Activity": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for a given Activity object." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "status": { + "$ref": "#/definitions/v1ActivityStatus", + "description": "The current processing status of a specified Activity." + }, + "type": { + "$ref": "#/definitions/v1ActivityType", + "description": "Type of Activity, such as Add User, or Sign Transaction." + }, + "intent": { + "$ref": "#/definitions/v1Intent", + "description": "Intent object crafted by Turnkey based on the user request, used to assess the permissibility of an action." + }, + "result": { + "$ref": "#/definitions/v1Result", + "description": "Result of the intended action." + }, + "votes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Vote" + }, + "description": "A list of objects representing a particular User's approval or rejection of a Consensus request, including all relevant metadata." + }, + "appProofs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AppProof" + }, + "description": "A list of app proofs generated by enclaves during activity execution, providing verifiable attestations of performed operations." + }, + "fingerprint": { + "type": "string", + "description": "An artifact verifying a User's action." + }, + "canApprove": { + "type": "boolean" + }, + "canReject": { + "type": "boolean" + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "failure": { + "$ref": "#/definitions/rpcStatus", + "description": "Failure reason of the intended action." + } + }, + "required": [ + "id", + "organizationId", + "status", + "type", + "intent", + "result", + "votes", + "fingerprint", + "canApprove", + "canReject", + "createdAt", + "updatedAt" + ] + }, + "v1ActivityResponse": { + "type": "object", + "properties": { + "activity": { + "$ref": "#/definitions/v1Activity", + "description": "An action that can be taken within the Turnkey infrastructure." + } + }, + "required": ["activity"] + }, + "v1ActivityStatus": { + "type": "string", + "enum": [ + "ACTIVITY_STATUS_CREATED", + "ACTIVITY_STATUS_PENDING", + "ACTIVITY_STATUS_COMPLETED", + "ACTIVITY_STATUS_FAILED", + "ACTIVITY_STATUS_CONSENSUS_NEEDED", + "ACTIVITY_STATUS_REJECTED" + ] + }, + "v1ActivityType": { + "type": "string", + "enum": [ + "ACTIVITY_TYPE_CREATE_API_KEYS", + "ACTIVITY_TYPE_CREATE_USERS", + "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS", + "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD", + "ACTIVITY_TYPE_CREATE_INVITATIONS", + "ACTIVITY_TYPE_ACCEPT_INVITATION", + "ACTIVITY_TYPE_CREATE_POLICY", + "ACTIVITY_TYPE_DISABLE_PRIVATE_KEY", + "ACTIVITY_TYPE_DELETE_USERS", + "ACTIVITY_TYPE_DELETE_API_KEYS", + "ACTIVITY_TYPE_DELETE_INVITATION", + "ACTIVITY_TYPE_DELETE_ORGANIZATION", + "ACTIVITY_TYPE_DELETE_POLICY", + "ACTIVITY_TYPE_CREATE_USER_TAG", + "ACTIVITY_TYPE_DELETE_USER_TAGS", + "ACTIVITY_TYPE_CREATE_ORGANIZATION", + "ACTIVITY_TYPE_SIGN_TRANSACTION", + "ACTIVITY_TYPE_APPROVE_ACTIVITY", + "ACTIVITY_TYPE_REJECT_ACTIVITY", + "ACTIVITY_TYPE_DELETE_AUTHENTICATORS", + "ACTIVITY_TYPE_CREATE_AUTHENTICATORS", + "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG", + "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS", + "ACTIVITY_TYPE_SET_PAYMENT_METHOD", + "ACTIVITY_TYPE_ACTIVATE_BILLING_TIER", + "ACTIVITY_TYPE_DELETE_PAYMENT_METHOD", + "ACTIVITY_TYPE_CREATE_POLICY_V2", + "ACTIVITY_TYPE_CREATE_POLICY_V3", + "ACTIVITY_TYPE_CREATE_API_ONLY_USERS", + "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM", + "ACTIVITY_TYPE_UPDATE_USER_TAG", + "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG", + "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2", + "ACTIVITY_TYPE_CREATE_ORGANIZATION_V2", + "ACTIVITY_TYPE_CREATE_USERS_V2", + "ACTIVITY_TYPE_ACCEPT_INVITATION_V2", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2", + "ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS", + "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2", + "ACTIVITY_TYPE_UPDATE_USER", + "ACTIVITY_TYPE_UPDATE_POLICY", + "ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3", + "ACTIVITY_TYPE_CREATE_WALLET", + "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS", + "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY", + "ACTIVITY_TYPE_RECOVER_USER", + "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE", + "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE", + "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2", + "ACTIVITY_TYPE_SIGN_TRANSACTION_V2", + "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY", + "ACTIVITY_TYPE_EXPORT_WALLET", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4", + "ACTIVITY_TYPE_EMAIL_AUTH", + "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT", + "ACTIVITY_TYPE_INIT_IMPORT_WALLET", + "ACTIVITY_TYPE_IMPORT_WALLET", + "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY", + "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY", + "ACTIVITY_TYPE_CREATE_POLICIES", + "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS", + "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION", + "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS", + "ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5", + "ACTIVITY_TYPE_OAUTH", + "ACTIVITY_TYPE_CREATE_API_KEYS_V2", + "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION", + "ACTIVITY_TYPE_EMAIL_AUTH_V2", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6", + "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS", + "ACTIVITY_TYPE_DELETE_WALLETS", + "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2", + "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION", + "ACTIVITY_TYPE_INIT_OTP_AUTH", + "ACTIVITY_TYPE_OTP_AUTH", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7", + "ACTIVITY_TYPE_UPDATE_WALLET", + "ACTIVITY_TYPE_UPDATE_POLICY_V2", + "ACTIVITY_TYPE_CREATE_USERS_V3", + "ACTIVITY_TYPE_INIT_OTP_AUTH_V2", + "ACTIVITY_TYPE_INIT_OTP", + "ACTIVITY_TYPE_VERIFY_OTP", + "ACTIVITY_TYPE_OTP_LOGIN", + "ACTIVITY_TYPE_STAMP_LOGIN", + "ACTIVITY_TYPE_OAUTH_LOGIN", + "ACTIVITY_TYPE_UPDATE_USER_NAME", + "ACTIVITY_TYPE_UPDATE_USER_EMAIL", + "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER", + "ACTIVITY_TYPE_INIT_FIAT_ON_RAMP", + "ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE", + "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE", + "ACTIVITY_TYPE_ENABLE_AUTH_PROXY", + "ACTIVITY_TYPE_DISABLE_AUTH_PROXY", + "ACTIVITY_TYPE_UPDATE_AUTH_PROXY_CONFIG", + "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL", + "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL", + "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL", + "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE", + "ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS", + "ACTIVITY_TYPE_DELETE_POLICIES" + ] + }, + "v1AddressFormat": { + "type": "string", + "enum": [ + "ADDRESS_FORMAT_UNCOMPRESSED", + "ADDRESS_FORMAT_COMPRESSED", + "ADDRESS_FORMAT_ETHEREUM", + "ADDRESS_FORMAT_SOLANA", + "ADDRESS_FORMAT_COSMOS", + "ADDRESS_FORMAT_TRON", + "ADDRESS_FORMAT_SUI", + "ADDRESS_FORMAT_APTOS", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR", + "ADDRESS_FORMAT_SEI", + "ADDRESS_FORMAT_XLM", + "ADDRESS_FORMAT_DOGE_MAINNET", + "ADDRESS_FORMAT_DOGE_TESTNET", + "ADDRESS_FORMAT_TON_V3R2", + "ADDRESS_FORMAT_TON_V4R2", + "ADDRESS_FORMAT_TON_V5R1", + "ADDRESS_FORMAT_XRP" + ] + }, + "v1ApiKey": { + "type": "object", + "properties": { + "credential": { + "$ref": "#/definitions/externaldatav1Credential", + "description": "A User credential that can be used to authenticate to Turnkey." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for a given API Key." + }, + "apiKeyName": { + "type": "string", + "description": "Human-readable name for an API Key." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "expirationSeconds": { + "type": "string", + "format": "uint64", + "description": "Optional window (in seconds) indicating how long the API Key should last." + } + }, + "required": [ + "credential", + "apiKeyId", + "apiKeyName", + "createdAt", + "updatedAt" + ] + }, + "v1ApiKeyCurve": { + "type": "string", + "enum": [ + "API_KEY_CURVE_P256", + "API_KEY_CURVE_SECP256K1", + "API_KEY_CURVE_ED25519" + ] + }, + "v1ApiKeyParamsV2": { + "type": "object", + "properties": { + "apiKeyName": { + "type": "string", + "description": "Human-readable name for an API Key." + }, + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to sign messages and transactions." + }, + "curveType": { + "$ref": "#/definitions/v1ApiKeyCurve", + "description": "The curve type to be used for processing API key signatures." + }, + "expirationSeconds": { + "type": "string", + "description": "Optional window (in seconds) indicating how long the API Key should last." + } + }, + "required": ["apiKeyName", "publicKey", "curveType"] + }, + "v1ApiOnlyUserParams": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "The name of the new API-only User." + }, + "userEmail": { + "type": "string", + "description": "The email address for this API-only User (optional)." + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of tags assigned to the new API-only User. This field, if not needed, should be an empty array in your request body." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "userTags", "apiKeys"] + }, + "v1AppProof": { + "type": "object", + "properties": { + "scheme": { + "$ref": "#/definitions/v1SignatureScheme", + "description": "Scheme of signing key." + }, + "publicKey": { + "type": "string", + "description": "Ephemeral public key." + }, + "proofPayload": { + "type": "string", + "description": "JSON serialized AppProofPayload." + }, + "signature": { + "type": "string", + "description": "Signature over hashed proof_payload." + } + }, + "required": ["scheme", "publicKey", "proofPayload", "signature"] + }, + "v1ApproveActivityIntent": { + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "An artifact verifying a User's action." + } + }, + "required": ["fingerprint"] + }, + "v1ApproveActivityRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_APPROVE_ACTIVITY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ApproveActivityIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1Attestation": { + "type": "object", + "properties": { + "credentialId": { + "type": "string", + "description": "The cbor encoded then base64 url encoded id of the credential." + }, + "clientDataJson": { + "type": "string", + "description": "A base64 url encoded payload containing metadata about the signing context and the challenge." + }, + "attestationObject": { + "type": "string", + "description": "A base64 url encoded payload containing authenticator data and any attestation the webauthn provider chooses." + }, + "transports": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AuthenticatorTransport" + }, + "description": "The type of authenticator transports." + } + }, + "required": [ + "credentialId", + "clientDataJson", + "attestationObject", + "transports" + ] + }, + "v1Authenticator": { + "type": "object", + "properties": { + "transports": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AuthenticatorTransport" + }, + "description": "Types of transports that may be used by an Authenticator (e.g., USB, NFC, BLE)." + }, + "attestationType": { + "type": "string" + }, + "aaguid": { + "type": "string", + "description": "Identifier indicating the type of the Security Key." + }, + "credentialId": { + "type": "string", + "description": "Unique identifier for a WebAuthn credential." + }, + "model": { + "type": "string", + "description": "The type of Authenticator device." + }, + "credential": { + "$ref": "#/definitions/externaldatav1Credential", + "description": "A User credential that can be used to authenticate to Turnkey." + }, + "authenticatorId": { + "type": "string", + "description": "Unique identifier for a given Authenticator." + }, + "authenticatorName": { + "type": "string", + "description": "Human-readable name for an Authenticator." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "transports", + "attestationType", + "aaguid", + "credentialId", + "model", + "credential", + "authenticatorId", + "authenticatorName", + "createdAt", + "updatedAt" + ] + }, + "v1AuthenticatorAttestationResponse": { + "type": "object", + "properties": { + "clientDataJson": { + "type": "string" + }, + "attestationObject": { + "type": "string" + }, + "transports": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AuthenticatorTransport" + } + }, + "authenticatorAttachment": { + "type": "string", + "enum": ["cross-platform", "platform"], + "x-nullable": true + } + }, + "required": ["clientDataJson", "attestationObject"] + }, + "v1AuthenticatorParams": { + "type": "object", + "properties": { + "authenticatorName": { + "type": "string", + "description": "Human-readable name for an Authenticator." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "attestation": { + "$ref": "#/definitions/v1PublicKeyCredentialWithAttestation" + }, + "challenge": { + "type": "string", + "description": "Challenge presented for authentication purposes." + } + }, + "required": ["authenticatorName", "userId", "attestation", "challenge"] + }, + "v1AuthenticatorParamsV2": { + "type": "object", + "properties": { + "authenticatorName": { + "type": "string", + "description": "Human-readable name for an Authenticator." + }, + "challenge": { + "type": "string", + "description": "Challenge presented for authentication purposes." + }, + "attestation": { + "$ref": "#/definitions/v1Attestation", + "description": "The attestation that proves custody of the authenticator and provides metadata about it." + } + }, + "required": ["authenticatorName", "challenge", "attestation"] + }, + "v1AuthenticatorTransport": { + "type": "string", + "enum": [ + "AUTHENTICATOR_TRANSPORT_BLE", + "AUTHENTICATOR_TRANSPORT_INTERNAL", + "AUTHENTICATOR_TRANSPORT_NFC", + "AUTHENTICATOR_TRANSPORT_USB", + "AUTHENTICATOR_TRANSPORT_HYBRID" + ] + }, + "v1BootProof": { + "type": "object", + "properties": { + "ephemeralPublicKeyHex": { + "type": "string", + "description": "The hex encoded Ephemeral Public Key." + }, + "awsAttestationDocB64": { + "type": "string", + "description": "The DER encoded COSE Sign1 struct Attestation doc." + }, + "qosManifestB64": { + "type": "string", + "description": "The borsch serialized base64 encoded Manifest." + }, + "qosManifestEnvelopeB64": { + "type": "string", + "description": "The borsch serialized base64 encoded Manifest Envelope." + }, + "deploymentLabel": { + "type": "string", + "description": "The label under which the enclave app was deployed." + }, + "enclaveApp": { + "type": "string", + "description": "Name of the enclave app" + }, + "owner": { + "type": "string", + "description": "Owner of the app i.e. 'tkhq'" + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "ephemeralPublicKeyHex", + "awsAttestationDocB64", + "qosManifestB64", + "qosManifestEnvelopeB64", + "deploymentLabel", + "enclaveApp", + "owner", + "createdAt" + ] + }, + "v1BootProofResponse": { + "type": "object", + "properties": { + "bootProof": { + "$ref": "#/definitions/v1BootProof" + } + }, + "required": ["bootProof"] + }, + "v1Config": { + "type": "object", + "properties": { + "features": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Feature" + } + }, + "quorum": { + "$ref": "#/definitions/externaldatav1Quorum" + } + } + }, + "v1CreateApiKeysIntent": { + "type": "object", + "properties": { + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Keys." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + } + }, + "required": ["apiKeys", "userId"] + }, + "v1CreateApiKeysIntentV2": { + "type": "object", + "properties": { + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKeyParamsV2" + }, + "description": "A list of API Keys." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + } + }, + "required": ["apiKeys", "userId"] + }, + "v1CreateApiKeysRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_API_KEYS_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateApiKeysIntentV2" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateApiKeysResult": { + "type": "object", + "properties": { + "apiKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of API Key IDs." + } + }, + "required": ["apiKeyIds"] + }, + "v1CreateApiOnlyUsersIntent": { + "type": "object", + "properties": { + "apiOnlyUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiOnlyUserParams" + }, + "description": "A list of API-only Users to create." + } + }, + "required": ["apiOnlyUsers"] + }, + "v1CreateApiOnlyUsersRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_API_ONLY_USERS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateApiOnlyUsersIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateApiOnlyUsersResult": { + "type": "object", + "properties": { + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of API-only User IDs." + } + }, + "required": ["userIds"] + }, + "v1CreateAuthenticatorsIntent": { + "type": "object", + "properties": { + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParams" + }, + "description": "A list of Authenticators." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + } + }, + "required": ["authenticators", "userId"] + }, + "v1CreateAuthenticatorsIntentV2": { + "type": "object", + "properties": { + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticators." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + } + }, + "required": ["authenticators", "userId"] + }, + "v1CreateAuthenticatorsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateAuthenticatorsIntentV2" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateAuthenticatorsResult": { + "type": "object", + "properties": { + "authenticatorIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Authenticator IDs." + } + }, + "required": ["authenticatorIds"] + }, + "v1CreateInvitationsIntent": { + "type": "object", + "properties": { + "invitations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1InvitationParams" + }, + "description": "A list of Invitations." + } + }, + "required": ["invitations"] + }, + "v1CreateInvitationsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_INVITATIONS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateInvitationsIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateInvitationsResult": { + "type": "object", + "properties": { + "invitationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Invitation IDs" + } + }, + "required": ["invitationIds"] + }, + "v1CreateOauth2CredentialIntent": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/definitions/v1Oauth2Provider", + "description": "The OAuth 2.0 provider" + }, + "clientId": { + "type": "string", + "description": "The Client ID issued by the OAuth 2.0 provider" + }, + "encryptedClientSecret": { + "type": "string", + "description": "The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key" + } + }, + "required": ["provider", "clientId", "encryptedClientSecret"] + }, + "v1CreateOauth2CredentialRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateOauth2CredentialIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateOauth2CredentialResult": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier of the OAuth 2.0 credential that was created" + } + }, + "required": ["oauth2CredentialId"] + }, + "v1CreateOauthProvidersIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User to add an Oauth provider to" + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + }, + "description": "A list of Oauth providers." + } + }, + "required": ["userId", "oauthProviders"] + }, + "v1CreateOauthProvidersRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateOauthProvidersIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateOauthProvidersResult": { + "type": "object", + "properties": { + "providerIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of unique identifiers for Oauth Providers" + } + }, + "required": ["providerIds"] + }, + "v1CreateOrganizationIntent": { + "type": "object", + "properties": { + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization." + }, + "rootEmail": { + "type": "string", + "description": "The root user's email address." + }, + "rootAuthenticator": { + "$ref": "#/definitions/v1AuthenticatorParams", + "description": "The root user's Authenticator." + }, + "rootUserId": { + "type": "string", + "description": "Unique identifier for the root user object." + } + }, + "required": ["organizationName", "rootEmail", "rootAuthenticator"] + }, + "v1CreateOrganizationIntentV2": { + "type": "object", + "properties": { + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization." + }, + "rootEmail": { + "type": "string", + "description": "The root user's email address." + }, + "rootAuthenticator": { + "$ref": "#/definitions/v1AuthenticatorParamsV2", + "description": "The root user's Authenticator." + }, + "rootUserId": { + "type": "string", + "description": "Unique identifier for the root user object." + } + }, + "required": ["organizationName", "rootEmail", "rootAuthenticator"] + }, + "v1CreateOrganizationResult": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + } + }, + "required": ["organizationId"] + }, + "v1CreatePoliciesIntent": { + "type": "object", + "properties": { + "policies": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1CreatePolicyIntentV3" + }, + "description": "An array of policy intents to be created." + } + }, + "required": ["policies"] + }, + "v1CreatePoliciesRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_POLICIES"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreatePoliciesIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreatePoliciesResult": { + "type": "object", + "properties": { + "policyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of unique identifiers for the created policies." + } + }, + "required": ["policyIds"] + }, + "v1CreatePolicyIntent": { + "type": "object", + "properties": { + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "selectors": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Selector" + }, + "description": "A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details." + }, + "effect": { + "$ref": "#/definitions/v1Effect", + "description": "The instruction to DENY or ALLOW a particular activity following policy selector(s)." + }, + "notes": { + "type": "string" + } + }, + "required": ["policyName", "selectors", "effect"] + }, + "v1CreatePolicyIntentV2": { + "type": "object", + "properties": { + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "selectors": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1SelectorV2" + }, + "description": "A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details." + }, + "effect": { + "$ref": "#/definitions/v1Effect", + "description": "Whether to ALLOW or DENY requests that match the condition and consensus requirements." + }, + "notes": { + "type": "string" + } + }, + "required": ["policyName", "selectors", "effect"] + }, + "v1CreatePolicyIntentV3": { + "type": "object", + "properties": { + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "effect": { + "$ref": "#/definitions/v1Effect", + "description": "The instruction to DENY or ALLOW an activity." + }, + "condition": { + "type": "string", + "description": "The condition expression that triggers the Effect" + }, + "consensus": { + "type": "string", + "description": "The consensus expression that triggers the Effect" + }, + "notes": { + "type": "string" + } + }, + "required": ["policyName", "effect"] + }, + "v1CreatePolicyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_POLICY_V3"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreatePolicyIntentV3" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreatePolicyResult": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + } + }, + "required": ["policyId"] + }, + "v1CreatePrivateKeyTagIntent": { + "type": "object", + "properties": { + "privateKeyTagName": { + "type": "string", + "description": "Human-readable name for a Private Key Tag." + }, + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key IDs." + } + }, + "required": ["privateKeyTagName", "privateKeyIds"] + }, + "v1CreatePrivateKeyTagRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreatePrivateKeyTagIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreatePrivateKeyTagResult": { + "type": "object", + "properties": { + "privateKeyTagId": { + "type": "string", + "description": "Unique identifier for a given Private Key Tag." + }, + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key IDs." + } + }, + "required": ["privateKeyTagId", "privateKeyIds"] + }, + "v1CreatePrivateKeysIntent": { + "type": "object", + "properties": { + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKeyParams" + }, + "description": "A list of Private Keys." + } + }, + "required": ["privateKeys"] + }, + "v1CreatePrivateKeysIntentV2": { + "type": "object", + "properties": { + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKeyParams" + }, + "description": "A list of Private Keys." + } + }, + "required": ["privateKeys"] + }, + "v1CreatePrivateKeysRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreatePrivateKeysIntentV2" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreatePrivateKeysResult": { + "type": "object", + "properties": { + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key IDs." + } + }, + "required": ["privateKeyIds"] + }, + "v1CreatePrivateKeysResultV2": { + "type": "object", + "properties": { + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKeyResult" + }, + "description": "A list of Private Key IDs and addresses." + } + }, + "required": ["privateKeys"] + }, + "v1CreateReadOnlySessionIntent": { + "type": "object" + }, + "v1CreateReadOnlySessionRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateReadOnlySessionIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateReadOnlySessionResult": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + }, + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "username": { + "type": "string", + "description": "Human-readable name for a User." + }, + "session": { + "type": "string", + "description": "String representing a read only session" + }, + "sessionExpiry": { + "type": "string", + "format": "uint64", + "description": "UTC timestamp in seconds representing the expiry time for the read only session." + } + }, + "required": [ + "organizationId", + "organizationName", + "userId", + "username", + "session", + "sessionExpiry" + ] + }, + "v1CreateReadWriteSessionIntent": { + "type": "object", + "properties": { + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted." + }, + "email": { + "type": "string", + "description": "Email of the user to create a read write session for" + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Read Write Session - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + } + }, + "required": ["targetPublicKey", "email"] + }, + "v1CreateReadWriteSessionIntentV2": { + "type": "object", + "properties": { + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Read Write Session - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated ReadWriteSession API keys" + } + }, + "required": ["targetPublicKey"] + }, + "v1CreateReadWriteSessionRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateReadWriteSessionIntentV2" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateReadWriteSessionResult": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + }, + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "username": { + "type": "string", + "description": "Human-readable name for a User." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for the created API key." + }, + "credentialBundle": { + "type": "string", + "description": "HPKE encrypted credential bundle" + } + }, + "required": [ + "organizationId", + "organizationName", + "userId", + "username", + "apiKeyId", + "credentialBundle" + ] + }, + "v1CreateReadWriteSessionResultV2": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + }, + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "username": { + "type": "string", + "description": "Human-readable name for a User." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for the created API key." + }, + "credentialBundle": { + "type": "string", + "description": "HPKE encrypted credential bundle" + } + }, + "required": [ + "organizationId", + "organizationName", + "userId", + "username", + "apiKeyId", + "credentialBundle" + ] + }, + "v1CreateSmartContractInterfaceIntent": { + "type": "object", + "properties": { + "smartContractAddress": { + "type": "string", + "description": "Corresponding contract address or program ID" + }, + "smartContractInterface": { + "type": "string", + "description": "ABI/IDL as a JSON string" + }, + "type": { + "$ref": "#/definitions/v1SmartContractInterfaceType" + }, + "label": { + "type": "string", + "description": "Human-readable name for a Smart Contract Interface." + }, + "notes": { + "type": "string", + "description": "Notes for a Smart Contract Interface." + } + }, + "required": [ + "smartContractAddress", + "smartContractInterface", + "type", + "label" + ] + }, + "v1CreateSmartContractInterfaceRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateSmartContractInterfaceIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateSmartContractInterfaceResult": { + "type": "object", + "properties": { + "smartContractInterfaceId": { + "type": "string", + "description": "The ID of the created Smart Contract Interface." + } + }, + "required": ["smartContractInterfaceId"] + }, + "v1CreateSubOrganizationIntent": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootAuthenticator": { + "$ref": "#/definitions/v1AuthenticatorParamsV2", + "description": "Root User authenticator for this new sub-organization" + } + }, + "required": ["name", "rootAuthenticator"] + }, + "v1CreateSubOrganizationIntentV2": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParams" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + } + }, + "required": ["subOrganizationName", "rootUsers", "rootQuorumThreshold"] + }, + "v1CreateSubOrganizationIntentV3": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParams" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + }, + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKeyParams" + }, + "description": "A list of Private Keys." + } + }, + "required": [ + "subOrganizationName", + "rootUsers", + "rootQuorumThreshold", + "privateKeys" + ] + }, + "v1CreateSubOrganizationIntentV4": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParams" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + }, + "wallet": { + "$ref": "#/definitions/v1WalletParams", + "description": "The wallet to create for the sub-organization" + }, + "disableEmailRecovery": { + "type": "boolean", + "description": "Disable email recovery for the sub-organization" + }, + "disableEmailAuth": { + "type": "boolean", + "description": "Disable email auth for the sub-organization" + } + }, + "required": ["subOrganizationName", "rootUsers", "rootQuorumThreshold"] + }, + "v1CreateSubOrganizationIntentV5": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParamsV2" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + }, + "wallet": { + "$ref": "#/definitions/v1WalletParams", + "description": "The wallet to create for the sub-organization" + }, + "disableEmailRecovery": { + "type": "boolean", + "description": "Disable email recovery for the sub-organization" + }, + "disableEmailAuth": { + "type": "boolean", + "description": "Disable email auth for the sub-organization" + } + }, + "required": ["subOrganizationName", "rootUsers", "rootQuorumThreshold"] + }, + "v1CreateSubOrganizationIntentV6": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParamsV3" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + }, + "wallet": { + "$ref": "#/definitions/v1WalletParams", + "description": "The wallet to create for the sub-organization" + }, + "disableEmailRecovery": { + "type": "boolean", + "description": "Disable email recovery for the sub-organization" + }, + "disableEmailAuth": { + "type": "boolean", + "description": "Disable email auth for the sub-organization" + } + }, + "required": ["subOrganizationName", "rootUsers", "rootQuorumThreshold"] + }, + "v1CreateSubOrganizationIntentV7": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParamsV4" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + }, + "wallet": { + "$ref": "#/definitions/v1WalletParams", + "description": "The wallet to create for the sub-organization" + }, + "disableEmailRecovery": { + "type": "boolean", + "description": "Disable email recovery for the sub-organization" + }, + "disableEmailAuth": { + "type": "boolean", + "description": "Disable email auth for the sub-organization" + }, + "disableSmsAuth": { + "type": "boolean", + "description": "Disable OTP SMS auth for the sub-organization" + }, + "disableOtpEmailAuth": { + "type": "boolean", + "description": "Disable OTP email auth for the sub-organization" + }, + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact" + } + }, + "required": ["subOrganizationName", "rootUsers", "rootQuorumThreshold"] + }, + "v1CreateSubOrganizationRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV7" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateSubOrganizationResult": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId"] + }, + "v1CreateSubOrganizationResultV3": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKeyResult" + }, + "description": "A list of Private Key IDs and addresses." + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId", "privateKeys"] + }, + "v1CreateSubOrganizationResultV4": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "wallet": { + "$ref": "#/definitions/v1WalletResult" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId"] + }, + "v1CreateSubOrganizationResultV5": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "wallet": { + "$ref": "#/definitions/v1WalletResult" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId"] + }, + "v1CreateSubOrganizationResultV6": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "wallet": { + "$ref": "#/definitions/v1WalletResult" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId"] + }, + "v1CreateSubOrganizationResultV7": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "wallet": { + "$ref": "#/definitions/v1WalletResult" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId"] + }, + "v1CreateUserTagIntent": { + "type": "object", + "properties": { + "userTagName": { + "type": "string", + "description": "Human-readable name for a User Tag." + }, + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userTagName", "userIds"] + }, + "v1CreateUserTagRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_USER_TAG"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateUserTagIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateUserTagResult": { + "type": "object", + "properties": { + "userTagId": { + "type": "string", + "description": "Unique identifier for a given User Tag." + }, + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userTagId", "userIds"] + }, + "v1CreateUsersIntent": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1UserParams" + }, + "description": "A list of Users." + } + }, + "required": ["users"] + }, + "v1CreateUsersIntentV2": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1UserParamsV2" + }, + "description": "A list of Users." + } + }, + "required": ["users"] + }, + "v1CreateUsersIntentV3": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1UserParamsV3" + }, + "description": "A list of Users." + } + }, + "required": ["users"] + }, + "v1CreateUsersRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_USERS_V3"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateUsersIntentV3" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateUsersResult": { + "type": "object", + "properties": { + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userIds"] + }, + "v1CreateWalletAccountsIntent": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a given Wallet." + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WalletAccountParams" + }, + "description": "A list of wallet Accounts." + }, + "persist": { + "type": "boolean", + "description": "Indicates if the wallet accounts should be persisted. This is helpful if you'd like to see the addresses of different derivation paths without actually creating the accounts. Defaults to true." + } + }, + "required": ["walletId", "accounts"] + }, + "v1CreateWalletAccountsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateWalletAccountsIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateWalletAccountsResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of derived addresses." + } + }, + "required": ["addresses"] + }, + "v1CreateWalletIntent": { + "type": "object", + "properties": { + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WalletAccountParams" + }, + "description": "A list of wallet Accounts. This field, if not needed, should be an empty array in your request body." + }, + "mnemonicLength": { + "type": "integer", + "format": "int32", + "description": "Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24." + } + }, + "required": ["walletName", "accounts"] + }, + "v1CreateWalletRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_WALLET"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateWalletIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateWalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a Wallet." + }, + "addresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of account addresses." + } + }, + "required": ["walletId", "addresses"] + }, + "v1CredPropsAuthenticationExtensionsClientOutputs": { + "type": "object", + "properties": { + "rk": { + "type": "boolean" + } + }, + "required": ["rk"] + }, + "v1CredentialType": { + "type": "string", + "enum": [ + "CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR", + "CREDENTIAL_TYPE_API_KEY_P256", + "CREDENTIAL_TYPE_RECOVER_USER_KEY_P256", + "CREDENTIAL_TYPE_API_KEY_SECP256K1", + "CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256", + "CREDENTIAL_TYPE_API_KEY_ED25519", + "CREDENTIAL_TYPE_OTP_AUTH_KEY_P256", + "CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256", + "CREDENTIAL_TYPE_OAUTH_KEY_P256", + "CREDENTIAL_TYPE_LOGIN" + ] + }, + "v1Curve": { + "type": "string", + "enum": ["CURVE_SECP256K1", "CURVE_ED25519"] + }, + "v1DeleteApiKeysIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "apiKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of API Key IDs." + } + }, + "required": ["userId", "apiKeyIds"] + }, + "v1DeleteApiKeysRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_API_KEYS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteApiKeysIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteApiKeysResult": { + "type": "object", + "properties": { + "apiKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of API Key IDs." + } + }, + "required": ["apiKeyIds"] + }, + "v1DeleteAuthenticatorsIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "authenticatorIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Authenticator IDs." + } + }, + "required": ["userId", "authenticatorIds"] + }, + "v1DeleteAuthenticatorsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_AUTHENTICATORS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteAuthenticatorsIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteAuthenticatorsResult": { + "type": "object", + "properties": { + "authenticatorIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique identifier for a given Authenticator." + } + }, + "required": ["authenticatorIds"] + }, + "v1DeleteInvitationIntent": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation object." + } + }, + "required": ["invitationId"] + }, + "v1DeleteInvitationRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_INVITATION"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteInvitationIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteInvitationResult": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation." + } + }, + "required": ["invitationId"] + }, + "v1DeleteOauth2CredentialIntent": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "The ID of the OAuth 2.0 credential to delete" + } + }, + "required": ["oauth2CredentialId"] + }, + "v1DeleteOauth2CredentialRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteOauth2CredentialIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteOauth2CredentialResult": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier of the OAuth 2.0 credential that was deleted" + } + }, + "required": ["oauth2CredentialId"] + }, + "v1DeleteOauthProvidersIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User to remove an Oauth provider from" + }, + "providerIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique identifier for a given Provider." + } + }, + "required": ["userId", "providerIds"] + }, + "v1DeleteOauthProvidersRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteOauthProvidersIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteOauthProvidersResult": { + "type": "object", + "properties": { + "providerIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of unique identifiers for Oauth Providers" + } + }, + "required": ["providerIds"] + }, + "v1DeleteOrganizationIntent": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + } + }, + "required": ["organizationId"] + }, + "v1DeleteOrganizationResult": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + } + }, + "required": ["organizationId"] + }, + "v1DeletePoliciesIntent": { + "type": "object", + "properties": { + "policyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for policies within an organization" + } + }, + "required": ["policyIds"] + }, + "v1DeletePoliciesRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_POLICIES"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeletePoliciesIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeletePoliciesResult": { + "type": "object", + "properties": { + "policyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of unique identifiers for the deleted policies." + } + }, + "required": ["policyIds"] + }, + "v1DeletePolicyIntent": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + } + }, + "required": ["policyId"] + }, + "v1DeletePolicyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_POLICY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeletePolicyIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeletePolicyResult": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + } + }, + "required": ["policyId"] + }, + "v1DeletePrivateKeyTagsIntent": { + "type": "object", + "properties": { + "privateKeyTagIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key Tag IDs." + } + }, + "required": ["privateKeyTagIds"] + }, + "v1DeletePrivateKeyTagsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeletePrivateKeyTagsIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeletePrivateKeyTagsResult": { + "type": "object", + "properties": { + "privateKeyTagIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key Tag IDs." + }, + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key IDs." + } + }, + "required": ["privateKeyTagIds", "privateKeyIds"] + }, + "v1DeletePrivateKeysIntent": { + "type": "object", + "properties": { + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for private keys within an organization" + }, + "deleteWithoutExport": { + "type": "boolean", + "description": "Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored." + } + }, + "required": ["privateKeyIds"] + }, + "v1DeletePrivateKeysRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_PRIVATE_KEYS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeletePrivateKeysIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeletePrivateKeysResult": { + "type": "object", + "properties": { + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of private key unique identifiers that were removed" + } + }, + "required": ["privateKeyIds"] + }, + "v1DeleteSmartContractInterfaceIntent": { + "type": "object", + "properties": { + "smartContractInterfaceId": { + "type": "string", + "description": "The ID of a Smart Contract Interface intended for deletion." + } + }, + "required": ["smartContractInterfaceId"] + }, + "v1DeleteSmartContractInterfaceRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteSmartContractInterfaceIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteSmartContractInterfaceResult": { + "type": "object", + "properties": { + "smartContractInterfaceId": { + "type": "string", + "description": "The ID of the deleted Smart Contract Interface." + } + }, + "required": ["smartContractInterfaceId"] + }, + "v1DeleteSubOrganizationIntent": { + "type": "object", + "properties": { + "deleteWithoutExport": { + "type": "boolean", + "description": "Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false." + } + } + }, + "v1DeleteSubOrganizationRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteSubOrganizationIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteSubOrganizationResult": { + "type": "object", + "properties": { + "subOrganizationUuid": { + "type": "string", + "description": "Unique identifier of the sub organization that was removed" + } + }, + "required": ["subOrganizationUuid"] + }, + "v1DeleteUserTagsIntent": { + "type": "object", + "properties": { + "userTagIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs." + } + }, + "required": ["userTagIds"] + }, + "v1DeleteUserTagsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_USER_TAGS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteUserTagsIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteUserTagsResult": { + "type": "object", + "properties": { + "userTagIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs." + }, + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userTagIds", "userIds"] + }, + "v1DeleteUsersIntent": { + "type": "object", + "properties": { + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userIds"] + }, + "v1DeleteUsersRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_USERS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteUsersIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteUsersResult": { + "type": "object", + "properties": { + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userIds"] + }, + "v1DeleteWalletAccountsIntent": { + "type": "object", + "properties": { + "walletAccountIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for wallet accounts within an organization" + }, + "deleteWithoutExport": { + "type": "boolean", + "description": "Optional parameter for deleting the wallet accounts, even if any have not been previously exported. If they have been exported, this field is ignored." + } + }, + "required": ["walletAccountIds"] + }, + "v1DeleteWalletAccountsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteWalletAccountsIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteWalletAccountsResult": { + "type": "object", + "properties": { + "walletAccountIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of wallet account unique identifiers that were removed" + } + }, + "required": ["walletAccountIds"] + }, + "v1DeleteWalletsIntent": { + "type": "object", + "properties": { + "walletIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for wallets within an organization" + }, + "deleteWithoutExport": { + "type": "boolean", + "description": "Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored." + } + }, + "required": ["walletIds"] + }, + "v1DeleteWalletsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_WALLETS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteWalletsIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteWalletsResult": { + "type": "object", + "properties": { + "walletIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of wallet unique identifiers that were removed" + } + }, + "required": ["walletIds"] + }, + "v1DisableAuthProxyIntent": { + "type": "object" + }, + "v1DisableAuthProxyResult": { + "type": "object" + }, + "v1DisablePrivateKeyIntent": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + } + }, + "required": ["privateKeyId"] + }, + "v1DisablePrivateKeyResult": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + } + }, + "required": ["privateKeyId"] + }, + "v1Effect": { + "type": "string", + "enum": ["EFFECT_ALLOW", "EFFECT_DENY"] + }, + "v1EmailAuthIntent": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the authenticating user." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Email Auth - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Email Auth API keys" + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the email" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["email", "targetPublicKey"] + }, + "v1EmailAuthIntentV2": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the authenticating user." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Email Auth - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Email Auth API keys" + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the email" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["email", "targetPublicKey"] + }, + "v1EmailAuthRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_EMAIL_AUTH_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1EmailAuthIntentV2" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1EmailAuthResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for the authenticating User." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for the created API key." + } + }, + "required": ["userId", "apiKeyId"] + }, + "v1EmailCustomizationParams": { + "type": "object", + "properties": { + "appName": { + "type": "string", + "description": "The name of the application." + }, + "logoUrl": { + "type": "string", + "description": "A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px." + }, + "magicLinkTemplate": { + "type": "string", + "description": "A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`." + }, + "templateVariables": { + "type": "string", + "description": "JSON object containing key/value pairs to be used with custom templates." + }, + "templateId": { + "type": "string", + "description": "Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template." + } + } + }, + "v1EnableAuthProxyIntent": { + "type": "object" + }, + "v1EnableAuthProxyResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "A User ID with permission to initiate authentication." + } + }, + "required": ["userId"] + }, + "v1ExportPrivateKeyIntent": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the export bundle will be encrypted." + } + }, + "required": ["privateKeyId", "targetPublicKey"] + }, + "v1ExportPrivateKeyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_EXPORT_PRIVATE_KEY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ExportPrivateKeyIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1ExportPrivateKeyResult": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + }, + "exportBundle": { + "type": "string", + "description": "Export bundle containing a private key encrypted to the client's target public key." + } + }, + "required": ["privateKeyId", "exportBundle"] + }, + "v1ExportWalletAccountIntent": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Address to identify Wallet Account." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the export bundle will be encrypted." + } + }, + "required": ["address", "targetPublicKey"] + }, + "v1ExportWalletAccountRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ExportWalletAccountIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1ExportWalletAccountResult": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Address to identify Wallet Account." + }, + "exportBundle": { + "type": "string", + "description": "Export bundle containing a private key encrypted by the client's target public key." + } + }, + "required": ["address", "exportBundle"] + }, + "v1ExportWalletIntent": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a given Wallet." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the export bundle will be encrypted." + }, + "language": { + "$ref": "#/definitions/v1MnemonicLanguage", + "description": "The language of the mnemonic to export. Defaults to English." + } + }, + "required": ["walletId", "targetPublicKey"] + }, + "v1ExportWalletRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_EXPORT_WALLET"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ExportWalletIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1ExportWalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a given Wallet." + }, + "exportBundle": { + "type": "string", + "description": "Export bundle containing a wallet mnemonic + optional newline passphrase encrypted by the client's target public key." + } + }, + "required": ["walletId", "exportBundle"] + }, + "v1Feature": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/v1FeatureName" + }, + "value": { + "type": "string" + } + } + }, + "v1FeatureName": { + "type": "string", + "enum": [ + "FEATURE_NAME_ROOT_USER_EMAIL_RECOVERY", + "FEATURE_NAME_WEBAUTHN_ORIGINS", + "FEATURE_NAME_EMAIL_AUTH", + "FEATURE_NAME_EMAIL_RECOVERY", + "FEATURE_NAME_WEBHOOK", + "FEATURE_NAME_SMS_AUTH", + "FEATURE_NAME_OTP_EMAIL_AUTH", + "FEATURE_NAME_AUTH_PROXY" + ] + }, + "v1FiatOnRampBlockchainNetwork": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BITCOIN", + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_ETHEREUM", + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_SOLANA", + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BASE" + ] + }, + "v1FiatOnRampCryptoCurrency": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_CRYPTO_CURRENCY_BTC", + "FIAT_ON_RAMP_CRYPTO_CURRENCY_ETH", + "FIAT_ON_RAMP_CRYPTO_CURRENCY_SOL", + "FIAT_ON_RAMP_CRYPTO_CURRENCY_USDC" + ] + }, + "v1FiatOnRampCurrency": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_CURRENCY_AUD", + "FIAT_ON_RAMP_CURRENCY_BGN", + "FIAT_ON_RAMP_CURRENCY_BRL", + "FIAT_ON_RAMP_CURRENCY_CAD", + "FIAT_ON_RAMP_CURRENCY_CHF", + "FIAT_ON_RAMP_CURRENCY_COP", + "FIAT_ON_RAMP_CURRENCY_CZK", + "FIAT_ON_RAMP_CURRENCY_DKK", + "FIAT_ON_RAMP_CURRENCY_DOP", + "FIAT_ON_RAMP_CURRENCY_EGP", + "FIAT_ON_RAMP_CURRENCY_EUR", + "FIAT_ON_RAMP_CURRENCY_GBP", + "FIAT_ON_RAMP_CURRENCY_HKD", + "FIAT_ON_RAMP_CURRENCY_IDR", + "FIAT_ON_RAMP_CURRENCY_ILS", + "FIAT_ON_RAMP_CURRENCY_JOD", + "FIAT_ON_RAMP_CURRENCY_KES", + "FIAT_ON_RAMP_CURRENCY_KWD", + "FIAT_ON_RAMP_CURRENCY_LKR", + "FIAT_ON_RAMP_CURRENCY_MXN", + "FIAT_ON_RAMP_CURRENCY_NGN", + "FIAT_ON_RAMP_CURRENCY_NOK", + "FIAT_ON_RAMP_CURRENCY_NZD", + "FIAT_ON_RAMP_CURRENCY_OMR", + "FIAT_ON_RAMP_CURRENCY_PEN", + "FIAT_ON_RAMP_CURRENCY_PLN", + "FIAT_ON_RAMP_CURRENCY_RON", + "FIAT_ON_RAMP_CURRENCY_SEK", + "FIAT_ON_RAMP_CURRENCY_THB", + "FIAT_ON_RAMP_CURRENCY_TRY", + "FIAT_ON_RAMP_CURRENCY_TWD", + "FIAT_ON_RAMP_CURRENCY_USD", + "FIAT_ON_RAMP_CURRENCY_VND", + "FIAT_ON_RAMP_CURRENCY_ZAR" + ] + }, + "v1FiatOnRampPaymentMethod": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_PAYMENT_METHOD_CREDIT_DEBIT_CARD", + "FIAT_ON_RAMP_PAYMENT_METHOD_APPLE_PAY", + "FIAT_ON_RAMP_PAYMENT_METHOD_GBP_BANK_TRANSFER", + "FIAT_ON_RAMP_PAYMENT_METHOD_GBP_OPEN_BANKING_PAYMENT", + "FIAT_ON_RAMP_PAYMENT_METHOD_GOOGLE_PAY", + "FIAT_ON_RAMP_PAYMENT_METHOD_SEPA_BANK_TRANSFER", + "FIAT_ON_RAMP_PAYMENT_METHOD_PIX_INSTANT_PAYMENT", + "FIAT_ON_RAMP_PAYMENT_METHOD_PAYPAL", + "FIAT_ON_RAMP_PAYMENT_METHOD_VENMO", + "FIAT_ON_RAMP_PAYMENT_METHOD_MOONPAY_BALANCE", + "FIAT_ON_RAMP_PAYMENT_METHOD_CRYPTO_ACCOUNT", + "FIAT_ON_RAMP_PAYMENT_METHOD_FIAT_WALLET", + "FIAT_ON_RAMP_PAYMENT_METHOD_ACH_BANK_ACCOUNT" + ] + }, + "v1FiatOnRampProvider": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_PROVIDER_COINBASE", + "FIAT_ON_RAMP_PROVIDER_MOONPAY" + ] + }, + "v1GetActivitiesRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "filterByStatus": { + "type": "array", + "items": { + "$ref": "#/definitions/v1ActivityStatus" + }, + "description": "Array of activity statuses filtering which activities will be listed in the response." + }, + "paginationOptions": { + "$ref": "#/definitions/v1Pagination", + "description": "Parameters used for cursor-based pagination." + }, + "filterByType": { + "type": "array", + "items": { + "$ref": "#/definitions/v1ActivityType" + }, + "description": "Array of activity types filtering which activities will be listed in the response." + } + }, + "required": ["organizationId"] + }, + "v1GetActivitiesResponse": { + "type": "object", + "properties": { + "activities": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Activity" + }, + "description": "A list of activities." + } + }, + "required": ["activities"] + }, + "v1GetActivityRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given activity object." + } + }, + "required": ["organizationId", "activityId"] + }, + "v1GetApiKeyRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for a given API key." + } + }, + "required": ["organizationId", "apiKeyId"] + }, + "v1GetApiKeyResponse": { + "type": "object", + "properties": { + "apiKey": { + "$ref": "#/definitions/v1ApiKey", + "description": "An API key." + } + }, + "required": ["apiKey"] + }, + "v1GetApiKeysRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given user." + } + }, + "required": ["organizationId"] + }, + "v1GetApiKeysResponse": { + "type": "object", + "properties": { + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKey" + }, + "description": "A list of API keys." + } + }, + "required": ["apiKeys"] + }, + "v1GetAppProofsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given activity." + } + }, + "required": ["organizationId", "activityId"] + }, + "v1GetAppProofsResponse": { + "type": "object", + "properties": { + "appProofs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AppProof" + } + } + }, + "required": ["appProofs"] + }, + "v1GetAttestationDocumentRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "enclaveType": { + "type": "string", + "description": "The enclave type, one of: ump, notarizer, signer, evm-parser." + } + }, + "required": ["organizationId", "enclaveType"] + }, + "v1GetAttestationDocumentResponse": { + "type": "object", + "properties": { + "attestationDocument": { + "type": "string", + "format": "byte", + "description": "Raw (CBOR-encoded) attestation document." + } + }, + "required": ["attestationDocument"] + }, + "v1GetAuthenticatorRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "authenticatorId": { + "type": "string", + "description": "Unique identifier for a given authenticator." + } + }, + "required": ["organizationId", "authenticatorId"] + }, + "v1GetAuthenticatorResponse": { + "type": "object", + "properties": { + "authenticator": { + "$ref": "#/definitions/v1Authenticator", + "description": "An authenticator." + } + }, + "required": ["authenticator"] + }, + "v1GetAuthenticatorsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given user." + } + }, + "required": ["organizationId", "userId"] + }, + "v1GetAuthenticatorsResponse": { + "type": "object", + "properties": { + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Authenticator" + }, + "description": "A list of authenticators." + } + }, + "required": ["authenticators"] + }, + "v1GetBootProofRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "ephemeralKey": { + "type": "string", + "description": "Hex encoded ephemeral public key." + } + }, + "required": ["organizationId", "ephemeralKey"] + }, + "v1GetLatestBootProofRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "appName": { + "type": "string", + "description": "Name of enclave app." + } + }, + "required": ["organizationId", "appName"] + }, + "v1GetOauth2CredentialRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier for a given OAuth 2.0 Credential." + } + }, + "required": ["organizationId", "oauth2CredentialId"] + }, + "v1GetOauth2CredentialResponse": { + "type": "object", + "properties": { + "oauth2Credential": { + "$ref": "#/definitions/v1Oauth2Credential" + } + }, + "required": ["oauth2Credential"] + }, + "v1GetOauthProvidersRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given user." + } + }, + "required": ["organizationId"] + }, + "v1GetOauthProvidersResponse": { + "type": "object", + "properties": { + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProvider" + }, + "description": "A list of Oauth providers." + } + }, + "required": ["oauthProviders"] + }, + "v1GetOrganizationConfigsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetOrganizationConfigsResponse": { + "type": "object", + "properties": { + "configs": { + "$ref": "#/definitions/v1Config", + "description": "Organization configs including quorum settings and organization features." + } + }, + "required": ["configs"] + }, + "v1GetOrganizationRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetOrganizationResponse": { + "type": "object", + "properties": { + "organizationData": { + "$ref": "#/definitions/v1OrganizationData", + "description": "Object representing the full current and deleted / disabled collection of users, policies, private keys, and invitations attributable to a particular organization." + } + }, + "required": ["organizationData"] + }, + "v1GetPoliciesRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetPoliciesResponse": { + "type": "object", + "properties": { + "policies": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Policy" + }, + "description": "A list of policies." + } + }, + "required": ["policies"] + }, + "v1GetPolicyEvaluationsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given activity." + } + }, + "required": ["organizationId", "activityId"] + }, + "v1GetPolicyEvaluationsResponse": { + "type": "object", + "properties": { + "policyEvaluations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/externalactivityv1PolicyEvaluation" + } + } + }, + "required": ["policyEvaluations"] + }, + "v1GetPolicyRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "policyId": { + "type": "string", + "description": "Unique identifier for a given policy." + } + }, + "required": ["organizationId", "policyId"] + }, + "v1GetPolicyResponse": { + "type": "object", + "properties": { + "policy": { + "$ref": "#/definitions/v1Policy", + "description": "Object that codifies rules defining the actions that are permissible within an organization." + } + }, + "required": ["policy"] + }, + "v1GetPrivateKeyRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given private key." + } + }, + "required": ["organizationId", "privateKeyId"] + }, + "v1GetPrivateKeyResponse": { + "type": "object", + "properties": { + "privateKey": { + "$ref": "#/definitions/v1PrivateKey", + "description": "Cryptographic public/private key pair that can be used for cryptocurrency needs or more generalized encryption." + } + }, + "required": ["privateKey"] + }, + "v1GetPrivateKeysRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetPrivateKeysResponse": { + "type": "object", + "properties": { + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKey" + }, + "description": "A list of private keys." + } + }, + "required": ["privateKeys"] + }, + "v1GetSmartContractInterfaceRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "smartContractInterfaceId": { + "type": "string", + "description": "Unique identifier for a given smart contract interface." + } + }, + "required": ["organizationId", "smartContractInterfaceId"] + }, + "v1GetSmartContractInterfaceResponse": { + "type": "object", + "properties": { + "smartContractInterface": { + "$ref": "#/definitions/v1SmartContractInterface", + "description": "Object to be used in conjunction with policies to guard transaction signing." + } + }, + "required": ["smartContractInterface"] + }, + "v1GetSmartContractInterfacesRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetSmartContractInterfacesResponse": { + "type": "object", + "properties": { + "smartContractInterfaces": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1SmartContractInterface" + }, + "description": "A list of smart contract interfaces." + } + }, + "required": ["smartContractInterfaces"] + }, + "v1GetSubOrgIdsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for the parent organization. This is used to find sub-organizations within it." + }, + "filterType": { + "type": "string", + "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN', 'WALLET_ACCOUNT_ADDRESS' or 'PUBLIC_KEY'" + }, + "filterValue": { + "type": "string", + "description": "The value of the filter to apply for the specified type. For example, a specific email or name string." + }, + "paginationOptions": { + "$ref": "#/definitions/v1Pagination", + "description": "Parameters used for cursor-based pagination." + } + }, + "required": ["organizationId"] + }, + "v1GetSubOrgIdsResponse": { + "type": "object", + "properties": { + "organizationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for the matching sub-organizations." + } + }, + "required": ["organizationIds"] + }, + "v1GetUserRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given user." + } + }, + "required": ["organizationId", "userId"] + }, + "v1GetUserResponse": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/v1User", + "description": "Web and/or API user within your organization." + } + }, + "required": ["user"] + }, + "v1GetUsersRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetUsersResponse": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1User" + }, + "description": "A list of users." + } + }, + "required": ["users"] + }, + "v1GetVerifiedSubOrgIdsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for the parent organization. This is used to find sub-organizations within it." + }, + "filterType": { + "type": "string", + "description": "Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'." + }, + "filterValue": { + "type": "string", + "description": "The value of the filter to apply for the specified type. For example, a specific email or phone number string." + }, + "paginationOptions": { + "$ref": "#/definitions/v1Pagination", + "description": "Parameters used for cursor-based pagination." + } + }, + "required": ["organizationId"] + }, + "v1GetVerifiedSubOrgIdsResponse": { + "type": "object", + "properties": { + "organizationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for the matching sub-organizations." + } + }, + "required": ["organizationIds"] + }, + "v1GetWalletAccountRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "walletId": { + "type": "string", + "description": "Unique identifier for a given wallet." + }, + "address": { + "type": "string", + "description": "Address corresponding to a wallet account." + }, + "path": { + "type": "string", + "description": "Path corresponding to a wallet account." + } + }, + "required": ["organizationId", "walletId"] + }, + "v1GetWalletAccountResponse": { + "type": "object", + "properties": { + "account": { + "$ref": "#/definitions/v1WalletAccount", + "description": "The resulting wallet account." + } + }, + "required": ["account"] + }, + "v1GetWalletAccountsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "walletId": { + "type": "string", + "description": "Unique identifier for a given wallet. If not provided, all accounts for the organization will be returned." + }, + "includeWalletDetails": { + "type": "boolean", + "description": "Optional flag to specify if the wallet details should be included in the response. Default = false." + }, + "paginationOptions": { + "$ref": "#/definitions/v1Pagination", + "description": "Parameters used for cursor-based pagination." + } + }, + "required": ["organizationId"] + }, + "v1GetWalletAccountsResponse": { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WalletAccount" + }, + "description": "A list of accounts generated from a wallet that share a common seed." + } + }, + "required": ["accounts"] + }, + "v1GetWalletRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "walletId": { + "type": "string", + "description": "Unique identifier for a given wallet." + } + }, + "required": ["organizationId", "walletId"] + }, + "v1GetWalletResponse": { + "type": "object", + "properties": { + "wallet": { + "$ref": "#/definitions/v1Wallet", + "description": "A collection of deterministically generated cryptographic public / private key pairs that share a common seed." + } + }, + "required": ["wallet"] + }, + "v1GetWalletsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetWalletsResponse": { + "type": "object", + "properties": { + "wallets": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Wallet" + }, + "description": "A list of wallets." + } + }, + "required": ["wallets"] + }, + "v1GetWhoamiRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization. If the request is being made by a WebAuthN user and their sub-organization ID is unknown, this can be the parent organization ID; using the sub-organization ID when possible is preferred due to performance reasons." + } + }, + "required": ["organizationId"] + }, + "v1GetWhoamiResponse": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "organizationName": { + "type": "string", + "description": "Human-readable name for an organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given user." + }, + "username": { + "type": "string", + "description": "Human-readable name for a user." + } + }, + "required": ["organizationId", "organizationName", "userId", "username"] + }, + "v1HashFunction": { + "type": "string", + "enum": [ + "HASH_FUNCTION_NO_OP", + "HASH_FUNCTION_SHA256", + "HASH_FUNCTION_KECCAK256", + "HASH_FUNCTION_NOT_APPLICABLE" + ] + }, + "v1ImportPrivateKeyIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User importing a Private Key." + }, + "privateKeyName": { + "type": "string", + "description": "Human-readable name for a Private Key." + }, + "encryptedBundle": { + "type": "string", + "description": "Bundle containing a raw private key encrypted to the enclave's target public key." + }, + "curve": { + "$ref": "#/definitions/v1Curve", + "description": "Cryptographic Curve used to generate a given Private Key." + }, + "addressFormats": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AddressFormat" + }, + "description": "Cryptocurrency-specific formats for a derived address (e.g., Ethereum)." + } + }, + "required": [ + "userId", + "privateKeyName", + "encryptedBundle", + "curve", + "addressFormats" + ] + }, + "v1ImportPrivateKeyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_IMPORT_PRIVATE_KEY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ImportPrivateKeyIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1ImportPrivateKeyResult": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a Private Key." + }, + "addresses": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/immutableactivityv1Address" + }, + "description": "A list of addresses." + } + }, + "required": ["privateKeyId", "addresses"] + }, + "v1ImportWalletIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User importing a Wallet." + }, + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + }, + "encryptedBundle": { + "type": "string", + "description": "Bundle containing a wallet mnemonic encrypted to the enclave's target public key." + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WalletAccountParams" + }, + "description": "A list of wallet Accounts." + } + }, + "required": ["userId", "walletName", "encryptedBundle", "accounts"] + }, + "v1ImportWalletRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_IMPORT_WALLET"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ImportWalletIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1ImportWalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a Wallet." + }, + "addresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of account addresses." + } + }, + "required": ["walletId", "addresses"] + }, + "v1InitFiatOnRampIntent": { + "type": "object", + "properties": { + "onrampProvider": { + "$ref": "#/definitions/v1FiatOnRampProvider", + "description": "Enum to specifiy which on-ramp provider to use" + }, + "walletAddress": { + "type": "string", + "description": "Destination wallet address for the buy transaction." + }, + "network": { + "$ref": "#/definitions/v1FiatOnRampBlockchainNetwork", + "description": "Blockchain network to be used for the transaction, e.g., bitcoin, ethereum. Maps to MoonPay's network or Coinbase's defaultNetwork." + }, + "cryptoCurrencyCode": { + "$ref": "#/definitions/v1FiatOnRampCryptoCurrency", + "description": "Code for the cryptocurrency to be purchased, e.g., btc, eth. Maps to MoonPay's currencyCode or Coinbase's defaultAsset." + }, + "fiatCurrencyCode": { + "$ref": "#/definitions/v1FiatOnRampCurrency", + "description": "Code for the fiat currency to be used in the transaction, e.g., USD, EUR." + }, + "fiatCurrencyAmount": { + "type": "string", + "description": "Specifies a preset fiat amount for the transaction, e.g., '100'. Must be greater than '20'. If not provided, the user will be prompted to enter an amount." + }, + "paymentMethod": { + "$ref": "#/definitions/v1FiatOnRampPaymentMethod", + "description": "Pre-selected payment method, e.g., CREDIT_DEBIT_CARD, APPLE_PAY. Validated against the chosen provider." + }, + "countryCode": { + "type": "string", + "description": "ISO 3166-1 two-digit country code for Coinbase representing the purchasing user’s country of residence, e.g., US, GB." + }, + "countrySubdivisionCode": { + "type": "string", + "description": "ISO 3166-2 two-digit country subdivision code for Coinbase representing the purchasing user’s subdivision of residence within their country, e.g. NY. Required if country_code=US." + }, + "sandboxMode": { + "type": "boolean", + "description": "Optional flag to indicate whether to use the sandbox mode to simulate transactions for the on-ramp provider. Default is false." + }, + "urlForSignature": { + "type": "string", + "description": "Optional MoonPay Widget URL to sign when using MoonPay client SDKs with URL Signing enabled." + } + }, + "required": [ + "onrampProvider", + "walletAddress", + "network", + "cryptoCurrencyCode" + ] + }, + "v1InitFiatOnRampRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_FIAT_ON_RAMP"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitFiatOnRampIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitFiatOnRampResult": { + "type": "object", + "properties": { + "onRampUrl": { + "type": "string", + "description": "Unique URL for a given fiat on-ramp flow." + }, + "onRampTransactionId": { + "type": "string", + "description": "Unique identifier used to retrieve transaction statuses for a given fiat on-ramp flow." + }, + "onRampUrlSignature": { + "type": "string", + "description": "Optional signature of the MoonPay Widget URL. The signature is generated if the Init Fiat On Ramp intent includes the urlForSignature field. The signature can be used to initialize the MoonPay SDKs when URL signing is enabled for your project." + } + }, + "required": ["onRampUrl", "onRampTransactionId"] + }, + "v1InitImportPrivateKeyIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User importing a Private Key." + } + }, + "required": ["userId"] + }, + "v1InitImportPrivateKeyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitImportPrivateKeyIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitImportPrivateKeyResult": { + "type": "object", + "properties": { + "importBundle": { + "type": "string", + "description": "Import bundle containing a public key and signature to use for importing client data." + } + }, + "required": ["importBundle"] + }, + "v1InitImportWalletIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User importing a Wallet." + } + }, + "required": ["userId"] + }, + "v1InitImportWalletRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_IMPORT_WALLET"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitImportWalletIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitImportWalletResult": { + "type": "object", + "properties": { + "importBundle": { + "type": "string", + "description": "Import bundle containing a public key and signature to use for importing client data." + } + }, + "required": ["importBundle"] + }, + "v1InitOtpAuthIntent": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Enum to specifiy whether to send OTP via SMS or email" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the OTP email" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact"] + }, + "v1InitOtpAuthIntentV2": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Enum to specifiy whether to send OTP via SMS or email" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "otpLength": { + "type": "integer", + "format": "int32", + "description": "Optional length of the OTP code. Default = 9" + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the OTP email" + }, + "alphanumeric": { + "type": "boolean", + "description": "Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact"] + }, + "v1InitOtpAuthRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_OTP_AUTH_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitOtpAuthIntentV2" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitOtpAuthResult": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "Unique identifier for an OTP authentication" + } + }, + "required": ["otpId"] + }, + "v1InitOtpAuthResultV2": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "Unique identifier for an OTP authentication" + } + }, + "required": ["otpId"] + }, + "v1InitOtpIntent": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "otpLength": { + "type": "integer", + "format": "int32", + "description": "Optional length of the OTP code. Default = 9" + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the OTP email" + }, + "alphanumeric": { + "type": "boolean", + "description": "Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact"] + }, + "v1InitOtpRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_OTP"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitOtpIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitOtpResult": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "Unique identifier for an OTP authentication" + } + }, + "required": ["otpId"] + }, + "v1InitUserEmailRecoveryIntent": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the user starting recovery" + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the recovery bundle will be encrypted." + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used." + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + } + }, + "required": ["email", "targetPublicKey"] + }, + "v1InitUserEmailRecoveryRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitUserEmailRecoveryIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitUserEmailRecoveryResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for the user being recovered." + } + }, + "required": ["userId"] + }, + "v1Intent": { + "type": "object", + "properties": { + "createOrganizationIntent": { + "$ref": "#/definitions/v1CreateOrganizationIntent" + }, + "createAuthenticatorsIntent": { + "$ref": "#/definitions/v1CreateAuthenticatorsIntent" + }, + "createUsersIntent": { + "$ref": "#/definitions/v1CreateUsersIntent" + }, + "createPrivateKeysIntent": { + "$ref": "#/definitions/v1CreatePrivateKeysIntent" + }, + "signRawPayloadIntent": { + "$ref": "#/definitions/v1SignRawPayloadIntent" + }, + "createInvitationsIntent": { + "$ref": "#/definitions/v1CreateInvitationsIntent" + }, + "acceptInvitationIntent": { + "$ref": "#/definitions/v1AcceptInvitationIntent" + }, + "createPolicyIntent": { + "$ref": "#/definitions/v1CreatePolicyIntent" + }, + "disablePrivateKeyIntent": { + "$ref": "#/definitions/v1DisablePrivateKeyIntent" + }, + "deleteUsersIntent": { + "$ref": "#/definitions/v1DeleteUsersIntent" + }, + "deleteAuthenticatorsIntent": { + "$ref": "#/definitions/v1DeleteAuthenticatorsIntent" + }, + "deleteInvitationIntent": { + "$ref": "#/definitions/v1DeleteInvitationIntent" + }, + "deleteOrganizationIntent": { + "$ref": "#/definitions/v1DeleteOrganizationIntent" + }, + "deletePolicyIntent": { + "$ref": "#/definitions/v1DeletePolicyIntent" + }, + "createUserTagIntent": { + "$ref": "#/definitions/v1CreateUserTagIntent" + }, + "deleteUserTagsIntent": { + "$ref": "#/definitions/v1DeleteUserTagsIntent" + }, + "signTransactionIntent": { + "$ref": "#/definitions/v1SignTransactionIntent" + }, + "createApiKeysIntent": { + "$ref": "#/definitions/v1CreateApiKeysIntent" + }, + "deleteApiKeysIntent": { + "$ref": "#/definitions/v1DeleteApiKeysIntent" + }, + "approveActivityIntent": { + "$ref": "#/definitions/v1ApproveActivityIntent" + }, + "rejectActivityIntent": { + "$ref": "#/definitions/v1RejectActivityIntent" + }, + "createPrivateKeyTagIntent": { + "$ref": "#/definitions/v1CreatePrivateKeyTagIntent" + }, + "deletePrivateKeyTagsIntent": { + "$ref": "#/definitions/v1DeletePrivateKeyTagsIntent" + }, + "createPolicyIntentV2": { + "$ref": "#/definitions/v1CreatePolicyIntentV2" + }, + "setPaymentMethodIntent": { + "$ref": "#/definitions/billingSetPaymentMethodIntent" + }, + "activateBillingTierIntent": { + "$ref": "#/definitions/billingActivateBillingTierIntent" + }, + "deletePaymentMethodIntent": { + "$ref": "#/definitions/billingDeletePaymentMethodIntent" + }, + "createPolicyIntentV3": { + "$ref": "#/definitions/v1CreatePolicyIntentV3" + }, + "createApiOnlyUsersIntent": { + "$ref": "#/definitions/v1CreateApiOnlyUsersIntent" + }, + "updateRootQuorumIntent": { + "$ref": "#/definitions/v1UpdateRootQuorumIntent" + }, + "updateUserTagIntent": { + "$ref": "#/definitions/v1UpdateUserTagIntent" + }, + "updatePrivateKeyTagIntent": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagIntent" + }, + "createAuthenticatorsIntentV2": { + "$ref": "#/definitions/v1CreateAuthenticatorsIntentV2" + }, + "acceptInvitationIntentV2": { + "$ref": "#/definitions/v1AcceptInvitationIntentV2" + }, + "createOrganizationIntentV2": { + "$ref": "#/definitions/v1CreateOrganizationIntentV2" + }, + "createUsersIntentV2": { + "$ref": "#/definitions/v1CreateUsersIntentV2" + }, + "createSubOrganizationIntent": { + "$ref": "#/definitions/v1CreateSubOrganizationIntent" + }, + "createSubOrganizationIntentV2": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV2" + }, + "updateAllowedOriginsIntent": { + "$ref": "#/definitions/v1UpdateAllowedOriginsIntent" + }, + "createPrivateKeysIntentV2": { + "$ref": "#/definitions/v1CreatePrivateKeysIntentV2" + }, + "updateUserIntent": { + "$ref": "#/definitions/v1UpdateUserIntent" + }, + "updatePolicyIntent": { + "$ref": "#/definitions/v1UpdatePolicyIntent" + }, + "setPaymentMethodIntentV2": { + "$ref": "#/definitions/billingSetPaymentMethodIntentV2" + }, + "createSubOrganizationIntentV3": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV3" + }, + "createWalletIntent": { + "$ref": "#/definitions/v1CreateWalletIntent" + }, + "createWalletAccountsIntent": { + "$ref": "#/definitions/v1CreateWalletAccountsIntent" + }, + "initUserEmailRecoveryIntent": { + "$ref": "#/definitions/v1InitUserEmailRecoveryIntent" + }, + "recoverUserIntent": { + "$ref": "#/definitions/v1RecoverUserIntent" + }, + "setOrganizationFeatureIntent": { + "$ref": "#/definitions/v1SetOrganizationFeatureIntent" + }, + "removeOrganizationFeatureIntent": { + "$ref": "#/definitions/v1RemoveOrganizationFeatureIntent" + }, + "signRawPayloadIntentV2": { + "$ref": "#/definitions/v1SignRawPayloadIntentV2" + }, + "signTransactionIntentV2": { + "$ref": "#/definitions/v1SignTransactionIntentV2" + }, + "exportPrivateKeyIntent": { + "$ref": "#/definitions/v1ExportPrivateKeyIntent" + }, + "exportWalletIntent": { + "$ref": "#/definitions/v1ExportWalletIntent" + }, + "createSubOrganizationIntentV4": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV4" + }, + "emailAuthIntent": { + "$ref": "#/definitions/v1EmailAuthIntent" + }, + "exportWalletAccountIntent": { + "$ref": "#/definitions/v1ExportWalletAccountIntent" + }, + "initImportWalletIntent": { + "$ref": "#/definitions/v1InitImportWalletIntent" + }, + "importWalletIntent": { + "$ref": "#/definitions/v1ImportWalletIntent" + }, + "initImportPrivateKeyIntent": { + "$ref": "#/definitions/v1InitImportPrivateKeyIntent" + }, + "importPrivateKeyIntent": { + "$ref": "#/definitions/v1ImportPrivateKeyIntent" + }, + "createPoliciesIntent": { + "$ref": "#/definitions/v1CreatePoliciesIntent" + }, + "signRawPayloadsIntent": { + "$ref": "#/definitions/v1SignRawPayloadsIntent" + }, + "createReadOnlySessionIntent": { + "$ref": "#/definitions/v1CreateReadOnlySessionIntent" + }, + "createOauthProvidersIntent": { + "$ref": "#/definitions/v1CreateOauthProvidersIntent" + }, + "deleteOauthProvidersIntent": { + "$ref": "#/definitions/v1DeleteOauthProvidersIntent" + }, + "createSubOrganizationIntentV5": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV5" + }, + "oauthIntent": { + "$ref": "#/definitions/v1OauthIntent" + }, + "createApiKeysIntentV2": { + "$ref": "#/definitions/v1CreateApiKeysIntentV2" + }, + "createReadWriteSessionIntent": { + "$ref": "#/definitions/v1CreateReadWriteSessionIntent" + }, + "emailAuthIntentV2": { + "$ref": "#/definitions/v1EmailAuthIntentV2" + }, + "createSubOrganizationIntentV6": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV6" + }, + "deletePrivateKeysIntent": { + "$ref": "#/definitions/v1DeletePrivateKeysIntent" + }, + "deleteWalletsIntent": { + "$ref": "#/definitions/v1DeleteWalletsIntent" + }, + "createReadWriteSessionIntentV2": { + "$ref": "#/definitions/v1CreateReadWriteSessionIntentV2" + }, + "deleteSubOrganizationIntent": { + "$ref": "#/definitions/v1DeleteSubOrganizationIntent" + }, + "initOtpAuthIntent": { + "$ref": "#/definitions/v1InitOtpAuthIntent" + }, + "otpAuthIntent": { + "$ref": "#/definitions/v1OtpAuthIntent" + }, + "createSubOrganizationIntentV7": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV7" + }, + "updateWalletIntent": { + "$ref": "#/definitions/v1UpdateWalletIntent" + }, + "updatePolicyIntentV2": { + "$ref": "#/definitions/v1UpdatePolicyIntentV2" + }, + "createUsersIntentV3": { + "$ref": "#/definitions/v1CreateUsersIntentV3" + }, + "initOtpAuthIntentV2": { + "$ref": "#/definitions/v1InitOtpAuthIntentV2" + }, + "initOtpIntent": { + "$ref": "#/definitions/v1InitOtpIntent" + }, + "verifyOtpIntent": { + "$ref": "#/definitions/v1VerifyOtpIntent" + }, + "otpLoginIntent": { + "$ref": "#/definitions/v1OtpLoginIntent" + }, + "stampLoginIntent": { + "$ref": "#/definitions/v1StampLoginIntent" + }, + "oauthLoginIntent": { + "$ref": "#/definitions/v1OauthLoginIntent" + }, + "updateUserNameIntent": { + "$ref": "#/definitions/v1UpdateUserNameIntent" + }, + "updateUserEmailIntent": { + "$ref": "#/definitions/v1UpdateUserEmailIntent" + }, + "updateUserPhoneNumberIntent": { + "$ref": "#/definitions/v1UpdateUserPhoneNumberIntent" + }, + "initFiatOnRampIntent": { + "$ref": "#/definitions/v1InitFiatOnRampIntent" + }, + "createSmartContractInterfaceIntent": { + "$ref": "#/definitions/v1CreateSmartContractInterfaceIntent" + }, + "deleteSmartContractInterfaceIntent": { + "$ref": "#/definitions/v1DeleteSmartContractInterfaceIntent" + }, + "enableAuthProxyIntent": { + "$ref": "#/definitions/v1EnableAuthProxyIntent" + }, + "disableAuthProxyIntent": { + "$ref": "#/definitions/v1DisableAuthProxyIntent" + }, + "updateAuthProxyConfigIntent": { + "$ref": "#/definitions/v1UpdateAuthProxyConfigIntent" + }, + "createOauth2CredentialIntent": { + "$ref": "#/definitions/v1CreateOauth2CredentialIntent" + }, + "updateOauth2CredentialIntent": { + "$ref": "#/definitions/v1UpdateOauth2CredentialIntent" + }, + "deleteOauth2CredentialIntent": { + "$ref": "#/definitions/v1DeleteOauth2CredentialIntent" + }, + "oauth2AuthenticateIntent": { + "$ref": "#/definitions/v1Oauth2AuthenticateIntent" + }, + "deleteWalletAccountsIntent": { + "$ref": "#/definitions/v1DeleteWalletAccountsIntent" + }, + "deletePoliciesIntent": { + "$ref": "#/definitions/v1DeletePoliciesIntent" + } + } + }, + "v1Invitation": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation object." + }, + "receiverUserName": { + "type": "string", + "description": "The name of the intended Invitation recipient." + }, + "receiverEmail": { + "type": "string", + "description": "The email address of the intended Invitation recipient." + }, + "receiverUserTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of tags assigned to the Invitation recipient." + }, + "accessType": { + "$ref": "#/definitions/v1AccessType", + "description": "The User's permissible access method(s)." + }, + "status": { + "$ref": "#/definitions/v1InvitationStatus", + "description": "The current processing status of a specified Invitation." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "senderUserId": { + "type": "string", + "description": "Unique identifier for the Sender of an Invitation." + } + }, + "required": [ + "invitationId", + "receiverUserName", + "receiverEmail", + "receiverUserTags", + "accessType", + "status", + "createdAt", + "updatedAt", + "senderUserId" + ] + }, + "v1InvitationParams": { + "type": "object", + "properties": { + "receiverUserName": { + "type": "string", + "description": "The name of the intended Invitation recipient." + }, + "receiverUserEmail": { + "type": "string", + "description": "The email address of the intended Invitation recipient." + }, + "receiverUserTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of tags assigned to the Invitation recipient. This field, if not needed, should be an empty array in your request body." + }, + "accessType": { + "$ref": "#/definitions/v1AccessType", + "description": "The User's permissible access method(s)." + }, + "senderUserId": { + "type": "string", + "description": "Unique identifier for the Sender of an Invitation." + } + }, + "required": [ + "receiverUserName", + "receiverUserEmail", + "receiverUserTags", + "accessType", + "senderUserId" + ] + }, + "v1InvitationStatus": { + "type": "string", + "enum": [ + "INVITATION_STATUS_CREATED", + "INVITATION_STATUS_ACCEPTED", + "INVITATION_STATUS_REVOKED" + ] + }, + "v1ListOauth2CredentialsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + } + }, + "required": ["organizationId"] + }, + "v1ListOauth2CredentialsResponse": { + "type": "object", + "properties": { + "oauth2Credentials": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Oauth2Credential" + } + } + }, + "required": ["oauth2Credentials"] + }, + "v1ListPrivateKeyTagsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1ListPrivateKeyTagsResponse": { + "type": "object", + "properties": { + "privateKeyTags": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/datav1Tag" + }, + "description": "A list of private key tags." + } + }, + "required": ["privateKeyTags"] + }, + "v1ListUserTagsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1ListUserTagsResponse": { + "type": "object", + "properties": { + "userTags": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/datav1Tag" + }, + "description": "A list of user tags." + } + }, + "required": ["userTags"] + }, + "v1MnemonicLanguage": { + "type": "string", + "enum": [ + "MNEMONIC_LANGUAGE_ENGLISH", + "MNEMONIC_LANGUAGE_SIMPLIFIED_CHINESE", + "MNEMONIC_LANGUAGE_TRADITIONAL_CHINESE", + "MNEMONIC_LANGUAGE_CZECH", + "MNEMONIC_LANGUAGE_FRENCH", + "MNEMONIC_LANGUAGE_ITALIAN", + "MNEMONIC_LANGUAGE_JAPANESE", + "MNEMONIC_LANGUAGE_KOREAN", + "MNEMONIC_LANGUAGE_SPANISH" + ] + }, + "v1NOOPCodegenAnchorResponse": { + "type": "object", + "properties": { + "stamp": { + "$ref": "#/definitions/v1WebAuthnStamp" + } + }, + "required": ["stamp"] + }, + "v1Oauth2AuthenticateIntent": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "The OAuth 2.0 credential id whose client_id and client_secret will be used in the OAuth 2.0 flow" + }, + "authCode": { + "type": "string", + "description": "The auth_code provided by the OAuth 2.0 provider to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow" + }, + "redirectUri": { + "type": "string", + "description": "The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider" + }, + "codeVerifier": { + "type": "string", + "description": "The code verifier used by OAuth 2.0 PKCE providers" + }, + "nonce": { + "type": "string", + "description": "An optional nonce used by the client to prevent replay/substitution of an ID token" + }, + "bearerTokenTargetPublicKey": { + "type": "string", + "description": "An optional P256 public key to which, if provided, the bearer token will be encrypted and returned via the `encrypted_bearer_token` claim of the OIDC Token" + } + }, + "required": [ + "oauth2CredentialId", + "authCode", + "redirectUri", + "codeVerifier" + ] + }, + "v1Oauth2AuthenticateRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OAUTH2_AUTHENTICATE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1Oauth2AuthenticateIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1Oauth2AuthenticateResult": { + "type": "object", + "properties": { + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token issued by Turnkey to be used with the LoginWithOAuth activity" + } + }, + "required": ["oidcToken"] + }, + "v1Oauth2Credential": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier for a given OAuth 2.0 Credential." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for an Organization." + }, + "provider": { + "$ref": "#/definitions/v1Oauth2Provider", + "description": "The provider for a given OAuth 2.0 Credential." + }, + "clientId": { + "type": "string", + "description": "The client id for a given OAuth 2.0 Credential." + }, + "encryptedClientSecret": { + "type": "string", + "description": "The encrypted client secret for a given OAuth 2.0 Credential encrypted to the TLS Fetcher quorum key." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "oauth2CredentialId", + "organizationId", + "provider", + "clientId", + "encryptedClientSecret", + "createdAt", + "updatedAt" + ] + }, + "v1Oauth2Provider": { + "type": "string", + "enum": ["OAUTH2_PROVIDER_X", "OAUTH2_PROVIDER_DISCORD"] + }, + "v1OauthIntent": { + "type": "object", + "properties": { + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token" + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the oauth bundle (credentials) will be encrypted." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Oauth - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Oauth API keys" + } + }, + "required": ["oidcToken", "targetPublicKey"] + }, + "v1OauthLoginIntent": { + "type": "object", + "properties": { + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token" + }, + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Login API keys" + } + }, + "required": ["oidcToken", "publicKey"] + }, + "v1OauthLoginRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OAUTH_LOGIN"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1OauthLoginIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1OauthLoginResult": { + "type": "object", + "properties": { + "session": { + "type": "string", + "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + } + }, + "required": ["session"] + }, + "v1OauthProvider": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Unique identifier for an OAuth Provider" + }, + "providerName": { + "type": "string", + "description": "Human-readable name to identify a Provider." + }, + "issuer": { + "type": "string", + "description": "The issuer of the token, typically a URL indicating the authentication server, e.g https://accounts.google.com" + }, + "audience": { + "type": "string", + "description": "Expected audience ('aud' attribute of the signed token) which represents the app ID" + }, + "subject": { + "type": "string", + "description": "Expected subject ('sub' attribute of the signed token) which represents the user ID" + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "providerId", + "providerName", + "issuer", + "audience", + "subject", + "createdAt", + "updatedAt" + ] + }, + "v1OauthProviderParams": { + "type": "object", + "properties": { + "providerName": { + "type": "string", + "description": "Human-readable name to identify a Provider." + }, + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token" + } + }, + "required": ["providerName", "oidcToken"] + }, + "v1OauthRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OAUTH"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1OauthIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1OauthResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for the authenticating User." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for the created API key." + }, + "credentialBundle": { + "type": "string", + "description": "HPKE encrypted credential bundle" + } + }, + "required": ["userId", "apiKeyId", "credentialBundle"] + }, + "v1Operator": { + "type": "string", + "enum": [ + "OPERATOR_EQUAL", + "OPERATOR_MORE_THAN", + "OPERATOR_MORE_THAN_OR_EQUAL", + "OPERATOR_LESS_THAN", + "OPERATOR_LESS_THAN_OR_EQUAL", + "OPERATOR_CONTAINS", + "OPERATOR_NOT_EQUAL", + "OPERATOR_IN", + "OPERATOR_NOT_IN", + "OPERATOR_CONTAINS_ONE", + "OPERATOR_CONTAINS_ALL" + ] + }, + "v1OrganizationData": { + "type": "object", + "properties": { + "organizationId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1User" + } + }, + "policies": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Policy" + } + }, + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKey" + } + }, + "invitations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Invitation" + } + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/datav1Tag" + } + }, + "rootQuorum": { + "$ref": "#/definitions/externaldatav1Quorum" + }, + "features": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Feature" + } + }, + "wallets": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Wallet" + } + }, + "smartContractInterfaceReferences": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1SmartContractInterfaceReference" + } + } + } + }, + "v1OtpAuthIntent": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "ID representing the result of an init OTP activity." + }, + "otpCode": { + "type": "string", + "description": "OTP sent out to a user's contact (email or SMS)" + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the OTP bundle (credentials) will be encrypted." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to OTP Auth - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated OTP Auth API keys" + } + }, + "required": ["otpId", "otpCode", "targetPublicKey"] + }, + "v1OtpAuthRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OTP_AUTH"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1OtpAuthIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1OtpAuthResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for the authenticating User." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for the created API key." + }, + "credentialBundle": { + "type": "string", + "description": "HPKE encrypted credential bundle" + } + }, + "required": ["userId"] + }, + "v1OtpLoginIntent": { + "type": "object", + "properties": { + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact" + }, + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Login API keys" + }, + "clientSignature": { + "type": "string", + "description": "Optional signature associated with the public key passed into the verification step. This must be a hex-encoded ECDSA signature over the verification token. Only required if a public key was provided during the verification step." + } + }, + "required": ["verificationToken", "publicKey"] + }, + "v1OtpLoginRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OTP_LOGIN"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1OtpLoginIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1OtpLoginResult": { + "type": "object", + "properties": { + "session": { + "type": "string", + "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + } + }, + "required": ["session"] + }, + "v1Outcome": { + "type": "string", + "enum": [ + "OUTCOME_ALLOW", + "OUTCOME_DENY_EXPLICIT", + "OUTCOME_DENY_IMPLICIT", + "OUTCOME_REQUIRES_CONSENSUS", + "OUTCOME_REJECTED", + "OUTCOME_ERROR" + ] + }, + "v1Pagination": { + "type": "object", + "properties": { + "limit": { + "type": "string", + "description": "A limit of the number of object to be returned, between 1 and 100. Defaults to 10." + }, + "before": { + "type": "string", + "description": "A pagination cursor. This is an object ID that enables you to fetch all objects before this ID." + }, + "after": { + "type": "string", + "description": "A pagination cursor. This is an object ID that enables you to fetch all objects after this ID." + } + } + }, + "v1PathFormat": { + "type": "string", + "enum": ["PATH_FORMAT_BIP32"] + }, + "v1PayloadEncoding": { + "type": "string", + "enum": [ + "PAYLOAD_ENCODING_HEXADECIMAL", + "PAYLOAD_ENCODING_TEXT_UTF8", + "PAYLOAD_ENCODING_EIP712", + "PAYLOAD_ENCODING_EIP7702_AUTHORIZATION" + ] + }, + "v1Policy": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + }, + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "effect": { + "$ref": "#/definitions/v1Effect", + "description": "The instruction to DENY or ALLOW a particular activity following policy selector(s)." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "notes": { + "type": "string", + "description": "Human-readable notes added by a User to describe a particular policy." + }, + "consensus": { + "type": "string", + "description": "A consensus expression that evalutes to true or false." + }, + "condition": { + "type": "string", + "description": "A condition expression that evalutes to true or false." + } + }, + "required": [ + "policyId", + "policyName", + "effect", + "createdAt", + "updatedAt", + "notes", + "consensus", + "condition" + ] + }, + "v1PrivateKey": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + }, + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to sign messages and transactions." + }, + "privateKeyName": { + "type": "string", + "description": "Human-readable name for a Private Key." + }, + "curve": { + "$ref": "#/definitions/v1Curve", + "description": "Cryptographic Curve used to generate a given Private Key." + }, + "addresses": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/externaldatav1Address" + }, + "description": "Derived cryptocurrency addresses for a given Private Key." + }, + "privateKeyTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key Tag IDs." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "exported": { + "type": "boolean", + "description": "True when a given Private Key is exported, false otherwise." + }, + "imported": { + "type": "boolean", + "description": "True when a given Private Key is imported, false otherwise." + } + }, + "required": [ + "privateKeyId", + "publicKey", + "privateKeyName", + "curve", + "addresses", + "privateKeyTags", + "createdAt", + "updatedAt", + "exported", + "imported" + ] + }, + "v1PrivateKeyParams": { + "type": "object", + "properties": { + "privateKeyName": { + "type": "string", + "description": "Human-readable name for a Private Key." + }, + "curve": { + "$ref": "#/definitions/v1Curve", + "description": "Cryptographic Curve used to generate a given Private Key." + }, + "privateKeyTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key Tag IDs. This field, if not needed, should be an empty array in your request body." + }, + "addressFormats": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AddressFormat" + }, + "description": "Cryptocurrency-specific formats for a derived address (e.g., Ethereum)." + } + }, + "required": [ + "privateKeyName", + "curve", + "privateKeyTags", + "addressFormats" + ] + }, + "v1PrivateKeyResult": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/immutableactivityv1Address" + } + } + } + }, + "v1PublicKeyCredentialWithAttestation": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["public-key"] + }, + "rawId": { + "type": "string" + }, + "authenticatorAttachment": { + "type": "string", + "enum": ["cross-platform", "platform"], + "x-nullable": true + }, + "response": { + "$ref": "#/definitions/v1AuthenticatorAttestationResponse" + }, + "clientExtensionResults": { + "$ref": "#/definitions/v1SimpleClientExtensionResults" + } + }, + "required": ["id", "type", "rawId", "response", "clientExtensionResults"] + }, + "v1RecoverUserIntent": { + "type": "object", + "properties": { + "authenticator": { + "$ref": "#/definitions/v1AuthenticatorParamsV2", + "description": "The new authenticator to register." + }, + "userId": { + "type": "string", + "description": "Unique identifier for the user performing recovery." + } + }, + "required": ["authenticator", "userId"] + }, + "v1RecoverUserRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_RECOVER_USER"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1RecoverUserIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1RecoverUserResult": { + "type": "object", + "properties": { + "authenticatorId": { + "type": "array", + "items": { + "type": "string" + }, + "description": "ID of the authenticator created." + } + }, + "required": ["authenticatorId"] + }, + "v1RejectActivityIntent": { + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "An artifact verifying a User's action." + } + }, + "required": ["fingerprint"] + }, + "v1RejectActivityRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_REJECT_ACTIVITY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1RejectActivityIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1RemoveOrganizationFeatureIntent": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/v1FeatureName", + "description": "Name of the feature to remove" + } + }, + "required": ["name"] + }, + "v1RemoveOrganizationFeatureRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1RemoveOrganizationFeatureIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1RemoveOrganizationFeatureResult": { + "type": "object", + "properties": { + "features": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Feature" + }, + "description": "Resulting list of organization features." + } + }, + "required": ["features"] + }, + "v1Result": { + "type": "object", + "properties": { + "createOrganizationResult": { + "$ref": "#/definitions/v1CreateOrganizationResult" + }, + "createAuthenticatorsResult": { + "$ref": "#/definitions/v1CreateAuthenticatorsResult" + }, + "createUsersResult": { + "$ref": "#/definitions/v1CreateUsersResult" + }, + "createPrivateKeysResult": { + "$ref": "#/definitions/v1CreatePrivateKeysResult" + }, + "createInvitationsResult": { + "$ref": "#/definitions/v1CreateInvitationsResult" + }, + "acceptInvitationResult": { + "$ref": "#/definitions/v1AcceptInvitationResult" + }, + "signRawPayloadResult": { + "$ref": "#/definitions/v1SignRawPayloadResult" + }, + "createPolicyResult": { + "$ref": "#/definitions/v1CreatePolicyResult" + }, + "disablePrivateKeyResult": { + "$ref": "#/definitions/v1DisablePrivateKeyResult" + }, + "deleteUsersResult": { + "$ref": "#/definitions/v1DeleteUsersResult" + }, + "deleteAuthenticatorsResult": { + "$ref": "#/definitions/v1DeleteAuthenticatorsResult" + }, + "deleteInvitationResult": { + "$ref": "#/definitions/v1DeleteInvitationResult" + }, + "deleteOrganizationResult": { + "$ref": "#/definitions/v1DeleteOrganizationResult" + }, + "deletePolicyResult": { + "$ref": "#/definitions/v1DeletePolicyResult" + }, + "createUserTagResult": { + "$ref": "#/definitions/v1CreateUserTagResult" + }, + "deleteUserTagsResult": { + "$ref": "#/definitions/v1DeleteUserTagsResult" + }, + "signTransactionResult": { + "$ref": "#/definitions/v1SignTransactionResult" + }, + "deleteApiKeysResult": { + "$ref": "#/definitions/v1DeleteApiKeysResult" + }, + "createApiKeysResult": { + "$ref": "#/definitions/v1CreateApiKeysResult" + }, + "createPrivateKeyTagResult": { + "$ref": "#/definitions/v1CreatePrivateKeyTagResult" + }, + "deletePrivateKeyTagsResult": { + "$ref": "#/definitions/v1DeletePrivateKeyTagsResult" + }, + "setPaymentMethodResult": { + "$ref": "#/definitions/billingSetPaymentMethodResult" + }, + "activateBillingTierResult": { + "$ref": "#/definitions/billingActivateBillingTierResult" + }, + "deletePaymentMethodResult": { + "$ref": "#/definitions/billingDeletePaymentMethodResult" + }, + "createApiOnlyUsersResult": { + "$ref": "#/definitions/v1CreateApiOnlyUsersResult" + }, + "updateRootQuorumResult": { + "$ref": "#/definitions/v1UpdateRootQuorumResult" + }, + "updateUserTagResult": { + "$ref": "#/definitions/v1UpdateUserTagResult" + }, + "updatePrivateKeyTagResult": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagResult" + }, + "createSubOrganizationResult": { + "$ref": "#/definitions/v1CreateSubOrganizationResult" + }, + "updateAllowedOriginsResult": { + "$ref": "#/definitions/v1UpdateAllowedOriginsResult" + }, + "createPrivateKeysResultV2": { + "$ref": "#/definitions/v1CreatePrivateKeysResultV2" + }, + "updateUserResult": { + "$ref": "#/definitions/v1UpdateUserResult" + }, + "updatePolicyResult": { + "$ref": "#/definitions/v1UpdatePolicyResult" + }, + "createSubOrganizationResultV3": { + "$ref": "#/definitions/v1CreateSubOrganizationResultV3" + }, + "createWalletResult": { + "$ref": "#/definitions/v1CreateWalletResult" + }, + "createWalletAccountsResult": { + "$ref": "#/definitions/v1CreateWalletAccountsResult" + }, + "initUserEmailRecoveryResult": { + "$ref": "#/definitions/v1InitUserEmailRecoveryResult" + }, + "recoverUserResult": { + "$ref": "#/definitions/v1RecoverUserResult" + }, + "setOrganizationFeatureResult": { + "$ref": "#/definitions/v1SetOrganizationFeatureResult" + }, + "removeOrganizationFeatureResult": { + "$ref": "#/definitions/v1RemoveOrganizationFeatureResult" + }, + "exportPrivateKeyResult": { + "$ref": "#/definitions/v1ExportPrivateKeyResult" + }, + "exportWalletResult": { + "$ref": "#/definitions/v1ExportWalletResult" + }, + "createSubOrganizationResultV4": { + "$ref": "#/definitions/v1CreateSubOrganizationResultV4" + }, + "emailAuthResult": { + "$ref": "#/definitions/v1EmailAuthResult" + }, + "exportWalletAccountResult": { + "$ref": "#/definitions/v1ExportWalletAccountResult" + }, + "initImportWalletResult": { + "$ref": "#/definitions/v1InitImportWalletResult" + }, + "importWalletResult": { + "$ref": "#/definitions/v1ImportWalletResult" + }, + "initImportPrivateKeyResult": { + "$ref": "#/definitions/v1InitImportPrivateKeyResult" + }, + "importPrivateKeyResult": { + "$ref": "#/definitions/v1ImportPrivateKeyResult" + }, + "createPoliciesResult": { + "$ref": "#/definitions/v1CreatePoliciesResult" + }, + "signRawPayloadsResult": { + "$ref": "#/definitions/v1SignRawPayloadsResult" + }, + "createReadOnlySessionResult": { + "$ref": "#/definitions/v1CreateReadOnlySessionResult" + }, + "createOauthProvidersResult": { + "$ref": "#/definitions/v1CreateOauthProvidersResult" + }, + "deleteOauthProvidersResult": { + "$ref": "#/definitions/v1DeleteOauthProvidersResult" + }, + "createSubOrganizationResultV5": { + "$ref": "#/definitions/v1CreateSubOrganizationResultV5" + }, + "oauthResult": { + "$ref": "#/definitions/v1OauthResult" + }, + "createReadWriteSessionResult": { + "$ref": "#/definitions/v1CreateReadWriteSessionResult" + }, + "createSubOrganizationResultV6": { + "$ref": "#/definitions/v1CreateSubOrganizationResultV6" + }, + "deletePrivateKeysResult": { + "$ref": "#/definitions/v1DeletePrivateKeysResult" + }, + "deleteWalletsResult": { + "$ref": "#/definitions/v1DeleteWalletsResult" + }, + "createReadWriteSessionResultV2": { + "$ref": "#/definitions/v1CreateReadWriteSessionResultV2" + }, + "deleteSubOrganizationResult": { + "$ref": "#/definitions/v1DeleteSubOrganizationResult" + }, + "initOtpAuthResult": { + "$ref": "#/definitions/v1InitOtpAuthResult" + }, + "otpAuthResult": { + "$ref": "#/definitions/v1OtpAuthResult" + }, + "createSubOrganizationResultV7": { + "$ref": "#/definitions/v1CreateSubOrganizationResultV7" + }, + "updateWalletResult": { + "$ref": "#/definitions/v1UpdateWalletResult" + }, + "updatePolicyResultV2": { + "$ref": "#/definitions/v1UpdatePolicyResultV2" + }, + "initOtpAuthResultV2": { + "$ref": "#/definitions/v1InitOtpAuthResultV2" + }, + "initOtpResult": { + "$ref": "#/definitions/v1InitOtpResult" + }, + "verifyOtpResult": { + "$ref": "#/definitions/v1VerifyOtpResult" + }, + "otpLoginResult": { + "$ref": "#/definitions/v1OtpLoginResult" + }, + "stampLoginResult": { + "$ref": "#/definitions/v1StampLoginResult" + }, + "oauthLoginResult": { + "$ref": "#/definitions/v1OauthLoginResult" + }, + "updateUserNameResult": { + "$ref": "#/definitions/v1UpdateUserNameResult" + }, + "updateUserEmailResult": { + "$ref": "#/definitions/v1UpdateUserEmailResult" + }, + "updateUserPhoneNumberResult": { + "$ref": "#/definitions/v1UpdateUserPhoneNumberResult" + }, + "initFiatOnRampResult": { + "$ref": "#/definitions/v1InitFiatOnRampResult" + }, + "createSmartContractInterfaceResult": { + "$ref": "#/definitions/v1CreateSmartContractInterfaceResult" + }, + "deleteSmartContractInterfaceResult": { + "$ref": "#/definitions/v1DeleteSmartContractInterfaceResult" + }, + "enableAuthProxyResult": { + "$ref": "#/definitions/v1EnableAuthProxyResult" + }, + "disableAuthProxyResult": { + "$ref": "#/definitions/v1DisableAuthProxyResult" + }, + "updateAuthProxyConfigResult": { + "$ref": "#/definitions/v1UpdateAuthProxyConfigResult" + }, + "createOauth2CredentialResult": { + "$ref": "#/definitions/v1CreateOauth2CredentialResult" + }, + "updateOauth2CredentialResult": { + "$ref": "#/definitions/v1UpdateOauth2CredentialResult" + }, + "deleteOauth2CredentialResult": { + "$ref": "#/definitions/v1DeleteOauth2CredentialResult" + }, + "oauth2AuthenticateResult": { + "$ref": "#/definitions/v1Oauth2AuthenticateResult" + }, + "deleteWalletAccountsResult": { + "$ref": "#/definitions/v1DeleteWalletAccountsResult" + }, + "deletePoliciesResult": { + "$ref": "#/definitions/v1DeletePoliciesResult" + } + } + }, + "v1RootUserParams": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "apiKeys", "authenticators"] + }, + "v1RootUserParamsV2": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + }, + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "apiKeys", "authenticators", "oauthProviders"] + }, + "v1RootUserParamsV3": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKeyParamsV2" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + }, + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "apiKeys", "authenticators", "oauthProviders"] + }, + "v1RootUserParamsV4": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "userPhoneNumber": { + "type": "string", + "description": "The user's phone number in E.164 format e.g. +13214567890" + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKeyParamsV2" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + }, + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "apiKeys", "authenticators", "oauthProviders"] + }, + "v1Selector": { + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/v1Operator" + }, + "target": { + "type": "string" + } + } + }, + "v1SelectorV2": { + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/v1Operator" + }, + "targets": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v1SetOrganizationFeatureIntent": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/v1FeatureName", + "description": "Name of the feature to set" + }, + "value": { + "type": "string", + "description": "Optional value for the feature. Will override existing values if feature is already set." + } + }, + "required": ["name", "value"] + }, + "v1SetOrganizationFeatureRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1SetOrganizationFeatureIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1SetOrganizationFeatureResult": { + "type": "object", + "properties": { + "features": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Feature" + }, + "description": "Resulting list of organization features." + } + }, + "required": ["features"] + }, + "v1SignRawPayloadIntent": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + }, + "payload": { + "type": "string", + "description": "Raw unsigned payload to be signed." + }, + "encoding": { + "$ref": "#/definitions/v1PayloadEncoding", + "description": "Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8)." + }, + "hashFunction": { + "$ref": "#/definitions/v1HashFunction", + "description": "Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032." + } + }, + "required": ["privateKeyId", "payload", "encoding", "hashFunction"] + }, + "v1SignRawPayloadIntentV2": { + "type": "object", + "properties": { + "signWith": { + "type": "string", + "description": "A Wallet account address, Private Key address, or Private Key identifier." + }, + "payload": { + "type": "string", + "description": "Raw unsigned payload to be signed." + }, + "encoding": { + "$ref": "#/definitions/v1PayloadEncoding", + "description": "Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8)." + }, + "hashFunction": { + "$ref": "#/definitions/v1HashFunction", + "description": "Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032." + } + }, + "required": ["signWith", "payload", "encoding", "hashFunction"] + }, + "v1SignRawPayloadRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1SignRawPayloadIntentV2" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1SignRawPayloadResult": { + "type": "object", + "properties": { + "r": { + "type": "string", + "description": "Component of an ECSDA signature." + }, + "s": { + "type": "string", + "description": "Component of an ECSDA signature." + }, + "v": { + "type": "string", + "description": "Component of an ECSDA signature." + } + }, + "required": ["r", "s", "v"] + }, + "v1SignRawPayloadsIntent": { + "type": "object", + "properties": { + "signWith": { + "type": "string", + "description": "A Wallet account address, Private Key address, or Private Key identifier." + }, + "payloads": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of raw unsigned payloads to be signed." + }, + "encoding": { + "$ref": "#/definitions/v1PayloadEncoding", + "description": "Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8)." + }, + "hashFunction": { + "$ref": "#/definitions/v1HashFunction", + "description": "Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032." + } + }, + "required": ["signWith", "payloads", "encoding", "hashFunction"] + }, + "v1SignRawPayloadsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_SIGN_RAW_PAYLOADS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1SignRawPayloadsIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1SignRawPayloadsResult": { + "type": "object", + "properties": { + "signatures": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1SignRawPayloadResult" + } + } + } + }, + "v1SignTransactionIntent": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + }, + "unsignedTransaction": { + "type": "string", + "description": "Raw unsigned transaction to be signed by a particular Private Key." + }, + "type": { + "$ref": "#/definitions/v1TransactionType" + } + }, + "required": ["privateKeyId", "unsignedTransaction", "type"] + }, + "v1SignTransactionIntentV2": { + "type": "object", + "properties": { + "signWith": { + "type": "string", + "description": "A Wallet account address, Private Key address, or Private Key identifier." + }, + "unsignedTransaction": { + "type": "string", + "description": "Raw unsigned transaction to be signed" + }, + "type": { + "$ref": "#/definitions/v1TransactionType" + } + }, + "required": ["signWith", "unsignedTransaction", "type"] + }, + "v1SignTransactionRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_SIGN_TRANSACTION_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1SignTransactionIntentV2" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1SignTransactionResult": { + "type": "object", + "properties": { + "signedTransaction": { + "type": "string" + } + }, + "required": ["signedTransaction"] + }, + "v1SignatureScheme": { + "type": "string", + "enum": ["SIGNATURE_SCHEME_EPHEMERAL_KEY_P256"] + }, + "v1SimpleClientExtensionResults": { + "type": "object", + "properties": { + "appid": { + "type": "boolean" + }, + "appidExclude": { + "type": "boolean" + }, + "credProps": { + "$ref": "#/definitions/v1CredPropsAuthenticationExtensionsClientOutputs" + } + } + }, + "v1SmartContractInterface": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "The Organization the Smart Contract Interface belongs to." + }, + "smartContractInterfaceId": { + "type": "string", + "description": "Unique identifier for a given Smart Contract Interface (ABI or IDL)." + }, + "smartContractAddress": { + "type": "string", + "description": "The address corresponding to the Smart Contract or Program." + }, + "smartContractInterface": { + "type": "string", + "description": "The JSON corresponding to the Smart Contract Interface (ABI or IDL)." + }, + "type": { + "type": "string", + "description": "The type corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + }, + "label": { + "type": "string", + "description": "The label corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + }, + "notes": { + "type": "string", + "description": "The notes corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "organizationId", + "smartContractInterfaceId", + "smartContractAddress", + "smartContractInterface", + "type", + "label", + "notes", + "createdAt", + "updatedAt" + ] + }, + "v1SmartContractInterfaceReference": { + "type": "object", + "properties": { + "smartContractInterfaceId": { + "type": "string" + }, + "smartContractAddress": { + "type": "string" + }, + "digest": { + "type": "string" + } + } + }, + "v1SmartContractInterfaceType": { + "type": "string", + "enum": [ + "SMART_CONTRACT_INTERFACE_TYPE_ETHEREUM", + "SMART_CONTRACT_INTERFACE_TYPE_SOLANA" + ] + }, + "v1SmsCustomizationParams": { + "type": "object", + "properties": { + "template": { + "type": "string", + "description": "Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}}" + } + } + }, + "v1StampLoginIntent": { + "type": "object", + "properties": { + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the passkey stamp associated with this request" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Login API keys" + } + }, + "required": ["publicKey"] + }, + "v1StampLoginRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_STAMP_LOGIN"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1StampLoginIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1StampLoginResult": { + "type": "object", + "properties": { + "session": { + "type": "string", + "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + } + }, + "required": ["session"] + }, + "v1TagType": { + "type": "string", + "enum": ["TAG_TYPE_USER", "TAG_TYPE_PRIVATE_KEY"] + }, + "v1TestRateLimitsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization. If the request is being made by a WebAuthN user and their sub-organization ID is unknown, this can be the parent organization ID; using the sub-organization ID when possible is preferred due to performance reasons." + }, + "isSetLimit": { + "type": "boolean", + "description": "Whether or not to set a limit on this request." + }, + "limit": { + "type": "integer", + "format": "int64", + "description": "Rate limit to set for org, if is_set_limit is set to true." + } + }, + "required": ["organizationId", "isSetLimit", "limit"] + }, + "v1TestRateLimitsResponse": { + "type": "object" + }, + "v1TransactionType": { + "type": "string", + "enum": [ + "TRANSACTION_TYPE_ETHEREUM", + "TRANSACTION_TYPE_SOLANA", + "TRANSACTION_TYPE_TRON", + "TRANSACTION_TYPE_BITCOIN" + ] + }, + "v1UpdateAllowedOriginsIntent": { + "type": "object", + "properties": { + "allowedOrigins": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Additional origins requests are allowed from besides Turnkey origins" + } + }, + "required": ["allowedOrigins"] + }, + "v1UpdateAllowedOriginsResult": { + "type": "object" + }, + "v1UpdateAuthProxyConfigIntent": { + "type": "object", + "properties": { + "allowedOrigins": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Updated list of allowed origins for CORS." + }, + "allowedAuthMethods": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Updated list of allowed proxy authentication methods." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Custom 'from' address for auth-related emails." + }, + "replyToEmailAddress": { + "type": "string", + "description": "Custom reply-to address for auth-related emails." + }, + "emailAuthTemplateId": { + "type": "string", + "description": "Template ID for email-auth messages." + }, + "otpTemplateId": { + "type": "string", + "description": "Template ID for OTP SMS messages." + }, + "emailCustomizationParams": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Overrides for auth-related email content." + }, + "smsCustomizationParams": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Overrides for auth-related SMS content." + }, + "walletKitSettings": { + "$ref": "#/definitions/v1WalletKitSettingsParams", + "description": "Overrides for react wallet kit related settings." + }, + "otpExpirationSeconds": { + "type": "integer", + "format": "int32", + "description": "OTP code lifetime in seconds." + }, + "verificationTokenExpirationSeconds": { + "type": "integer", + "format": "int32", + "description": "Verification-token lifetime in seconds." + }, + "sessionExpirationSeconds": { + "type": "integer", + "format": "int32", + "description": "Session lifetime in seconds." + }, + "otpAlphanumeric": { + "type": "boolean", + "description": "Enable alphanumeric OTP codes." + }, + "otpLength": { + "type": "integer", + "format": "int32", + "description": "Desired OTP code length (6–9)." + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Custom 'from' email sender for auth-related emails." + }, + "verificationTokenRequiredForGetAccountPii": { + "type": "boolean", + "description": "Verification token required for get account with PII (email/phone number). Default false." + } + } + }, + "v1UpdateAuthProxyConfigResult": { + "type": "object", + "properties": { + "configId": { + "type": "string", + "description": "Unique identifier for a given User. (representing the turnkey signer user id)" + } + } + }, + "v1UpdateOauth2CredentialIntent": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "The ID of the OAuth 2.0 credential to update" + }, + "provider": { + "$ref": "#/definitions/v1Oauth2Provider", + "description": "The OAuth 2.0 provider" + }, + "clientId": { + "type": "string", + "description": "The Client ID issued by the OAuth 2.0 provider" + }, + "encryptedClientSecret": { + "type": "string", + "description": "The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key" + } + }, + "required": [ + "oauth2CredentialId", + "provider", + "clientId", + "encryptedClientSecret" + ] + }, + "v1UpdateOauth2CredentialRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateOauth2CredentialIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateOauth2CredentialResult": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier of the OAuth 2.0 credential that was updated" + } + }, + "required": ["oauth2CredentialId"] + }, + "v1UpdatePolicyIntent": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + }, + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "policyEffect": { + "$ref": "#/definitions/v1Effect", + "description": "The instruction to DENY or ALLOW an activity (optional)." + }, + "policyCondition": { + "type": "string", + "description": "The condition expression that triggers the Effect (optional)." + }, + "policyConsensus": { + "type": "string", + "description": "The consensus expression that triggers the Effect (optional)." + }, + "policyNotes": { + "type": "string", + "description": "Accompanying notes for a Policy (optional)." + } + }, + "required": ["policyId"] + }, + "v1UpdatePolicyIntentV2": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + }, + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "policyEffect": { + "$ref": "#/definitions/v1Effect", + "description": "The instruction to DENY or ALLOW an activity (optional)." + }, + "policyCondition": { + "type": "string", + "description": "The condition expression that triggers the Effect (optional)." + }, + "policyConsensus": { + "type": "string", + "description": "The consensus expression that triggers the Effect (optional)." + }, + "policyNotes": { + "type": "string", + "description": "Accompanying notes for a Policy (optional)." + } + }, + "required": ["policyId"] + }, + "v1UpdatePolicyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_POLICY_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdatePolicyIntentV2" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdatePolicyResult": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + } + }, + "required": ["policyId"] + }, + "v1UpdatePolicyResultV2": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + } + }, + "required": ["policyId"] + }, + "v1UpdatePrivateKeyTagIntent": { + "type": "object", + "properties": { + "privateKeyTagId": { + "type": "string", + "description": "Unique identifier for a given Private Key Tag." + }, + "newPrivateKeyTagName": { + "type": "string", + "description": "The new, human-readable name for the tag with the given ID." + }, + "addPrivateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Keys IDs to add this tag to." + }, + "removePrivateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key IDs to remove this tag from." + } + }, + "required": ["privateKeyTagId", "addPrivateKeyIds", "removePrivateKeyIds"] + }, + "v1UpdatePrivateKeyTagRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdatePrivateKeyTagResult": { + "type": "object", + "properties": { + "privateKeyTagId": { + "type": "string", + "description": "Unique identifier for a given Private Key Tag." + } + }, + "required": ["privateKeyTagId"] + }, + "v1UpdateRootQuorumIntent": { + "type": "object", + "properties": { + "threshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach quorum." + }, + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The unique identifiers of users who comprise the quorum set." + } + }, + "required": ["threshold", "userIds"] + }, + "v1UpdateRootQuorumRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_ROOT_QUORUM"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateRootQuorumIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateRootQuorumResult": { + "type": "object" + }, + "v1UpdateUserEmailIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address. Setting this to an empty string will remove the user's email." + }, + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact" + } + }, + "required": ["userId", "userEmail"] + }, + "v1UpdateUserEmailRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_EMAIL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateUserEmailIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateUserEmailResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier of the User whose email was updated." + } + }, + "required": ["userId"] + }, + "v1UpdateUserIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "userTagIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An updated list of User Tags to apply to this User. This field, if not needed, should be an empty array in your request body." + }, + "userPhoneNumber": { + "type": "string", + "description": "The user's phone number in E.164 format e.g. +13214567890" + } + }, + "required": ["userId"] + }, + "v1UpdateUserNameIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userName": { + "type": "string", + "description": "Human-readable name for a User." + } + }, + "required": ["userId", "userName"] + }, + "v1UpdateUserNameRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_NAME"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateUserNameIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateUserNameResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier of the User whose name was updated." + } + }, + "required": ["userId"] + }, + "v1UpdateUserPhoneNumberIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userPhoneNumber": { + "type": "string", + "description": "The user's phone number in E.164 format e.g. +13214567890. Setting this to an empty string will remove the user's phone number." + }, + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact" + } + }, + "required": ["userId", "userPhoneNumber"] + }, + "v1UpdateUserPhoneNumberRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateUserPhoneNumberIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateUserPhoneNumberResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier of the User whose phone number was updated." + } + }, + "required": ["userId"] + }, + "v1UpdateUserRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateUserIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateUserResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "A User ID." + } + }, + "required": ["userId"] + }, + "v1UpdateUserTagIntent": { + "type": "object", + "properties": { + "userTagId": { + "type": "string", + "description": "Unique identifier for a given User Tag." + }, + "newUserTagName": { + "type": "string", + "description": "The new, human-readable name for the tag with the given ID." + }, + "addUserIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs to add this tag to." + }, + "removeUserIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs to remove this tag from." + } + }, + "required": ["userTagId", "addUserIds", "removeUserIds"] + }, + "v1UpdateUserTagRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_TAG"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateUserTagIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateUserTagResult": { + "type": "object", + "properties": { + "userTagId": { + "type": "string", + "description": "Unique identifier for a given User Tag." + } + }, + "required": ["userTagId"] + }, + "v1UpdateWalletIntent": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a given Wallet." + }, + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + } + }, + "required": ["walletId"] + }, + "v1UpdateWalletRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_WALLET"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateWalletIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateWalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "A Wallet ID." + } + }, + "required": ["walletId"] + }, + "v1User": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "userPhoneNumber": { + "type": "string", + "description": "The user's phone number in E.164 format e.g. +13214567890" + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Authenticator" + }, + "description": "A list of Authenticator parameters." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKey" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProvider" + }, + "description": "A list of Oauth Providers." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "userId", + "userName", + "authenticators", + "apiKeys", + "userTags", + "oauthProviders", + "createdAt", + "updatedAt" + ] + }, + "v1UserParams": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "accessType": { + "$ref": "#/definitions/v1AccessType", + "description": "The User's permissible access method(s)." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParams" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." + } + }, + "required": [ + "userName", + "accessType", + "apiKeys", + "authenticators", + "userTags" + ] + }, + "v1UserParamsV2": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "apiKeys", "authenticators", "userTags"] + }, + "v1UserParamsV3": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "userPhoneNumber": { + "type": "string", + "description": "The user's phone number in E.164 format e.g. +13214567890" + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKeyParamsV2" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + }, + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." + } + }, + "required": [ + "userName", + "apiKeys", + "authenticators", + "oauthProviders", + "userTags" + ] + }, + "v1VerifyOtpIntent": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "ID representing the result of an init OTP activity." + }, + "otpCode": { + "type": "string", + "description": "OTP sent out to a user's contact (email or SMS)" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the verification token is valid for. If not provided, a default of 1 hour will be used. Maximum value is 86400 seconds (24 hours)" + }, + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be added to the JWT response and verified in subsequent requests via a client proof signature" + } + }, + "required": ["otpId", "otpCode"] + }, + "v1VerifyOtpRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_VERIFY_OTP"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1VerifyOtpIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1VerifyOtpResult": { + "type": "object", + "properties": { + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests)" + } + }, + "required": ["verificationToken"] + }, + "v1Vote": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for a given Vote object." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "user": { + "$ref": "#/definitions/v1User", + "description": "Web and/or API user within your Organization." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given Activity object." + }, + "selection": { + "type": "string", + "enum": ["VOTE_SELECTION_APPROVED", "VOTE_SELECTION_REJECTED"] + }, + "message": { + "type": "string", + "description": "The raw message being signed within a Vote." + }, + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to sign messages and transactions." + }, + "signature": { + "type": "string", + "description": "The signature applied to a particular vote." + }, + "scheme": { + "type": "string", + "description": "Method used to produce a signature." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "id", + "userId", + "user", + "activityId", + "selection", + "message", + "publicKey", + "signature", + "scheme", + "createdAt" + ] + }, + "v1Wallet": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a given Wallet." + }, + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "exported": { + "type": "boolean", + "description": "True when a given Wallet is exported, false otherwise." + }, + "imported": { + "type": "boolean", + "description": "True when a given Wallet is imported, false otherwise." + } + }, + "required": [ + "walletId", + "walletName", + "createdAt", + "updatedAt", + "exported", + "imported" + ] + }, + "v1WalletAccount": { + "type": "object", + "properties": { + "walletAccountId": { + "type": "string", + "description": "Unique identifier for a given Wallet Account." + }, + "organizationId": { + "type": "string", + "description": "The Organization the Account belongs to." + }, + "walletId": { + "type": "string", + "description": "The Wallet the Account was derived from." + }, + "curve": { + "$ref": "#/definitions/v1Curve", + "description": "Cryptographic curve used to generate the Account." + }, + "pathFormat": { + "$ref": "#/definitions/v1PathFormat", + "description": "Path format used to generate the Account." + }, + "path": { + "type": "string", + "description": "Path used to generate the Account." + }, + "addressFormat": { + "$ref": "#/definitions/v1AddressFormat", + "description": "Address format used to generate the Account." + }, + "address": { + "type": "string", + "description": "Address generated using the Wallet seed and Account parameters." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "publicKey": { + "type": "string", + "description": "The public component of this wallet account's underlying cryptographic key pair." + }, + "walletDetails": { + "$ref": "#/definitions/v1Wallet", + "description": "Wallet details for this account. This is only present when include_wallet_details=true." + } + }, + "required": [ + "walletAccountId", + "organizationId", + "walletId", + "curve", + "pathFormat", + "path", + "addressFormat", + "address", + "createdAt", + "updatedAt" + ] + }, + "v1WalletAccountParams": { + "type": "object", + "properties": { + "curve": { + "$ref": "#/definitions/v1Curve", + "description": "Cryptographic curve used to generate a wallet Account." + }, + "pathFormat": { + "$ref": "#/definitions/v1PathFormat", + "description": "Path format used to generate a wallet Account." + }, + "path": { + "type": "string", + "description": "Path used to generate a wallet Account." + }, + "addressFormat": { + "$ref": "#/definitions/v1AddressFormat", + "description": "Address format used to generate a wallet Acccount." + } + }, + "required": ["curve", "pathFormat", "path", "addressFormat"] + }, + "v1WalletKitSettingsParams": { + "type": "object", + "properties": { + "enabledSocialProviders": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of enabled social login providers (e.g., 'apple', 'google', 'facebook')", + "title": "Enabled Social Providers" + }, + "oauthClientIds": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Mapping of social login providers to their Oauth client IDs.", + "title": "Oauth Client IDs" + }, + "oauthRedirectUrl": { + "type": "string", + "description": "Oauth redirect URL to be used for social login flows.", + "title": "Oauth Redirect URL" + } + } + }, + "v1WalletParams": { + "type": "object", + "properties": { + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WalletAccountParams" + }, + "description": "A list of wallet Accounts. This field, if not needed, should be an empty array in your request body." + }, + "mnemonicLength": { + "type": "integer", + "format": "int32", + "description": "Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24." + } + }, + "required": ["walletName", "accounts"] + }, + "v1WalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of account addresses." + } + }, + "required": ["walletId", "addresses"] + }, + "v1WebAuthnStamp": { + "type": "object", + "properties": { + "credentialId": { + "type": "string", + "description": "A base64 url encoded Unique identifier for a given credential." + }, + "clientDataJson": { + "type": "string", + "description": "A base64 encoded payload containing metadata about the signing context and the challenge." + }, + "authenticatorData": { + "type": "string", + "description": "A base64 encoded payload containing metadata about the authenticator." + }, + "signature": { + "type": "string", + "description": "The base64 url encoded signature bytes contained within the WebAuthn assertion response." + } + }, + "required": [ + "credentialId", + "clientDataJson", + "authenticatorData", + "signature" + ] + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "X-Stamp", + "in": "header" + }, + "AuthenticatorAuth": { + "type": "apiKey", + "name": "X-Stamp-WebAuthn", + "in": "header" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "AuthenticatorAuth": [] + } + ], + "x-tagGroups": [ + { + "name": "ORGANIZATIONS", + "tags": ["Organizations", "Invitations", "Policies", "Features"] + }, + { + "name": "WALLETS AND PRIVATE KEYS", + "tags": ["Wallets", "Signing", "Private Keys", "Private Key Tags"] + }, + { + "name": "USERS", + "tags": ["Users", "User Tags", "User Recovery", "User Auth"] + }, + { + "name": "CREDENTIALS", + "tags": ["Authenticators", "API Keys", "Sessions"] + }, + { + "name": "ACTIVITIES", + "tags": ["Activities", "Consensus"] + } + ] +} diff --git a/Scripts/Sources/Typegen/main.swift b/Scripts/Sources/Typegen/main.swift new file mode 100644 index 00000000..d8227852 --- /dev/null +++ b/Scripts/Sources/Typegen/main.swift @@ -0,0 +1,899 @@ +import Foundation +import Internal + +// MARK: - Configuration + +// Assume we're running from the project root (swift-sdk/) +let CURRENT_DIR = URL(fileURLWithPath: FileManager.default.currentDirectoryPath) + +let PUBLIC_API_SWAGGER_PATH = CURRENT_DIR + .appendingPathComponent("Scripts/Sources/Internal/Resources/public_api.swagger.json") + +let AUTH_PROXY_SWAGGER_PATH = CURRENT_DIR + .appendingPathComponent("Scripts/Sources/Internal/Resources/auth_proxy.swagger.json") + +let OUTPUT_PATH = CURRENT_DIR + .appendingPathComponent("Sources/TurnkeyTypes/Generated/Types.swift") + +let COMMENT_HEADER = "// @generated by Typegen. DO NOT EDIT BY HAND" + +// Import constants from Internal module +let VERSIONED_ACTIVITY_TYPES = CodegenConfig.versionedActivityTypes +let METHODS_WITH_ONLY_OPTIONAL_PARAMETERS = CodegenConfig.methodsWithOnlyOptionalParameters + +// MARK: - Models + +struct SwaggerSpec: Codable { + let swagger: String + let info: Info + let paths: [String: PathItem] + let definitions: [String: Definition] + let tags: [Tag]? + + struct Info: Codable { + let title: String + let version: String + } + + struct Tag: Codable { + let name: String + let description: String? + } + + struct PathItem: Codable { + let post: Operation? + let get: Operation? + } + + struct Operation: Codable { + let operationId: String + let summary: String? + let description: String? + let tags: [String]? + let parameters: [Parameter]? + let responses: [String: Response]? + } + + struct Parameter: Codable { + let name: String + let `in`: String + let required: Bool? + let schema: Schema? + } + + struct Schema: Codable { + let ref: String? + let type: String? + let items: Box? + let properties: [String: Box]? + let additionalProperties: Box? + let description: String? + let `enum`: [String]? + + enum CodingKeys: String, CodingKey { + case ref = "$ref" + case type, items, properties, additionalProperties, description + case `enum` + } + + indirect enum AdditionalProperties: Codable { + case bool(Bool) + case schema(Schema) + + init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let bool = try? container.decode(Bool.self) { + self = .bool(bool) + } else if let schema = try? container.decode(Schema.self) { + self = .schema(schema) + } else { + self = .bool(false) + } + } + + func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .bool(let value): + try container.encode(value) + case .schema(let schema): + try container.encode(schema) + } + } + } + } + + struct Response: Codable { + let description: String? + let schema: Schema? + } + + struct Definition: Codable { + let type: String? + let properties: [String: Box]? + let required: [String]? + let additionalProperties: Box? + let `enum`: [String]? + let description: String? + } +} + +// Box type to handle recursive Schema structure +class Box: Codable { + let value: T + + init(_ value: T) { + self.value = value + } + + required init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + value = try container.decode(T.self) + } + + func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(value) + } +} + +struct VersionInfo { + let fullName: String + let formattedKeyName: String + let versionSuffix: String +} + +// MARK: - Helper Functions + +func lowerFirstLetter(_ input: String) -> String { + guard !input.isEmpty else { return input } + return input.prefix(1).lowercased() + input.dropFirst() +} + +func upperFirstLetter(_ input: String) -> String { + guard !input.isEmpty else { return input } + return input.prefix(1).uppercased() + input.dropFirst() +} + +func stripVersionPrefix(_ name: String) -> String { + return name.replacingOccurrences(of: "^v\\d+", with: "", options: .regularExpression) +} + +func refToSwift(_ ref: String) -> String { + return ref.replacingOccurrences(of: "#/definitions/", with: "") +} + +func isValidIdentifier(_ name: String) -> Bool { + // Swift reserved keywords + let reservedKeywords = [ + "operator", "protocol", "Type", "Self", "self", + "associatedtype", "class", "deinit", "enum", "extension", + "func", "import", "init", "inout", "internal", "let", + "operator", "private", "protocol", "public", "static", + "struct", "subscript", "typealias", "var", "break", + "case", "continue", "default", "defer", "do", "else", + "fallthrough", "for", "guard", "if", "in", "repeat", + "return", "switch", "where", "while", "as", "Any", + "catch", "false", "is", "nil", "rethrows", "super", + "throw", "throws", "true", "try" + ] + + // Check if it's a reserved keyword + if reservedKeywords.contains(name) { + return false + } + + // Check if it starts with @ or contains special characters + if name.hasPrefix("@") || name.contains("@") || name.contains("-") || name.contains(".") { + return false + } + + // Check if it matches standard identifier pattern + let pattern = "^[a-zA-Z_][a-zA-Z0-9_]*$" + return name.range(of: pattern, options: .regularExpression) != nil +} + +func swaggerTypeToSwift(_ type: String?, schema: SwaggerSpec.Schema) -> String { + guard let type = type else { return "Any" } + + switch type { + case "integer", "number": + return "Int" + case "boolean": + return "Bool" + case "string": + return "String" + case "array": + if let items = schema.items?.value { + if let ref = items.ref { + return "[\(refToSwift(ref))]" + } else if let itemType = items.type { + return "[\(swaggerTypeToSwift(itemType, schema: items))]" + } + } + return "[Any]" + case "object": + // Check if it has additionalProperties + if let additionalProps = schema.additionalProperties?.value { + switch additionalProps { + case .schema(let propSchema): + if let ref = propSchema.ref { + return "[String: \(refToSwift(ref))]" + } else if let propType = propSchema.type { + return "[String: \(swaggerTypeToSwift(propType, schema: propSchema))]" + } + case .bool: + // additionalProperties: true means any type + return "[String: Any]" + } + } + // If it has properties, it's a defined structure (shouldn't reach here usually) + if schema.properties != nil { + return "[String: Any]" + } + return "[String: Any]" + default: + return "Any" + } +} + +// Extract latest versions from definitions (similar to JS version) +func extractLatestVersions(definitions: [String: SwaggerSpec.Definition]) -> [String: VersionInfo] { + var latestVersions: [String: VersionInfo] = [:] + + // Regex to separate the version prefix, base name, and optional version suffix + let pattern = #"^(v\d+)([A-Z][A-Za-z0-9]*?)(V\d+)?$"# + let regex = try! NSRegularExpression(pattern: pattern) + + for key in definitions.keys { + let nsString = key as NSString + let range = NSRange(location: 0, length: nsString.length) + + if let match = regex.firstMatch(in: key, range: range) { + let baseName = nsString.substring(with: match.range(at: 2)) + let versionSuffix = match.range(at: 3).location != NSNotFound + ? nsString.substring(with: match.range(at: 3)) + : "" + + let formattedKeyName = lowerFirstLetter(baseName) + versionSuffix + + // Determine if this version is newer + if latestVersions[baseName] == nil || + versionSuffix > (latestVersions[baseName]?.versionSuffix ?? "") { + latestVersions[baseName] = VersionInfo( + fullName: key, + formattedKeyName: formattedKeyName, + versionSuffix: versionSuffix + ) + } + } + } + + return latestVersions +} + +enum MethodType { + case query + case command + case activityDecision + case noop + case proxy + + static func from(methodName: String) -> MethodType { + let lower = methodName.lowercased() + + if lower == "approveactivity" || lower == "rejectactivity" { + return .activityDecision + } + if lower.hasPrefix("noop") { + return .noop + } + if lower.hasPrefix("proxy") { + return .proxy + } + if lower.hasPrefix("tget") || lower.hasPrefix("tlist") || lower.hasPrefix("ttest") { + return .query + } + return .command + } +} + +// MARK: - Type Generation + +func generateSwiftType(name: String, def: SwaggerSpec.Definition) -> String { + var output = "" + + // Generate enum for string enums + if def.type == "string", let enumValues = def.enum { + output += "public enum \(name): String, Codable, Sendable {\n" + for value in enumValues { + // Convert enum value to valid Swift case name + let caseName = value + .replacingOccurrences(of: "-", with: "_") + .replacingOccurrences(of: ".", with: "_") + .lowercased() + output += " case \(caseName) = \"\(value)\"\n" + } + output += "}\n" + return output + } + + // Generate struct for object types + if def.type == "object", let properties = def.properties { + output += "public struct \(name): Codable, Sendable {\n" + + let requiredProps = def.required ?? [] + var needsCodingKeys = false + var codingKeys: [(swiftName: String, jsonName: String)] = [] + + for (propName, schemaBox) in properties.sorted(by: { $0.key < $1.key }) { + let schema = schemaBox.value + let isRequired = requiredProps.contains(propName) + var swiftType = "Any" + + if let ref = schema.ref { + swiftType = refToSwift(ref) + } else if let type = schema.type { + swiftType = swaggerTypeToSwift(type, schema: schema) + } + + // Add optionality if not required + if !isRequired { + swiftType += "?" + } + + // Add description if available + if let desc = schema.description { + output += " /// \(desc)\n" + } + + // Handle property naming + let (swiftPropName, needsKey) = sanitizePropertyName(propName) + if needsKey { + needsCodingKeys = true + } + // Always add to codingKeys array for completeness + codingKeys.append((swiftName: swiftPropName, jsonName: propName)) + + output += " public let \(swiftPropName): \(swiftType)\n" + } + + // Add memberwise initializer for all structs + if !properties.isEmpty { + output += "\n public init(\n" + let sortedProps = codingKeys.sorted(by: { $0.swiftName < $1.swiftName }) + for (index, key) in sortedProps.enumerated() { + let schema = properties[key.jsonName]?.value + var swiftType = "Any" + + if let ref = schema?.ref { + swiftType = refToSwift(ref) + } else if let type = schema?.type { + swiftType = swaggerTypeToSwift(type, schema: schema!) + } + + // Check if this property is required + let isRequired = requiredProps.contains(key.jsonName) + if !isRequired { + swiftType += "?" + } + + let comma = index < sortedProps.count - 1 ? "," : "" + // Add default nil only for optional parameters + if !isRequired { + output += " \(key.swiftName): \(swiftType) = nil\(comma)\n" + } else { + output += " \(key.swiftName): \(swiftType)\(comma)\n" + } + } + output += " ) {\n" + for key in sortedProps { + output += " self.\(key.swiftName) = \(key.swiftName)\n" + } + output += " }\n" + } + + // Add CodingKeys if needed (must include ALL properties) + if needsCodingKeys { + output += "\n private enum CodingKeys: String, CodingKey {\n" + for key in codingKeys { + output += " case \(key.swiftName) = \"\(key.jsonName)\"\n" + } + output += " }\n" + } + + // Add additional properties support if specified + if def.additionalProperties != nil { + output += "\n // Note: Additional properties supported\n" + } + + output += "}\n" + return output + } + + // Default empty struct + output += "public struct \(name): Codable, Sendable {\n" + output += " public init() {}\n" + output += "}\n" + return output +} + +func sanitizePropertyName(_ name: String) -> (swiftName: String, needsCodingKey: Bool) { + // Swift reserved keywords that need renaming + let reservedKeywords: Set = [ + "associatedtype", "class", "deinit", "enum", "extension", + "func", "import", "init", "inout", "internal", "let", + "operator", "private", "protocol", "public", "static", + "struct", "subscript", "typealias", "var", "break", + "case", "continue", "default", "defer", "do", "else", + "fallthrough", "for", "guard", "if", "in", "repeat", + "return", "switch", "where", "while", "as", "Any", + "catch", "false", "is", "nil", "rethrows", "super", + "throw", "throws", "true", "try", "Type" + ] + + // If it's a reserved keyword, add underscore prefix + if reservedKeywords.contains(name) { + return ("_\(name)", true) + } + + // Check if name has special characters that need sanitization + if name.hasPrefix("@") || name.contains("@") || name.contains("-") || name.contains(".") { + let sanitized = name + .replacingOccurrences(of: "@", with: "at") + .replacingOccurrences(of: "-", with: "_") + .replacingOccurrences(of: ".", with: "_") + return (sanitized, true) + } + + // If already valid, no need for CodingKey + if isValidIdentifier(name) { + return (name, false) + } + + // Fallback: sanitize any remaining special chars + let sanitized = name.replacingOccurrences(of: "[^a-zA-Z0-9_]", with: "_", options: .regularExpression) + return (sanitized, true) +} + +func generateInlineProperties( + def: SwaggerSpec.Definition?, + definitions: [String: SwaggerSpec.Definition], + isAllOptional: Bool = false, + indent: String = " " +) -> String { + var output = "" + + guard let def = def, let properties = def.properties else { + return output + } + + let requiredProps = isAllOptional ? [] : (def.required ?? []) + + for (propName, schemaBox) in properties.sorted(by: { $0.key < $1.key }) { + let schema = schemaBox.value + let isRequired = requiredProps.contains(propName) + var swiftType = "Any" + + if let ref = schema.ref { + swiftType = refToSwift(ref) + } else if let type = schema.type { + swiftType = swaggerTypeToSwift(type, schema: schema) + } + + // Add optionality if not required + if !isRequired { + swiftType += "?" + } + + // Add description if available + if let desc = schema.description { + output += "\(indent)/// \(desc)\n" + } + + let swiftPropName = sanitizePropertyName(propName).swiftName + output += "\(indent)public let \(swiftPropName): \(swiftType)\n" + } + + return output +} + +func generateApiTypes( + swagger: SwaggerSpec, + prefix: String = "" +) -> String { + var output = "" + + let namespace = swagger.tags?.first(where: { $0.name.contains("Service") })?.name ?? "PublicApiService" + let latestVersions = extractLatestVersions(definitions: swagger.definitions) + let definitions = swagger.definitions + + for (_, pathItem) in swagger.paths.sorted(by: { $0.key < $1.key }) { + guard let operation = pathItem.post else { continue } + let operationId = operation.operationId + + let operationNameWithoutNamespace = operationId.replacingOccurrences( + of: "\(namespace)_", + with: "\(prefix)T" + ) + + let methodName = lowerFirstLetter(operationNameWithoutNamespace) + let methodType = MethodType.from(methodName: methodName) + + // Get response schema + let responseSchema = operation.responses?["200"]?.schema + let responseTypeName = responseSchema?.ref.map { refToSwift($0) } + + // Compose API type names + let apiTypeName = upperFirstLetter(operationNameWithoutNamespace) + "Response" + let apiBodyTypeName = upperFirstLetter(operationNameWithoutNamespace) + "Body" + let apiInputTypeName = upperFirstLetter(operationNameWithoutNamespace) + "Input" + + // --- RESPONSE TYPE GENERATION --- + output += "// MARK: - \(apiTypeName)\n\n" + + switch methodType { + case .command: + // Find the result type from the request + var resultTypeName: String? + var versionSuffix = "" + + if let parameters = operation.parameters { + for param in parameters { + guard param.in == "body", let schemaRef = param.schema?.ref else { continue } + + let reqTypeName = refToSwift(schemaRef) + + if let reqDef = definitions[reqTypeName], + let typeProperty = reqDef.properties?["type"]?.value, + let typeEnum = typeProperty.enum, + let activityType = typeEnum.first { + + // Check for versioned activity type + if let mapped = VERSIONED_ACTIVITY_TYPES[activityType] { + if let versionMatch = mapped.range(of: "V\\d+$", options: .regularExpression) { + versionSuffix = String(mapped[versionMatch]) + } + } + + // Find the result type + let baseActivity = reqTypeName + .replacingOccurrences(of: "^v\\d+", with: "", options: .regularExpression) + .replacingOccurrences(of: "Request(V\\d+)?$", with: "", options: .regularExpression) + + let resultBase = baseActivity + "Result" + + if let versionInfo = latestVersions[resultBase] { + if !versionSuffix.isEmpty { + // Try to find specific version + let candidate = definitions.keys.first { + $0.hasPrefix("v1" + baseActivity + "Result") && $0.hasSuffix(versionSuffix) + } + resultTypeName = candidate ?? versionInfo.fullName + } else { + resultTypeName = versionInfo.fullName + } + } + } + } + } + + output += "public struct \(apiTypeName): Codable, Sendable {\n" + output += " public let activity: v1Activity\n" + + if let resultTypeName = resultTypeName, + let resultDef = definitions[resultTypeName] { + output += generateInlineProperties( + def: resultDef, + definitions: definitions, + indent: " " + ) + } + + output += "}\n\n" + + case .query, .noop, .proxy: + if let responseTypeName = responseTypeName, + let respDef = definitions[responseTypeName] { + output += "public struct \(apiTypeName): Codable, Sendable {\n" + output += generateInlineProperties( + def: respDef, + definitions: definitions, + indent: " " + ) + output += "}\n\n" + } else { + output += "public struct \(apiTypeName): Codable, Sendable {\n" + output += " public init() {}\n" + output += "}\n\n" + } + + case .activityDecision: + if let responseTypeName = responseTypeName, + let activityDef = definitions[responseTypeName] { + output += "public struct \(apiTypeName): Codable, Sendable {\n" + output += generateInlineProperties( + def: activityDef, + definitions: definitions, + indent: " " + ) + output += "}\n\n" + } + } + + // --- REQUEST TYPE GENERATION --- + output += "// MARK: - \(apiBodyTypeName)\n\n" + + var requestTypeDef: SwaggerSpec.Definition? + var requestTypeName: String? + + if let parameters = operation.parameters { + for param in parameters { + guard param.in == "body", let schemaRef = param.schema?.ref else { continue } + + requestTypeName = refToSwift(schemaRef) + requestTypeDef = definitions[requestTypeName!] + } + } + + guard let requestDef = requestTypeDef else { + output += "public struct \(apiBodyTypeName): Codable, Sendable {\n" + output += " public init() {}\n" + output += "}\n\n" + continue + } + + output += "public struct \(apiBodyTypeName): Codable, Sendable {\n" + + switch methodType { + case .command, .activityDecision: + output += " public let timestampMs: String?\n" + output += " public let organizationId: String?\n" + + if let paramsRef = requestDef.properties?["parameters"]?.value.ref { + let isAllOptional = METHODS_WITH_ONLY_OPTIONAL_PARAMETERS.contains(methodName) + let intentTypeName = refToSwift(paramsRef) + if let intentDef = definitions[intentTypeName] { + output += generateInlineProperties( + def: intentDef, + definitions: definitions, + isAllOptional: isAllOptional, + indent: " " + ) + } + } + + case .query, .noop: + output += " public let organizationId: String?\n" + + if let properties = requestDef.properties { + let isAllOptional = METHODS_WITH_ONLY_OPTIONAL_PARAMETERS.contains(methodName) + let requiredProps = isAllOptional ? [] : (requestDef.required ?? []) + + for (propName, schemaBox) in properties.sorted(by: { $0.key < $1.key }) where propName != "organizationId" { + let schema = schemaBox.value + let isRequired = requiredProps.contains(propName) + var swiftType = "Any" + + if let ref = schema.ref { + swiftType = refToSwift(ref) + } else if let type = schema.type { + swiftType = swaggerTypeToSwift(type, schema: schema) + } + + if !isRequired { + swiftType += "?" + } + + if let desc = schema.description { + output += " /// \(desc)\n" + } + + let swiftPropName = sanitizePropertyName(propName).swiftName + output += " public let \(swiftPropName): \(swiftType)\n" + } + } + + case .proxy: + if let properties = requestDef.properties { + let isAllOptional = METHODS_WITH_ONLY_OPTIONAL_PARAMETERS.contains(methodName) + let requiredProps = isAllOptional ? [] : (requestDef.required ?? []) + + for (propName, schemaBox) in properties.sorted(by: { $0.key < $1.key }) { + let schema = schemaBox.value + let isRequired = requiredProps.contains(propName) + var swiftType = "Any" + + if let ref = schema.ref { + swiftType = refToSwift(ref) + } else if let type = schema.type { + swiftType = swaggerTypeToSwift(type, schema: schema) + } + + if !isRequired { + swiftType += "?" + } + + if let desc = schema.description { + output += " /// \(desc)\n" + } + + let swiftPropName = sanitizePropertyName(propName).swiftName + output += " public let \(swiftPropName): \(swiftType)\n" + } + } + } + + // Always generate memberwise initializer for API Body types + // Collect all properties that were just added + var propertyNames: [String] = [] + var propertyTypes: [String: (type: String, isOptional: Bool)] = [:] + + switch methodType { + case .command, .activityDecision: + propertyNames.append("timestampMs") + propertyTypes["timestampMs"] = ("String", true) + propertyNames.append("organizationId") + propertyTypes["organizationId"] = ("String", true) + + if let paramsRef = requestDef.properties?["parameters"]?.value.ref { + let isAllOptional = METHODS_WITH_ONLY_OPTIONAL_PARAMETERS.contains(methodName) + let intentTypeName = refToSwift(paramsRef) + if let intentDef = definitions[intentTypeName], + let properties = intentDef.properties { + let requiredProps = isAllOptional ? [] : (intentDef.required ?? []) + for (propName, schemaBox) in properties.sorted(by: { $0.key < $1.key }) { + let schema = schemaBox.value + let isRequired = requiredProps.contains(propName) + var swiftType = "Any" + if let ref = schema.ref { + swiftType = refToSwift(ref) + } else if let type = schema.type { + swiftType = swaggerTypeToSwift(type, schema: schema) + } + let swiftPropName = sanitizePropertyName(propName).swiftName + if !propertyNames.contains(swiftPropName) { + propertyNames.append(swiftPropName) + propertyTypes[swiftPropName] = (swiftType, !isRequired) + } + } + } + } + + case .query, .noop: + propertyNames.append("organizationId") + propertyTypes["organizationId"] = ("String", true) + + if let properties = requestDef.properties { + let isAllOptional = METHODS_WITH_ONLY_OPTIONAL_PARAMETERS.contains(methodName) + let requiredProps = isAllOptional ? [] : (requestDef.required ?? []) + for (propName, schemaBox) in properties.sorted(by: { $0.key < $1.key }) where propName != "organizationId" { + let schema = schemaBox.value + let isRequired = requiredProps.contains(propName) + var swiftType = "Any" + if let ref = schema.ref { + swiftType = refToSwift(ref) + } else if let type = schema.type { + swiftType = swaggerTypeToSwift(type, schema: schema) + } + let swiftPropName = sanitizePropertyName(propName).swiftName + if !propertyNames.contains(swiftPropName) { + propertyNames.append(swiftPropName) + propertyTypes[swiftPropName] = (swiftType, !isRequired) + } + } + } + + case .proxy: + if let properties = requestDef.properties { + let isAllOptional = METHODS_WITH_ONLY_OPTIONAL_PARAMETERS.contains(methodName) + let requiredProps = isAllOptional ? [] : (requestDef.required ?? []) + for (propName, schemaBox) in properties.sorted(by: { $0.key < $1.key }) { + let schema = schemaBox.value + let isRequired = requiredProps.contains(propName) + var swiftType = "Any" + if let ref = schema.ref { + swiftType = refToSwift(ref) + } else if let type = schema.type { + swiftType = swaggerTypeToSwift(type, schema: schema) + } + let swiftPropName = sanitizePropertyName(propName).swiftName + if !propertyNames.contains(swiftPropName) { + propertyNames.append(swiftPropName) + propertyTypes[swiftPropName] = (swiftType, !isRequired) + } + } + } + } + + // Generate memberwise init + if !propertyNames.isEmpty { + output += "\n public init(\n" + for (index, propName) in propertyNames.enumerated() { + let (propType, isOptional) = propertyTypes[propName] ?? ("Any", true) + let comma = index < propertyNames.count - 1 ? "," : "" + if isOptional { + output += " \(propName): \(propType)? = nil\(comma)\n" + } else { + output += " \(propName): \(propType)\(comma)\n" + } + } + output += " ) {\n" + for propName in propertyNames { + output += " self.\(propName) = \(propName)\n" + } + output += " }\n" + } else { + // Empty struct - add default init + output += "\n public init() {}\n" + } + + output += "}\n\n" + + // --- INPUT TYPE GENERATION --- + output += "// MARK: - \(apiInputTypeName)\n\n" + output += "public struct \(apiInputTypeName): Codable, Sendable {\n" + output += " public let body: \(apiBodyTypeName)\n" + output += "\n public init(\n" + output += " body: \(apiBodyTypeName)\n" + output += " ) {\n" + output += " self.body = body\n" + output += " }\n" + output += "}\n\n" + } + + return output +} + +// MARK: - Main + +func main() throws { + print("🚀 Starting Type Generation for Swift...") + + // Parse Swagger specs + print("📖 Reading Swagger specifications...") + + let publicData = try Data(contentsOf: PUBLIC_API_SWAGGER_PATH) + let authProxyData = try Data(contentsOf: AUTH_PROXY_SWAGGER_PATH) + + let decoder = JSONDecoder() + let publicSpec = try decoder.decode(SwaggerSpec.self, from: publicData) + let authProxySpec = try decoder.decode(SwaggerSpec.self, from: authProxyData) + + print("✅ Parsed Swagger specifications") + print(" - Public API: \(publicSpec.paths.count) endpoints, \(publicSpec.definitions.count) definitions") + print(" - Auth Proxy: \(authProxySpec.paths.count) endpoints, \(authProxySpec.definitions.count) definitions") + + // Generate types + print("\n🔨 Generating Swift types...") + + var output = COMMENT_HEADER + "\n\n" + output += "import Foundation\n\n" + + // --- Base Types --- + output += "// MARK: - Base Types from Swagger Definitions\n\n" + + for (defName, def) in publicSpec.definitions.sorted(by: { $0.key < $1.key }) { + output += generateSwiftType(name: defName, def: def) + "\n" + } + + // --- API Types --- + output += "\n// MARK: - API Types from Swagger Paths\n\n" + + output += generateApiTypes(swagger: publicSpec) + output += generateApiTypes(swagger: authProxySpec, prefix: "Proxy") + + // Write to file + try output.write(to: OUTPUT_PATH, atomically: true, encoding: .utf8) + + print("✅ Generated types at: \(OUTPUT_PATH.path)") + print("\n✨ Type generation complete!") +} + +// Run +do { + try main() +} catch { + print("❌ Error: \(error)") + exit(1) +} \ No newline at end of file diff --git a/Sources/TurnkeyCrypto/Public/TurnkeyCrypto.swift b/Sources/TurnkeyCrypto/Public/TurnkeyCrypto.swift index c0c29c40..c522786c 100644 --- a/Sources/TurnkeyCrypto/Public/TurnkeyCrypto.swift +++ b/Sources/TurnkeyCrypto/Public/TurnkeyCrypto.swift @@ -28,6 +28,31 @@ public struct TurnkeyCrypto { ) } + /// Derives the compressed public key (hex) from a Secure Enclave `SecKey` private key. + /// + /// - Parameter privateKey: A `SecKey` referencing a P-256 private key (e.g., in Secure Enclave). + /// - Returns: The compressed public key as a hex string. + /// - Throws: `CryptoError.invalidPublicKey` if the public key cannot be derived or encoded. + public static func getPublicKey(fromPrivateKey privateKey: SecKey) throws -> String { + guard let publicKey = SecKeyCopyPublicKey(privateKey) else { + throw CryptoError.invalidPublicKey + } + + var externalError: Unmanaged? + guard let pubData = SecKeyCopyExternalRepresentation(publicKey, &externalError) as Data? else { + throw CryptoError.invalidPublicKey + } + + let cryptoPublicKey: P256.Signing.PublicKey + do { + cryptoPublicKey = try P256.Signing.PublicKey(x963Representation: pubData) + } catch { + throw CryptoError.invalidPublicKey + } + + return cryptoPublicKey.compressedRepresentation.toHexString() + } + /// Decrypts a credential bundle using the provided ephemeral private key. /// /// - Parameters: diff --git a/Sources/TurnkeyHttp/Generated/Client.swift b/Sources/TurnkeyHttp/Generated/Client.swift deleted file mode 100644 index 3ed345f9..00000000 --- a/Sources/TurnkeyHttp/Generated/Client.swift +++ /dev/null @@ -1,6093 +0,0 @@ -import HTTPTypes -// Generated by swift-openapi-generator, do not modify. -@_spi(Generated) import OpenAPIRuntime - -#if os(Linux) - @preconcurrency import struct Foundation.URL - @preconcurrency import struct Foundation.Data - @preconcurrency import struct Foundation.Date -#else - import struct Foundation.URL - import struct Foundation.Data - import struct Foundation.Date -#endif -/// Review our [API Introduction](../api-introduction) to get started. -public struct Client: APIProtocol { - /// The underlying HTTP client. - private let client: UniversalClient - /// Creates a new client. - /// - Parameters: - /// - serverURL: The server URL that the client connects to. Any server - /// URLs defined in the OpenAPI document are available as static methods - /// on the ``Servers`` type. - /// - configuration: A set of configuration values for the client. - /// - transport: A transport that performs HTTP operations. - /// - middlewares: A list of middlewares to call before the transport. - public init( - serverURL: Foundation.URL, - configuration: Configuration = .init(), - transport: any ClientTransport, - middlewares: [any ClientMiddleware] = [] - ) { - self.client = .init( - serverURL: serverURL, - configuration: configuration, - transport: transport, - middlewares: middlewares - ) - } - private var converter: Converter { - client.converter - } - /// Get Activity - /// - /// Get details about an Activity - /// - /// - Remark: HTTP `POST /public/v1/query/get_activity`. - /// - Remark: Generated from `#/paths//public/v1/query/get_activity/post(GetActivity)`. - public func GetActivity(_ input: Operations.GetActivity.Input) async throws - -> Operations.GetActivity.Output - { - try await client.send( - input: input, - forOperation: Operations.GetActivity.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_activity", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetActivity.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get API key - /// - /// Get details about an API key - /// - /// - Remark: HTTP `POST /public/v1/query/get_api_key`. - /// - Remark: Generated from `#/paths//public/v1/query/get_api_key/post(GetApiKey)`. - public func GetApiKey(_ input: Operations.GetApiKey.Input) async throws - -> Operations.GetApiKey.Output - { - try await client.send( - input: input, - forOperation: Operations.GetApiKey.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_api_key", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetApiKey.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetApiKeyResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get API keys - /// - /// Get details about API keys for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/query/get_api_keys/post(GetApiKeys)`. - public func GetApiKeys(_ input: Operations.GetApiKeys.Input) async throws - -> Operations.GetApiKeys.Output - { - try await client.send( - input: input, - forOperation: Operations.GetApiKeys.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_api_keys", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetApiKeys.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetApiKeysResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get Authenticator - /// - /// Get details about an authenticator - /// - /// - Remark: HTTP `POST /public/v1/query/get_authenticator`. - /// - Remark: Generated from `#/paths//public/v1/query/get_authenticator/post(GetAuthenticator)`. - public func GetAuthenticator(_ input: Operations.GetAuthenticator.Input) async throws - -> Operations.GetAuthenticator.Output - { - try await client.send( - input: input, - forOperation: Operations.GetAuthenticator.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_authenticator", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetAuthenticator.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetAuthenticatorResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get Authenticators - /// - /// Get details about authenticators for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/query/get_authenticators/post(GetAuthenticators)`. - public func GetAuthenticators(_ input: Operations.GetAuthenticators.Input) async throws - -> Operations.GetAuthenticators.Output - { - try await client.send( - input: input, - forOperation: Operations.GetAuthenticators.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_authenticators", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetAuthenticators.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetAuthenticatorsResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get Oauth providers - /// - /// Get details about Oauth providers for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/query/get_oauth_providers/post(GetOauthProviders)`. - public func GetOauthProviders(_ input: Operations.GetOauthProviders.Input) async throws - -> Operations.GetOauthProviders.Output - { - try await client.send( - input: input, - forOperation: Operations.GetOauthProviders.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_oauth_providers", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetOauthProviders.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetOauthProvidersResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get Configs - /// - /// Get quorum settings and features for an organization - /// - /// - Remark: HTTP `POST /public/v1/query/get_organization_configs`. - /// - Remark: Generated from `#/paths//public/v1/query/get_organization_configs/post(GetOrganizationConfigs)`. - public func GetOrganizationConfigs(_ input: Operations.GetOrganizationConfigs.Input) async throws - -> Operations.GetOrganizationConfigs.Output - { - try await client.send( - input: input, - forOperation: Operations.GetOrganizationConfigs.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_organization_configs", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetOrganizationConfigs.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetOrganizationConfigsResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get Policy - /// - /// Get details about a Policy - /// - /// - Remark: HTTP `POST /public/v1/query/get_policy`. - /// - Remark: Generated from `#/paths//public/v1/query/get_policy/post(GetPolicy)`. - public func GetPolicy(_ input: Operations.GetPolicy.Input) async throws - -> Operations.GetPolicy.Output - { - try await client.send( - input: input, - forOperation: Operations.GetPolicy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_policy", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetPolicy.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetPolicyResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get Private Key - /// - /// Get details about a Private Key - /// - /// - Remark: HTTP `POST /public/v1/query/get_private_key`. - /// - Remark: Generated from `#/paths//public/v1/query/get_private_key/post(GetPrivateKey)`. - public func GetPrivateKey(_ input: Operations.GetPrivateKey.Input) async throws - -> Operations.GetPrivateKey.Output - { - try await client.send( - input: input, - forOperation: Operations.GetPrivateKey.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_private_key", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetPrivateKey.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetPrivateKeyResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get User - /// - /// Get details about a User - /// - /// - Remark: HTTP `POST /public/v1/query/get_user`. - /// - Remark: Generated from `#/paths//public/v1/query/get_user/post(GetUser)`. - public func GetUser(_ input: Operations.GetUser.Input) async throws -> Operations.GetUser.Output { - try await client.send( - input: input, - forOperation: Operations.GetUser.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_user", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetUser.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetUserResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get Wallet - /// - /// Get details about a Wallet - /// - /// - Remark: HTTP `POST /public/v1/query/get_wallet`. - /// - Remark: Generated from `#/paths//public/v1/query/get_wallet/post(GetWallet)`. - public func GetWallet(_ input: Operations.GetWallet.Input) async throws - -> Operations.GetWallet.Output - { - try await client.send( - input: input, - forOperation: Operations.GetWallet.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_wallet", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetWallet.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetWalletResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get Wallet Account - /// - /// Get a single wallet account - /// - /// - Remark: HTTP `POST /public/v1/query/get_wallet_account`. - /// - Remark: Generated from `#/paths//public/v1/query/get_wallet_account/post(GetWalletAccount)`. - public func GetWalletAccount(_ input: Operations.GetWalletAccount.Input) async throws - -> Operations.GetWalletAccount.Output - { - try await client.send( - input: input, - forOperation: Operations.GetWalletAccount.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/get_wallet_account", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetWalletAccount.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetWalletAccountResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List Activities - /// - /// List all Activities within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_activities`. - /// - Remark: Generated from `#/paths//public/v1/query/list_activities/post(GetActivities)`. - public func GetActivities(_ input: Operations.GetActivities.Input) async throws - -> Operations.GetActivities.Output - { - try await client.send( - input: input, - forOperation: Operations.GetActivities.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/list_activities", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetActivities.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetActivitiesResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List Policies - /// - /// List all Policies within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_policies`. - /// - Remark: Generated from `#/paths//public/v1/query/list_policies/post(GetPolicies)`. - public func GetPolicies(_ input: Operations.GetPolicies.Input) async throws - -> Operations.GetPolicies.Output - { - try await client.send( - input: input, - forOperation: Operations.GetPolicies.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/list_policies", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetPolicies.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetPoliciesResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List Private Key Tags - /// - /// List all Private Key Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_private_key_tags`. - /// - Remark: Generated from `#/paths//public/v1/query/list_private_key_tags/post(ListPrivateKeyTags)`. - public func ListPrivateKeyTags(_ input: Operations.ListPrivateKeyTags.Input) async throws - -> Operations.ListPrivateKeyTags.Output - { - try await client.send( - input: input, - forOperation: Operations.ListPrivateKeyTags.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/list_private_key_tags", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListPrivateKeyTags.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ListPrivateKeyTagsResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List Private Keys - /// - /// List all Private Keys within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/query/list_private_keys/post(GetPrivateKeys)`. - public func GetPrivateKeys(_ input: Operations.GetPrivateKeys.Input) async throws - -> Operations.GetPrivateKeys.Output - { - try await client.send( - input: input, - forOperation: Operations.GetPrivateKeys.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/list_private_keys", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetPrivateKeys.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetPrivateKeysResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get Suborgs - /// - /// Get all suborg IDs associated given a parent org ID and an optional filter. - /// - /// - Remark: HTTP `POST /public/v1/query/list_suborgs`. - /// - Remark: Generated from `#/paths//public/v1/query/list_suborgs/post(GetSubOrgIds)`. - public func GetSubOrgIds(_ input: Operations.GetSubOrgIds.Input) async throws - -> Operations.GetSubOrgIds.Output - { - try await client.send( - input: input, - forOperation: Operations.GetSubOrgIds.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/list_suborgs", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetSubOrgIds.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetSubOrgIdsResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List User Tags - /// - /// List all User Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_user_tags`. - /// - Remark: Generated from `#/paths//public/v1/query/list_user_tags/post(ListUserTags)`. - public func ListUserTags(_ input: Operations.ListUserTags.Input) async throws - -> Operations.ListUserTags.Output - { - try await client.send( - input: input, - forOperation: Operations.ListUserTags.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/list_user_tags", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListUserTags.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ListUserTagsResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List Users - /// - /// List all Users within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_users`. - /// - Remark: Generated from `#/paths//public/v1/query/list_users/post(GetUsers)`. - public func GetUsers(_ input: Operations.GetUsers.Input) async throws - -> Operations.GetUsers.Output - { - try await client.send( - input: input, - forOperation: Operations.GetUsers.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/list_users", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetUsers.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetUsersResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get Verified Suborgs - /// - /// Get all email or phone verified suborg IDs associated given a parent org ID. - /// - /// - Remark: HTTP `POST /public/v1/query/list_verified_suborgs`. - /// - Remark: Generated from `#/paths//public/v1/query/list_verified_suborgs/post(GetVerifiedSubOrgIds)`. - public func GetVerifiedSubOrgIds(_ input: Operations.GetVerifiedSubOrgIds.Input) async throws - -> Operations.GetVerifiedSubOrgIds.Output - { - try await client.send( - input: input, - forOperation: Operations.GetVerifiedSubOrgIds.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/list_verified_suborgs", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetVerifiedSubOrgIds.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetVerifiedSubOrgIdsResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List Wallets Accounts - /// - /// List all Accounts within a Wallet - /// - /// - Remark: HTTP `POST /public/v1/query/list_wallet_accounts`. - /// - Remark: Generated from `#/paths//public/v1/query/list_wallet_accounts/post(GetWalletAccounts)`. - public func GetWalletAccounts(_ input: Operations.GetWalletAccounts.Input) async throws - -> Operations.GetWalletAccounts.Output - { - try await client.send( - input: input, - forOperation: Operations.GetWalletAccounts.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/list_wallet_accounts", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetWalletAccounts.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetWalletAccountsResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List Wallets - /// - /// List all Wallets within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_wallets`. - /// - Remark: Generated from `#/paths//public/v1/query/list_wallets/post(GetWallets)`. - public func GetWallets(_ input: Operations.GetWallets.Input) async throws - -> Operations.GetWallets.Output - { - try await client.send( - input: input, - forOperation: Operations.GetWallets.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/list_wallets", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetWallets.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetWalletsResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Who am I? - /// - /// Get basic information about your current API or WebAuthN user and their organization. Affords Sub-Organization look ups via Parent Organization for WebAuthN or API key users. - /// - /// - Remark: HTTP `POST /public/v1/query/whoami`. - /// - Remark: Generated from `#/paths//public/v1/query/whoami/post(GetWhoami)`. - public func GetWhoami(_ input: Operations.GetWhoami.Input) async throws - -> Operations.GetWhoami.Output - { - try await client.send( - input: input, - forOperation: Operations.GetWhoami.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/query/whoami", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetWhoami.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GetWhoamiResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Approve Activity - /// - /// Approve an Activity - /// - /// - Remark: HTTP `POST /public/v1/submit/approve_activity`. - /// - Remark: Generated from `#/paths//public/v1/submit/approve_activity/post(ApproveActivity)`. - public func ApproveActivity(_ input: Operations.ApproveActivity.Input) async throws - -> Operations.ApproveActivity.Output - { - try await client.send( - input: input, - forOperation: Operations.ApproveActivity.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/approve_activity", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApproveActivity.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create API Keys - /// - /// Add api keys to an existing User - /// - /// - Remark: HTTP `POST /public/v1/submit/create_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_api_keys/post(CreateApiKeys)`. - public func CreateApiKeys(_ input: Operations.CreateApiKeys.Input) async throws - -> Operations.CreateApiKeys.Output - { - try await client.send( - input: input, - forOperation: Operations.CreateApiKeys.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_api_keys", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateApiKeys.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Authenticators - /// - /// Create Authenticators to authenticate requests to Turnkey - /// - /// - Remark: HTTP `POST /public/v1/submit/create_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_authenticators/post(CreateAuthenticators)`. - public func CreateAuthenticators(_ input: Operations.CreateAuthenticators.Input) async throws - -> Operations.CreateAuthenticators.Output - { - try await client.send( - input: input, - forOperation: Operations.CreateAuthenticators.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_authenticators", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAuthenticators.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Invitations - /// - /// Create Invitations to join an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_invitations`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_invitations/post(CreateInvitations)`. - public func CreateInvitations(_ input: Operations.CreateInvitations.Input) async throws - -> Operations.CreateInvitations.Output - { - try await client.send( - input: input, - forOperation: Operations.CreateInvitations.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_invitations", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateInvitations.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Oauth Providers - /// - /// Creates Oauth providers for a specified user - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/create_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_oauth_providers/post(CreateOauthProviders)`. - public func CreateOauthProviders(_ input: Operations.CreateOauthProviders.Input) async throws - -> Operations.CreateOauthProviders.Output - { - try await client.send( - input: input, - forOperation: Operations.CreateOauthProviders.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_oauth_providers", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateOauthProviders.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Policies - /// - /// Create new Policies - /// - /// - Remark: HTTP `POST /public/v1/submit/create_policies`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_policies/post(CreatePolicies)`. - public func CreatePolicies(_ input: Operations.CreatePolicies.Input) async throws - -> Operations.CreatePolicies.Output - { - try await client.send( - input: input, - forOperation: Operations.CreatePolicies.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_policies", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreatePolicies.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Policy - /// - /// Create a new Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/create_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_policy/post(CreatePolicy)`. - public func CreatePolicy(_ input: Operations.CreatePolicy.Input) async throws - -> Operations.CreatePolicy.Output - { - try await client.send( - input: input, - forOperation: Operations.CreatePolicy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_policy", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreatePolicy.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Private Key Tag - /// - /// Create a private key tag and add it to private keys. - /// - /// - Remark: HTTP `POST /public/v1/submit/create_private_key_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_private_key_tag/post(CreatePrivateKeyTag)`. - public func CreatePrivateKeyTag(_ input: Operations.CreatePrivateKeyTag.Input) async throws - -> Operations.CreatePrivateKeyTag.Output - { - try await client.send( - input: input, - forOperation: Operations.CreatePrivateKeyTag.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_private_key_tag", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreatePrivateKeyTag.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Private Keys - /// - /// Create new Private Keys - /// - /// - Remark: HTTP `POST /public/v1/submit/create_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_private_keys/post(CreatePrivateKeys)`. - public func CreatePrivateKeys(_ input: Operations.CreatePrivateKeys.Input) async throws - -> Operations.CreatePrivateKeys.Output - { - try await client.send( - input: input, - forOperation: Operations.CreatePrivateKeys.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_private_keys", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreatePrivateKeys.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Read Only Session - /// - /// Create a read only session for a user (valid for 1 hour) - /// - /// - Remark: HTTP `POST /public/v1/submit/create_read_only_session`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_read_only_session/post(CreateReadOnlySession)`. - public func CreateReadOnlySession(_ input: Operations.CreateReadOnlySession.Input) async throws - -> Operations.CreateReadOnlySession.Output - { - try await client.send( - input: input, - forOperation: Operations.CreateReadOnlySession.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_read_only_session", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateReadOnlySession.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Read Write Session - /// - /// Create a read write session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/create_read_write_session`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_read_write_session/post(CreateReadWriteSession)`. - public func CreateReadWriteSession(_ input: Operations.CreateReadWriteSession.Input) async throws - -> Operations.CreateReadWriteSession.Output - { - try await client.send( - input: input, - forOperation: Operations.CreateReadWriteSession.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_read_write_session", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateReadWriteSession.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Sub-Organization - /// - /// Create a new Sub-Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_sub_organization`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_sub_organization/post(CreateSubOrganization)`. - public func CreateSubOrganization(_ input: Operations.CreateSubOrganization.Input) async throws - -> Operations.CreateSubOrganization.Output - { - try await client.send( - input: input, - forOperation: Operations.CreateSubOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_sub_organization", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateSubOrganization.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create User Tag - /// - /// Create a user tag and add it to users. - /// - /// - Remark: HTTP `POST /public/v1/submit/create_user_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_user_tag/post(CreateUserTag)`. - public func CreateUserTag(_ input: Operations.CreateUserTag.Input) async throws - -> Operations.CreateUserTag.Output - { - try await client.send( - input: input, - forOperation: Operations.CreateUserTag.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_user_tag", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateUserTag.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Users - /// - /// Create Users in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_users`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_users/post(CreateUsers)`. - public func CreateUsers(_ input: Operations.CreateUsers.Input) async throws - -> Operations.CreateUsers.Output - { - try await client.send( - input: input, - forOperation: Operations.CreateUsers.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_users", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateUsers.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Wallet - /// - /// Create a Wallet and derive addresses - /// - /// - Remark: HTTP `POST /public/v1/submit/create_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_wallet/post(CreateWallet)`. - public func CreateWallet(_ input: Operations.CreateWallet.Input) async throws - -> Operations.CreateWallet.Output - { - try await client.send( - input: input, - forOperation: Operations.CreateWallet.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_wallet", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateWallet.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create Wallet Accounts - /// - /// Derive additional addresses using an existing wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/create_wallet_accounts`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_wallet_accounts/post(CreateWalletAccounts)`. - public func CreateWalletAccounts(_ input: Operations.CreateWalletAccounts.Input) async throws - -> Operations.CreateWalletAccounts.Output - { - try await client.send( - input: input, - forOperation: Operations.CreateWalletAccounts.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/create_wallet_accounts", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateWalletAccounts.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete API Keys - /// - /// Remove api keys from a User - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_api_keys/post(DeleteApiKeys)`. - public func DeleteApiKeys(_ input: Operations.DeleteApiKeys.Input) async throws - -> Operations.DeleteApiKeys.Output - { - try await client.send( - input: input, - forOperation: Operations.DeleteApiKeys.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/delete_api_keys", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteApiKeys.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete Authenticators - /// - /// Remove authenticators from a User - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_authenticators/post(DeleteAuthenticators)`. - public func DeleteAuthenticators(_ input: Operations.DeleteAuthenticators.Input) async throws - -> Operations.DeleteAuthenticators.Output - { - try await client.send( - input: input, - forOperation: Operations.DeleteAuthenticators.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/delete_authenticators", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAuthenticators.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete Invitation - /// - /// Delete an existing Invitation - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_invitation`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_invitation/post(DeleteInvitation)`. - public func DeleteInvitation(_ input: Operations.DeleteInvitation.Input) async throws - -> Operations.DeleteInvitation.Output - { - try await client.send( - input: input, - forOperation: Operations.DeleteInvitation.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/delete_invitation", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteInvitation.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete Oauth Providers - /// - /// Removes Oauth providers for a specified user - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_oauth_providers/post(DeleteOauthProviders)`. - public func DeleteOauthProviders(_ input: Operations.DeleteOauthProviders.Input) async throws - -> Operations.DeleteOauthProviders.Output - { - try await client.send( - input: input, - forOperation: Operations.DeleteOauthProviders.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/delete_oauth_providers", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteOauthProviders.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete Policy - /// - /// Delete an existing Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_policy/post(DeletePolicy)`. - public func DeletePolicy(_ input: Operations.DeletePolicy.Input) async throws - -> Operations.DeletePolicy.Output - { - try await client.send( - input: input, - forOperation: Operations.DeletePolicy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/delete_policy", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeletePolicy.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete Private Key Tags - /// - /// Delete Private Key Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_private_key_tags`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_private_key_tags/post(DeletePrivateKeyTags)`. - public func DeletePrivateKeyTags(_ input: Operations.DeletePrivateKeyTags.Input) async throws - -> Operations.DeletePrivateKeyTags.Output - { - try await client.send( - input: input, - forOperation: Operations.DeletePrivateKeyTags.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/delete_private_key_tags", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeletePrivateKeyTags.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete Private Keys - /// - /// Deletes private keys for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_private_keys/post(DeletePrivateKeys)`. - public func DeletePrivateKeys(_ input: Operations.DeletePrivateKeys.Input) async throws - -> Operations.DeletePrivateKeys.Output - { - try await client.send( - input: input, - forOperation: Operations.DeletePrivateKeys.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/delete_private_keys", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeletePrivateKeys.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete Sub Organization - /// - /// Deletes a sub organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_sub_organization`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_sub_organization/post(DeleteSubOrganization)`. - public func DeleteSubOrganization(_ input: Operations.DeleteSubOrganization.Input) async throws - -> Operations.DeleteSubOrganization.Output - { - try await client.send( - input: input, - forOperation: Operations.DeleteSubOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/delete_sub_organization", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteSubOrganization.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete User Tags - /// - /// Delete User Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_user_tags`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_user_tags/post(DeleteUserTags)`. - public func DeleteUserTags(_ input: Operations.DeleteUserTags.Input) async throws - -> Operations.DeleteUserTags.Output - { - try await client.send( - input: input, - forOperation: Operations.DeleteUserTags.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/delete_user_tags", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteUserTags.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete Users - /// - /// Delete Users within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_users`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_users/post(DeleteUsers)`. - public func DeleteUsers(_ input: Operations.DeleteUsers.Input) async throws - -> Operations.DeleteUsers.Output - { - try await client.send( - input: input, - forOperation: Operations.DeleteUsers.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/delete_users", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteUsers.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete Wallets - /// - /// Deletes wallets for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_wallets`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_wallets/post(DeleteWallets)`. - public func DeleteWallets(_ input: Operations.DeleteWallets.Input) async throws - -> Operations.DeleteWallets.Output - { - try await client.send( - input: input, - forOperation: Operations.DeleteWallets.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/delete_wallets", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteWallets.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Perform Email Auth - /// - /// Authenticate a user via Email - /// - /// - Remark: HTTP `POST /public/v1/submit/email_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/email_auth/post(EmailAuth)`. - public func EmailAuth(_ input: Operations.EmailAuth.Input) async throws - -> Operations.EmailAuth.Output - { - try await client.send( - input: input, - forOperation: Operations.EmailAuth.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/email_auth", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.EmailAuth.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Export Private Key - /// - /// Exports a Private Key - /// - /// - Remark: HTTP `POST /public/v1/submit/export_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_private_key/post(ExportPrivateKey)`. - public func ExportPrivateKey(_ input: Operations.ExportPrivateKey.Input) async throws - -> Operations.ExportPrivateKey.Output - { - try await client.send( - input: input, - forOperation: Operations.ExportPrivateKey.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/export_private_key", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ExportPrivateKey.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Export Wallet - /// - /// Exports a Wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/export_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_wallet/post(ExportWallet)`. - public func ExportWallet(_ input: Operations.ExportWallet.Input) async throws - -> Operations.ExportWallet.Output - { - try await client.send( - input: input, - forOperation: Operations.ExportWallet.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/export_wallet", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ExportWallet.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Export Wallet Account - /// - /// Exports a Wallet Account - /// - /// - Remark: HTTP `POST /public/v1/submit/export_wallet_account`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_wallet_account/post(ExportWalletAccount)`. - public func ExportWalletAccount(_ input: Operations.ExportWalletAccount.Input) async throws - -> Operations.ExportWalletAccount.Output - { - try await client.send( - input: input, - forOperation: Operations.ExportWalletAccount.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/export_wallet_account", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ExportWalletAccount.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Import Private Key - /// - /// Imports a private key - /// - /// - Remark: HTTP `POST /public/v1/submit/import_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/import_private_key/post(ImportPrivateKey)`. - public func ImportPrivateKey(_ input: Operations.ImportPrivateKey.Input) async throws - -> Operations.ImportPrivateKey.Output - { - try await client.send( - input: input, - forOperation: Operations.ImportPrivateKey.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/import_private_key", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ImportPrivateKey.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Import Wallet - /// - /// Imports a wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/import_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/import_wallet/post(ImportWallet)`. - public func ImportWallet(_ input: Operations.ImportWallet.Input) async throws - -> Operations.ImportWallet.Output - { - try await client.send( - input: input, - forOperation: Operations.ImportWallet.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/import_wallet", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ImportWallet.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Init Import Private Key - /// - /// Initializes a new private key import - /// - /// - Remark: HTTP `POST /public/v1/submit/init_import_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_import_private_key/post(InitImportPrivateKey)`. - public func InitImportPrivateKey(_ input: Operations.InitImportPrivateKey.Input) async throws - -> Operations.InitImportPrivateKey.Output - { - try await client.send( - input: input, - forOperation: Operations.InitImportPrivateKey.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/init_import_private_key", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.InitImportPrivateKey.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Init Import Wallet - /// - /// Initializes a new wallet import - /// - /// - Remark: HTTP `POST /public/v1/submit/init_import_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_import_wallet/post(InitImportWallet)`. - public func InitImportWallet(_ input: Operations.InitImportWallet.Input) async throws - -> Operations.InitImportWallet.Output - { - try await client.send( - input: input, - forOperation: Operations.InitImportWallet.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/init_import_wallet", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.InitImportWallet.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Init Generic OTP - /// - /// Initiate a Generic OTP activity - /// - /// - Remark: HTTP `POST /public/v1/submit/init_otp`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_otp/post(InitOtp)`. - public func InitOtp(_ input: Operations.InitOtp.Input) async throws -> Operations.InitOtp.Output { - try await client.send( - input: input, - forOperation: Operations.InitOtp.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/init_otp", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.InitOtp.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Init OTP auth - /// - /// Initiate an OTP auth activity - /// - /// - Remark: HTTP `POST /public/v1/submit/init_otp_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_otp_auth/post(InitOtpAuth)`. - public func InitOtpAuth(_ input: Operations.InitOtpAuth.Input) async throws - -> Operations.InitOtpAuth.Output - { - try await client.send( - input: input, - forOperation: Operations.InitOtpAuth.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/init_otp_auth", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.InitOtpAuth.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Init Email Recovery - /// - /// Initializes a new email recovery - /// - /// - Remark: HTTP `POST /public/v1/submit/init_user_email_recovery`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_user_email_recovery/post(InitUserEmailRecovery)`. - public func InitUserEmailRecovery(_ input: Operations.InitUserEmailRecovery.Input) async throws - -> Operations.InitUserEmailRecovery.Output - { - try await client.send( - input: input, - forOperation: Operations.InitUserEmailRecovery.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/init_user_email_recovery", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.InitUserEmailRecovery.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Oauth - /// - /// Authenticate a user with an Oidc token (Oauth) - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/oauth`. - /// - Remark: Generated from `#/paths//public/v1/submit/oauth/post(Oauth)`. - public func Oauth(_ input: Operations.Oauth.Input) async throws -> Operations.Oauth.Output { - try await client.send( - input: input, - forOperation: Operations.Oauth.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/oauth", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.Oauth.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Login with Oauth - /// - /// Create an Oauth session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/oauth_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/oauth_login/post(OauthLogin)`. - public func OauthLogin(_ input: Operations.OauthLogin.Input) async throws - -> Operations.OauthLogin.Output - { - try await client.send( - input: input, - forOperation: Operations.OauthLogin.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/oauth_login", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OauthLogin.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// OTP auth - /// - /// Authenticate a user with an OTP code sent via email or SMS - /// - /// - Remark: HTTP `POST /public/v1/submit/otp_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/otp_auth/post(OtpAuth)`. - public func OtpAuth(_ input: Operations.OtpAuth.Input) async throws -> Operations.OtpAuth.Output { - try await client.send( - input: input, - forOperation: Operations.OtpAuth.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/otp_auth", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OtpAuth.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Login with OTP - /// - /// Create an OTP session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/otp_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/otp_login/post(OtpLogin)`. - public func OtpLogin(_ input: Operations.OtpLogin.Input) async throws - -> Operations.OtpLogin.Output - { - try await client.send( - input: input, - forOperation: Operations.OtpLogin.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/otp_login", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OtpLogin.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Recover a user - /// - /// Completes the process of recovering a user by adding an authenticator - /// - /// - Remark: HTTP `POST /public/v1/submit/recover_user`. - /// - Remark: Generated from `#/paths//public/v1/submit/recover_user/post(RecoverUser)`. - public func RecoverUser(_ input: Operations.RecoverUser.Input) async throws - -> Operations.RecoverUser.Output - { - try await client.send( - input: input, - forOperation: Operations.RecoverUser.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/recover_user", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RecoverUser.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Reject Activity - /// - /// Reject an Activity - /// - /// - Remark: HTTP `POST /public/v1/submit/reject_activity`. - /// - Remark: Generated from `#/paths//public/v1/submit/reject_activity/post(RejectActivity)`. - public func RejectActivity(_ input: Operations.RejectActivity.Input) async throws - -> Operations.RejectActivity.Output - { - try await client.send( - input: input, - forOperation: Operations.RejectActivity.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/reject_activity", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RejectActivity.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Remove Organization Feature - /// - /// Removes an organization feature. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/remove_organization_feature`. - /// - Remark: Generated from `#/paths//public/v1/submit/remove_organization_feature/post(RemoveOrganizationFeature)`. - public func RemoveOrganizationFeature(_ input: Operations.RemoveOrganizationFeature.Input) - async throws -> Operations.RemoveOrganizationFeature.Output - { - try await client.send( - input: input, - forOperation: Operations.RemoveOrganizationFeature.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/remove_organization_feature", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RemoveOrganizationFeature.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Set Organization Feature - /// - /// Sets an organization feature. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/set_organization_feature`. - /// - Remark: Generated from `#/paths//public/v1/submit/set_organization_feature/post(SetOrganizationFeature)`. - public func SetOrganizationFeature(_ input: Operations.SetOrganizationFeature.Input) async throws - -> Operations.SetOrganizationFeature.Output - { - try await client.send( - input: input, - forOperation: Operations.SetOrganizationFeature.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/set_organization_feature", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetOrganizationFeature.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Sign Raw Payload - /// - /// Sign a raw payload - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_raw_payload`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_raw_payload/post(SignRawPayload)`. - public func SignRawPayload(_ input: Operations.SignRawPayload.Input) async throws - -> Operations.SignRawPayload.Output - { - try await client.send( - input: input, - forOperation: Operations.SignRawPayload.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/sign_raw_payload", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignRawPayload.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Sign Raw Payloads - /// - /// Sign multiple raw payloads with the same signing parameters - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_raw_payloads`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_raw_payloads/post(SignRawPayloads)`. - public func SignRawPayloads(_ input: Operations.SignRawPayloads.Input) async throws - -> Operations.SignRawPayloads.Output - { - try await client.send( - input: input, - forOperation: Operations.SignRawPayloads.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/sign_raw_payloads", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignRawPayloads.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Sign Transaction - /// - /// Sign a transaction - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_transaction`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_transaction/post(SignTransaction)`. - public func SignTransaction(_ input: Operations.SignTransaction.Input) async throws - -> Operations.SignTransaction.Output - { - try await client.send( - input: input, - forOperation: Operations.SignTransaction.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/sign_transaction", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignTransaction.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Login with a Stamp - /// - /// Create a session for a user through stamping client side (api key, wallet client, or passkey client) - /// - /// - Remark: HTTP `POST /public/v1/submit/stamp_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/stamp_login/post(StampLogin)`. - public func StampLogin(_ input: Operations.StampLogin.Input) async throws - -> Operations.StampLogin.Output - { - try await client.send( - input: input, - forOperation: Operations.StampLogin.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/stamp_login", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StampLogin.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update Policy - /// - /// Update an existing Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/update_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_policy/post(UpdatePolicy)`. - public func UpdatePolicy(_ input: Operations.UpdatePolicy.Input) async throws - -> Operations.UpdatePolicy.Output - { - try await client.send( - input: input, - forOperation: Operations.UpdatePolicy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/update_policy", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdatePolicy.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update Private Key Tag - /// - /// Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_private_key_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_private_key_tag/post(UpdatePrivateKeyTag)`. - public func UpdatePrivateKeyTag(_ input: Operations.UpdatePrivateKeyTag.Input) async throws - -> Operations.UpdatePrivateKeyTag.Output - { - try await client.send( - input: input, - forOperation: Operations.UpdatePrivateKeyTag.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/update_private_key_tag", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdatePrivateKeyTag.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update Root Quorum - /// - /// Set the threshold and members of the root quorum. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_root_quorum`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_root_quorum/post(UpdateRootQuorum)`. - public func UpdateRootQuorum(_ input: Operations.UpdateRootQuorum.Input) async throws - -> Operations.UpdateRootQuorum.Output - { - try await client.send( - input: input, - forOperation: Operations.UpdateRootQuorum.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/update_root_quorum", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateRootQuorum.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update User - /// - /// Update a User in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user/post(UpdateUser)`. - public func UpdateUser(_ input: Operations.UpdateUser.Input) async throws - -> Operations.UpdateUser.Output - { - try await client.send( - input: input, - forOperation: Operations.UpdateUser.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/update_user", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateUser.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update User's Email - /// - /// Update a User's email in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_email`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_email/post(UpdateUserEmail)`. - public func UpdateUserEmail(_ input: Operations.UpdateUserEmail.Input) async throws - -> Operations.UpdateUserEmail.Output - { - try await client.send( - input: input, - forOperation: Operations.UpdateUserEmail.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/update_user_email", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateUserEmail.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update User's Name - /// - /// Update a User's name in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_name`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_name/post(UpdateUserName)`. - public func UpdateUserName(_ input: Operations.UpdateUserName.Input) async throws - -> Operations.UpdateUserName.Output - { - try await client.send( - input: input, - forOperation: Operations.UpdateUserName.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/update_user_name", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateUserName.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update User's Phone Number - /// - /// Update a User's phone number in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_phone_number`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_phone_number/post(UpdateUserPhoneNumber)`. - public func UpdateUserPhoneNumber(_ input: Operations.UpdateUserPhoneNumber.Input) async throws - -> Operations.UpdateUserPhoneNumber.Output - { - try await client.send( - input: input, - forOperation: Operations.UpdateUserPhoneNumber.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/update_user_phone_number", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateUserPhoneNumber.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update User Tag - /// - /// Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_tag/post(UpdateUserTag)`. - public func UpdateUserTag(_ input: Operations.UpdateUserTag.Input) async throws - -> Operations.UpdateUserTag.Output - { - try await client.send( - input: input, - forOperation: Operations.UpdateUserTag.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/update_user_tag", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateUserTag.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update Wallet - /// - /// Update a wallet for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_wallet/post(UpdateWallet)`. - public func UpdateWallet(_ input: Operations.UpdateWallet.Input) async throws - -> Operations.UpdateWallet.Output - { - try await client.send( - input: input, - forOperation: Operations.UpdateWallet.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/update_wallet", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateWallet.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Verify Generic OTP - /// - /// Verify a Generic OTP - /// - /// - Remark: HTTP `POST /public/v1/submit/verify_otp`. - /// - Remark: Generated from `#/paths//public/v1/submit/verify_otp/post(VerifyOtp)`. - public func VerifyOtp(_ input: Operations.VerifyOtp.Input) async throws - -> Operations.VerifyOtp.Output - { - try await client.send( - input: input, - forOperation: Operations.VerifyOtp.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/public/v1/submit/verify_otp", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.VerifyOtp.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActivityResponse.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } -} diff --git a/Sources/TurnkeyHttp/Generated/Types.swift b/Sources/TurnkeyHttp/Generated/Types.swift deleted file mode 100644 index 3c96040c..00000000 --- a/Sources/TurnkeyHttp/Generated/Types.swift +++ /dev/null @@ -1,24578 +0,0 @@ -// Generated by swift-openapi-generator, do not modify. -@_spi(Generated) import OpenAPIRuntime - -#if os(Linux) - @preconcurrency import struct Foundation.URL - @preconcurrency import struct Foundation.Data - @preconcurrency import struct Foundation.Date -#else - import struct Foundation.URL - import struct Foundation.Data - import struct Foundation.Date -#endif -/// A type that performs HTTP operations defined by the OpenAPI document. -public protocol APIProtocol: Sendable { - /// Get Activity - /// - /// Get details about an Activity - /// - /// - Remark: HTTP `POST /public/v1/query/get_activity`. - /// - Remark: Generated from `#/paths//public/v1/query/get_activity/post(GetActivity)`. - func GetActivity(_ input: Operations.GetActivity.Input) async throws - -> Operations.GetActivity.Output - /// Get API key - /// - /// Get details about an API key - /// - /// - Remark: HTTP `POST /public/v1/query/get_api_key`. - /// - Remark: Generated from `#/paths//public/v1/query/get_api_key/post(GetApiKey)`. - func GetApiKey(_ input: Operations.GetApiKey.Input) async throws -> Operations.GetApiKey.Output - /// Get API keys - /// - /// Get details about API keys for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/query/get_api_keys/post(GetApiKeys)`. - func GetApiKeys(_ input: Operations.GetApiKeys.Input) async throws -> Operations.GetApiKeys.Output - /// Get Authenticator - /// - /// Get details about an authenticator - /// - /// - Remark: HTTP `POST /public/v1/query/get_authenticator`. - /// - Remark: Generated from `#/paths//public/v1/query/get_authenticator/post(GetAuthenticator)`. - func GetAuthenticator(_ input: Operations.GetAuthenticator.Input) async throws - -> Operations.GetAuthenticator.Output - /// Get Authenticators - /// - /// Get details about authenticators for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/query/get_authenticators/post(GetAuthenticators)`. - func GetAuthenticators(_ input: Operations.GetAuthenticators.Input) async throws - -> Operations.GetAuthenticators.Output - /// Get Oauth providers - /// - /// Get details about Oauth providers for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/query/get_oauth_providers/post(GetOauthProviders)`. - func GetOauthProviders(_ input: Operations.GetOauthProviders.Input) async throws - -> Operations.GetOauthProviders.Output - /// Get Configs - /// - /// Get quorum settings and features for an organization - /// - /// - Remark: HTTP `POST /public/v1/query/get_organization_configs`. - /// - Remark: Generated from `#/paths//public/v1/query/get_organization_configs/post(GetOrganizationConfigs)`. - func GetOrganizationConfigs(_ input: Operations.GetOrganizationConfigs.Input) async throws - -> Operations.GetOrganizationConfigs.Output - /// Get Policy - /// - /// Get details about a Policy - /// - /// - Remark: HTTP `POST /public/v1/query/get_policy`. - /// - Remark: Generated from `#/paths//public/v1/query/get_policy/post(GetPolicy)`. - func GetPolicy(_ input: Operations.GetPolicy.Input) async throws -> Operations.GetPolicy.Output - /// Get Private Key - /// - /// Get details about a Private Key - /// - /// - Remark: HTTP `POST /public/v1/query/get_private_key`. - /// - Remark: Generated from `#/paths//public/v1/query/get_private_key/post(GetPrivateKey)`. - func GetPrivateKey(_ input: Operations.GetPrivateKey.Input) async throws - -> Operations.GetPrivateKey.Output - /// Get User - /// - /// Get details about a User - /// - /// - Remark: HTTP `POST /public/v1/query/get_user`. - /// - Remark: Generated from `#/paths//public/v1/query/get_user/post(GetUser)`. - func GetUser(_ input: Operations.GetUser.Input) async throws -> Operations.GetUser.Output - /// Get Wallet - /// - /// Get details about a Wallet - /// - /// - Remark: HTTP `POST /public/v1/query/get_wallet`. - /// - Remark: Generated from `#/paths//public/v1/query/get_wallet/post(GetWallet)`. - func GetWallet(_ input: Operations.GetWallet.Input) async throws -> Operations.GetWallet.Output - /// Get Wallet Account - /// - /// Get a single wallet account - /// - /// - Remark: HTTP `POST /public/v1/query/get_wallet_account`. - /// - Remark: Generated from `#/paths//public/v1/query/get_wallet_account/post(GetWalletAccount)`. - func GetWalletAccount(_ input: Operations.GetWalletAccount.Input) async throws - -> Operations.GetWalletAccount.Output - /// List Activities - /// - /// List all Activities within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_activities`. - /// - Remark: Generated from `#/paths//public/v1/query/list_activities/post(GetActivities)`. - func GetActivities(_ input: Operations.GetActivities.Input) async throws - -> Operations.GetActivities.Output - /// List Policies - /// - /// List all Policies within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_policies`. - /// - Remark: Generated from `#/paths//public/v1/query/list_policies/post(GetPolicies)`. - func GetPolicies(_ input: Operations.GetPolicies.Input) async throws - -> Operations.GetPolicies.Output - /// List Private Key Tags - /// - /// List all Private Key Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_private_key_tags`. - /// - Remark: Generated from `#/paths//public/v1/query/list_private_key_tags/post(ListPrivateKeyTags)`. - func ListPrivateKeyTags(_ input: Operations.ListPrivateKeyTags.Input) async throws - -> Operations.ListPrivateKeyTags.Output - /// List Private Keys - /// - /// List all Private Keys within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/query/list_private_keys/post(GetPrivateKeys)`. - func GetPrivateKeys(_ input: Operations.GetPrivateKeys.Input) async throws - -> Operations.GetPrivateKeys.Output - /// Get Suborgs - /// - /// Get all suborg IDs associated given a parent org ID and an optional filter. - /// - /// - Remark: HTTP `POST /public/v1/query/list_suborgs`. - /// - Remark: Generated from `#/paths//public/v1/query/list_suborgs/post(GetSubOrgIds)`. - func GetSubOrgIds(_ input: Operations.GetSubOrgIds.Input) async throws - -> Operations.GetSubOrgIds.Output - /// List User Tags - /// - /// List all User Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_user_tags`. - /// - Remark: Generated from `#/paths//public/v1/query/list_user_tags/post(ListUserTags)`. - func ListUserTags(_ input: Operations.ListUserTags.Input) async throws - -> Operations.ListUserTags.Output - /// List Users - /// - /// List all Users within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_users`. - /// - Remark: Generated from `#/paths//public/v1/query/list_users/post(GetUsers)`. - func GetUsers(_ input: Operations.GetUsers.Input) async throws -> Operations.GetUsers.Output - /// Get Verified Suborgs - /// - /// Get all email or phone verified suborg IDs associated given a parent org ID. - /// - /// - Remark: HTTP `POST /public/v1/query/list_verified_suborgs`. - /// - Remark: Generated from `#/paths//public/v1/query/list_verified_suborgs/post(GetVerifiedSubOrgIds)`. - func GetVerifiedSubOrgIds(_ input: Operations.GetVerifiedSubOrgIds.Input) async throws - -> Operations.GetVerifiedSubOrgIds.Output - /// List Wallets Accounts - /// - /// List all Accounts within a Wallet - /// - /// - Remark: HTTP `POST /public/v1/query/list_wallet_accounts`. - /// - Remark: Generated from `#/paths//public/v1/query/list_wallet_accounts/post(GetWalletAccounts)`. - func GetWalletAccounts(_ input: Operations.GetWalletAccounts.Input) async throws - -> Operations.GetWalletAccounts.Output - /// List Wallets - /// - /// List all Wallets within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_wallets`. - /// - Remark: Generated from `#/paths//public/v1/query/list_wallets/post(GetWallets)`. - func GetWallets(_ input: Operations.GetWallets.Input) async throws -> Operations.GetWallets.Output - /// Who am I? - /// - /// Get basic information about your current API or WebAuthN user and their organization. Affords Sub-Organization look ups via Parent Organization for WebAuthN or API key users. - /// - /// - Remark: HTTP `POST /public/v1/query/whoami`. - /// - Remark: Generated from `#/paths//public/v1/query/whoami/post(GetWhoami)`. - func GetWhoami(_ input: Operations.GetWhoami.Input) async throws -> Operations.GetWhoami.Output - /// Approve Activity - /// - /// Approve an Activity - /// - /// - Remark: HTTP `POST /public/v1/submit/approve_activity`. - /// - Remark: Generated from `#/paths//public/v1/submit/approve_activity/post(ApproveActivity)`. - func ApproveActivity(_ input: Operations.ApproveActivity.Input) async throws - -> Operations.ApproveActivity.Output - /// Create API Keys - /// - /// Add api keys to an existing User - /// - /// - Remark: HTTP `POST /public/v1/submit/create_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_api_keys/post(CreateApiKeys)`. - func CreateApiKeys(_ input: Operations.CreateApiKeys.Input) async throws - -> Operations.CreateApiKeys.Output - /// Create Authenticators - /// - /// Create Authenticators to authenticate requests to Turnkey - /// - /// - Remark: HTTP `POST /public/v1/submit/create_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_authenticators/post(CreateAuthenticators)`. - func CreateAuthenticators(_ input: Operations.CreateAuthenticators.Input) async throws - -> Operations.CreateAuthenticators.Output - /// Create Invitations - /// - /// Create Invitations to join an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_invitations`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_invitations/post(CreateInvitations)`. - func CreateInvitations(_ input: Operations.CreateInvitations.Input) async throws - -> Operations.CreateInvitations.Output - /// Create Oauth Providers - /// - /// Creates Oauth providers for a specified user - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/create_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_oauth_providers/post(CreateOauthProviders)`. - func CreateOauthProviders(_ input: Operations.CreateOauthProviders.Input) async throws - -> Operations.CreateOauthProviders.Output - /// Create Policies - /// - /// Create new Policies - /// - /// - Remark: HTTP `POST /public/v1/submit/create_policies`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_policies/post(CreatePolicies)`. - func CreatePolicies(_ input: Operations.CreatePolicies.Input) async throws - -> Operations.CreatePolicies.Output - /// Create Policy - /// - /// Create a new Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/create_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_policy/post(CreatePolicy)`. - func CreatePolicy(_ input: Operations.CreatePolicy.Input) async throws - -> Operations.CreatePolicy.Output - /// Create Private Key Tag - /// - /// Create a private key tag and add it to private keys. - /// - /// - Remark: HTTP `POST /public/v1/submit/create_private_key_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_private_key_tag/post(CreatePrivateKeyTag)`. - func CreatePrivateKeyTag(_ input: Operations.CreatePrivateKeyTag.Input) async throws - -> Operations.CreatePrivateKeyTag.Output - /// Create Private Keys - /// - /// Create new Private Keys - /// - /// - Remark: HTTP `POST /public/v1/submit/create_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_private_keys/post(CreatePrivateKeys)`. - func CreatePrivateKeys(_ input: Operations.CreatePrivateKeys.Input) async throws - -> Operations.CreatePrivateKeys.Output - /// Create Read Only Session - /// - /// Create a read only session for a user (valid for 1 hour) - /// - /// - Remark: HTTP `POST /public/v1/submit/create_read_only_session`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_read_only_session/post(CreateReadOnlySession)`. - func CreateReadOnlySession(_ input: Operations.CreateReadOnlySession.Input) async throws - -> Operations.CreateReadOnlySession.Output - /// Create Read Write Session - /// - /// Create a read write session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/create_read_write_session`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_read_write_session/post(CreateReadWriteSession)`. - func CreateReadWriteSession(_ input: Operations.CreateReadWriteSession.Input) async throws - -> Operations.CreateReadWriteSession.Output - /// Create Sub-Organization - /// - /// Create a new Sub-Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_sub_organization`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_sub_organization/post(CreateSubOrganization)`. - func CreateSubOrganization(_ input: Operations.CreateSubOrganization.Input) async throws - -> Operations.CreateSubOrganization.Output - /// Create User Tag - /// - /// Create a user tag and add it to users. - /// - /// - Remark: HTTP `POST /public/v1/submit/create_user_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_user_tag/post(CreateUserTag)`. - func CreateUserTag(_ input: Operations.CreateUserTag.Input) async throws - -> Operations.CreateUserTag.Output - /// Create Users - /// - /// Create Users in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_users`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_users/post(CreateUsers)`. - func CreateUsers(_ input: Operations.CreateUsers.Input) async throws - -> Operations.CreateUsers.Output - /// Create Wallet - /// - /// Create a Wallet and derive addresses - /// - /// - Remark: HTTP `POST /public/v1/submit/create_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_wallet/post(CreateWallet)`. - func CreateWallet(_ input: Operations.CreateWallet.Input) async throws - -> Operations.CreateWallet.Output - /// Create Wallet Accounts - /// - /// Derive additional addresses using an existing wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/create_wallet_accounts`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_wallet_accounts/post(CreateWalletAccounts)`. - func CreateWalletAccounts(_ input: Operations.CreateWalletAccounts.Input) async throws - -> Operations.CreateWalletAccounts.Output - /// Delete API Keys - /// - /// Remove api keys from a User - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_api_keys/post(DeleteApiKeys)`. - func DeleteApiKeys(_ input: Operations.DeleteApiKeys.Input) async throws - -> Operations.DeleteApiKeys.Output - /// Delete Authenticators - /// - /// Remove authenticators from a User - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_authenticators/post(DeleteAuthenticators)`. - func DeleteAuthenticators(_ input: Operations.DeleteAuthenticators.Input) async throws - -> Operations.DeleteAuthenticators.Output - /// Delete Invitation - /// - /// Delete an existing Invitation - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_invitation`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_invitation/post(DeleteInvitation)`. - func DeleteInvitation(_ input: Operations.DeleteInvitation.Input) async throws - -> Operations.DeleteInvitation.Output - /// Delete Oauth Providers - /// - /// Removes Oauth providers for a specified user - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_oauth_providers/post(DeleteOauthProviders)`. - func DeleteOauthProviders(_ input: Operations.DeleteOauthProviders.Input) async throws - -> Operations.DeleteOauthProviders.Output - /// Delete Policy - /// - /// Delete an existing Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_policy/post(DeletePolicy)`. - func DeletePolicy(_ input: Operations.DeletePolicy.Input) async throws - -> Operations.DeletePolicy.Output - /// Delete Private Key Tags - /// - /// Delete Private Key Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_private_key_tags`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_private_key_tags/post(DeletePrivateKeyTags)`. - func DeletePrivateKeyTags(_ input: Operations.DeletePrivateKeyTags.Input) async throws - -> Operations.DeletePrivateKeyTags.Output - /// Delete Private Keys - /// - /// Deletes private keys for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_private_keys/post(DeletePrivateKeys)`. - func DeletePrivateKeys(_ input: Operations.DeletePrivateKeys.Input) async throws - -> Operations.DeletePrivateKeys.Output - /// Delete Sub Organization - /// - /// Deletes a sub organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_sub_organization`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_sub_organization/post(DeleteSubOrganization)`. - func DeleteSubOrganization(_ input: Operations.DeleteSubOrganization.Input) async throws - -> Operations.DeleteSubOrganization.Output - /// Delete User Tags - /// - /// Delete User Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_user_tags`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_user_tags/post(DeleteUserTags)`. - func DeleteUserTags(_ input: Operations.DeleteUserTags.Input) async throws - -> Operations.DeleteUserTags.Output - /// Delete Users - /// - /// Delete Users within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_users`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_users/post(DeleteUsers)`. - func DeleteUsers(_ input: Operations.DeleteUsers.Input) async throws - -> Operations.DeleteUsers.Output - /// Delete Wallets - /// - /// Deletes wallets for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_wallets`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_wallets/post(DeleteWallets)`. - func DeleteWallets(_ input: Operations.DeleteWallets.Input) async throws - -> Operations.DeleteWallets.Output - /// Perform Email Auth - /// - /// Authenticate a user via Email - /// - /// - Remark: HTTP `POST /public/v1/submit/email_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/email_auth/post(EmailAuth)`. - func EmailAuth(_ input: Operations.EmailAuth.Input) async throws -> Operations.EmailAuth.Output - /// Export Private Key - /// - /// Exports a Private Key - /// - /// - Remark: HTTP `POST /public/v1/submit/export_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_private_key/post(ExportPrivateKey)`. - func ExportPrivateKey(_ input: Operations.ExportPrivateKey.Input) async throws - -> Operations.ExportPrivateKey.Output - /// Export Wallet - /// - /// Exports a Wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/export_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_wallet/post(ExportWallet)`. - func ExportWallet(_ input: Operations.ExportWallet.Input) async throws - -> Operations.ExportWallet.Output - /// Export Wallet Account - /// - /// Exports a Wallet Account - /// - /// - Remark: HTTP `POST /public/v1/submit/export_wallet_account`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_wallet_account/post(ExportWalletAccount)`. - func ExportWalletAccount(_ input: Operations.ExportWalletAccount.Input) async throws - -> Operations.ExportWalletAccount.Output - /// Import Private Key - /// - /// Imports a private key - /// - /// - Remark: HTTP `POST /public/v1/submit/import_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/import_private_key/post(ImportPrivateKey)`. - func ImportPrivateKey(_ input: Operations.ImportPrivateKey.Input) async throws - -> Operations.ImportPrivateKey.Output - /// Import Wallet - /// - /// Imports a wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/import_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/import_wallet/post(ImportWallet)`. - func ImportWallet(_ input: Operations.ImportWallet.Input) async throws - -> Operations.ImportWallet.Output - /// Init Import Private Key - /// - /// Initializes a new private key import - /// - /// - Remark: HTTP `POST /public/v1/submit/init_import_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_import_private_key/post(InitImportPrivateKey)`. - func InitImportPrivateKey(_ input: Operations.InitImportPrivateKey.Input) async throws - -> Operations.InitImportPrivateKey.Output - /// Init Import Wallet - /// - /// Initializes a new wallet import - /// - /// - Remark: HTTP `POST /public/v1/submit/init_import_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_import_wallet/post(InitImportWallet)`. - func InitImportWallet(_ input: Operations.InitImportWallet.Input) async throws - -> Operations.InitImportWallet.Output - /// Init Generic OTP - /// - /// Initiate a Generic OTP activity - /// - /// - Remark: HTTP `POST /public/v1/submit/init_otp`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_otp/post(InitOtp)`. - func InitOtp(_ input: Operations.InitOtp.Input) async throws -> Operations.InitOtp.Output - /// Init OTP auth - /// - /// Initiate an OTP auth activity - /// - /// - Remark: HTTP `POST /public/v1/submit/init_otp_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_otp_auth/post(InitOtpAuth)`. - func InitOtpAuth(_ input: Operations.InitOtpAuth.Input) async throws - -> Operations.InitOtpAuth.Output - /// Init Email Recovery - /// - /// Initializes a new email recovery - /// - /// - Remark: HTTP `POST /public/v1/submit/init_user_email_recovery`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_user_email_recovery/post(InitUserEmailRecovery)`. - func InitUserEmailRecovery(_ input: Operations.InitUserEmailRecovery.Input) async throws - -> Operations.InitUserEmailRecovery.Output - /// Oauth - /// - /// Authenticate a user with an Oidc token (Oauth) - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/oauth`. - /// - Remark: Generated from `#/paths//public/v1/submit/oauth/post(Oauth)`. - func Oauth(_ input: Operations.Oauth.Input) async throws -> Operations.Oauth.Output - /// Login with Oauth - /// - /// Create an Oauth session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/oauth_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/oauth_login/post(OauthLogin)`. - func OauthLogin(_ input: Operations.OauthLogin.Input) async throws -> Operations.OauthLogin.Output - /// OTP auth - /// - /// Authenticate a user with an OTP code sent via email or SMS - /// - /// - Remark: HTTP `POST /public/v1/submit/otp_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/otp_auth/post(OtpAuth)`. - func OtpAuth(_ input: Operations.OtpAuth.Input) async throws -> Operations.OtpAuth.Output - /// Login with OTP - /// - /// Create an OTP session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/otp_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/otp_login/post(OtpLogin)`. - func OtpLogin(_ input: Operations.OtpLogin.Input) async throws -> Operations.OtpLogin.Output - /// Recover a user - /// - /// Completes the process of recovering a user by adding an authenticator - /// - /// - Remark: HTTP `POST /public/v1/submit/recover_user`. - /// - Remark: Generated from `#/paths//public/v1/submit/recover_user/post(RecoverUser)`. - func RecoverUser(_ input: Operations.RecoverUser.Input) async throws - -> Operations.RecoverUser.Output - /// Reject Activity - /// - /// Reject an Activity - /// - /// - Remark: HTTP `POST /public/v1/submit/reject_activity`. - /// - Remark: Generated from `#/paths//public/v1/submit/reject_activity/post(RejectActivity)`. - func RejectActivity(_ input: Operations.RejectActivity.Input) async throws - -> Operations.RejectActivity.Output - /// Remove Organization Feature - /// - /// Removes an organization feature. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/remove_organization_feature`. - /// - Remark: Generated from `#/paths//public/v1/submit/remove_organization_feature/post(RemoveOrganizationFeature)`. - func RemoveOrganizationFeature(_ input: Operations.RemoveOrganizationFeature.Input) async throws - -> Operations.RemoveOrganizationFeature.Output - /// Set Organization Feature - /// - /// Sets an organization feature. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/set_organization_feature`. - /// - Remark: Generated from `#/paths//public/v1/submit/set_organization_feature/post(SetOrganizationFeature)`. - func SetOrganizationFeature(_ input: Operations.SetOrganizationFeature.Input) async throws - -> Operations.SetOrganizationFeature.Output - /// Sign Raw Payload - /// - /// Sign a raw payload - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_raw_payload`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_raw_payload/post(SignRawPayload)`. - func SignRawPayload(_ input: Operations.SignRawPayload.Input) async throws - -> Operations.SignRawPayload.Output - /// Sign Raw Payloads - /// - /// Sign multiple raw payloads with the same signing parameters - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_raw_payloads`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_raw_payloads/post(SignRawPayloads)`. - func SignRawPayloads(_ input: Operations.SignRawPayloads.Input) async throws - -> Operations.SignRawPayloads.Output - /// Sign Transaction - /// - /// Sign a transaction - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_transaction`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_transaction/post(SignTransaction)`. - func SignTransaction(_ input: Operations.SignTransaction.Input) async throws - -> Operations.SignTransaction.Output - /// Login with a Stamp - /// - /// Create a session for a user through stamping client side (api key, wallet client, or passkey client) - /// - /// - Remark: HTTP `POST /public/v1/submit/stamp_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/stamp_login/post(StampLogin)`. - func StampLogin(_ input: Operations.StampLogin.Input) async throws -> Operations.StampLogin.Output - /// Update Policy - /// - /// Update an existing Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/update_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_policy/post(UpdatePolicy)`. - func UpdatePolicy(_ input: Operations.UpdatePolicy.Input) async throws - -> Operations.UpdatePolicy.Output - /// Update Private Key Tag - /// - /// Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_private_key_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_private_key_tag/post(UpdatePrivateKeyTag)`. - func UpdatePrivateKeyTag(_ input: Operations.UpdatePrivateKeyTag.Input) async throws - -> Operations.UpdatePrivateKeyTag.Output - /// Update Root Quorum - /// - /// Set the threshold and members of the root quorum. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_root_quorum`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_root_quorum/post(UpdateRootQuorum)`. - func UpdateRootQuorum(_ input: Operations.UpdateRootQuorum.Input) async throws - -> Operations.UpdateRootQuorum.Output - /// Update User - /// - /// Update a User in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user/post(UpdateUser)`. - func UpdateUser(_ input: Operations.UpdateUser.Input) async throws -> Operations.UpdateUser.Output - /// Update User's Email - /// - /// Update a User's email in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_email`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_email/post(UpdateUserEmail)`. - func UpdateUserEmail(_ input: Operations.UpdateUserEmail.Input) async throws - -> Operations.UpdateUserEmail.Output - /// Update User's Name - /// - /// Update a User's name in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_name`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_name/post(UpdateUserName)`. - func UpdateUserName(_ input: Operations.UpdateUserName.Input) async throws - -> Operations.UpdateUserName.Output - /// Update User's Phone Number - /// - /// Update a User's phone number in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_phone_number`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_phone_number/post(UpdateUserPhoneNumber)`. - func UpdateUserPhoneNumber(_ input: Operations.UpdateUserPhoneNumber.Input) async throws - -> Operations.UpdateUserPhoneNumber.Output - /// Update User Tag - /// - /// Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_tag/post(UpdateUserTag)`. - func UpdateUserTag(_ input: Operations.UpdateUserTag.Input) async throws - -> Operations.UpdateUserTag.Output - /// Update Wallet - /// - /// Update a wallet for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_wallet/post(UpdateWallet)`. - func UpdateWallet(_ input: Operations.UpdateWallet.Input) async throws - -> Operations.UpdateWallet.Output - /// Verify Generic OTP - /// - /// Verify a Generic OTP - /// - /// - Remark: HTTP `POST /public/v1/submit/verify_otp`. - /// - Remark: Generated from `#/paths//public/v1/submit/verify_otp/post(VerifyOtp)`. - func VerifyOtp(_ input: Operations.VerifyOtp.Input) async throws -> Operations.VerifyOtp.Output -} - -/// Convenience overloads for operation inputs. -extension APIProtocol { - /// Get Activity - /// - /// Get details about an Activity - /// - /// - Remark: HTTP `POST /public/v1/query/get_activity`. - /// - Remark: Generated from `#/paths//public/v1/query/get_activity/post(GetActivity)`. - public func GetActivity( - headers: Operations.GetActivity.Input.Headers = .init(), - body: Operations.GetActivity.Input.Body - ) async throws -> Operations.GetActivity.Output { - try await GetActivity( - Operations.GetActivity.Input( - headers: headers, - body: body - )) - } - /// Get API key - /// - /// Get details about an API key - /// - /// - Remark: HTTP `POST /public/v1/query/get_api_key`. - /// - Remark: Generated from `#/paths//public/v1/query/get_api_key/post(GetApiKey)`. - public func GetApiKey( - headers: Operations.GetApiKey.Input.Headers = .init(), - body: Operations.GetApiKey.Input.Body - ) async throws -> Operations.GetApiKey.Output { - try await GetApiKey( - Operations.GetApiKey.Input( - headers: headers, - body: body - )) - } - /// Get API keys - /// - /// Get details about API keys for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/query/get_api_keys/post(GetApiKeys)`. - public func GetApiKeys( - headers: Operations.GetApiKeys.Input.Headers = .init(), - body: Operations.GetApiKeys.Input.Body - ) async throws -> Operations.GetApiKeys.Output { - try await GetApiKeys( - Operations.GetApiKeys.Input( - headers: headers, - body: body - )) - } - /// Get Authenticator - /// - /// Get details about an authenticator - /// - /// - Remark: HTTP `POST /public/v1/query/get_authenticator`. - /// - Remark: Generated from `#/paths//public/v1/query/get_authenticator/post(GetAuthenticator)`. - public func GetAuthenticator( - headers: Operations.GetAuthenticator.Input.Headers = .init(), - body: Operations.GetAuthenticator.Input.Body - ) async throws -> Operations.GetAuthenticator.Output { - try await GetAuthenticator( - Operations.GetAuthenticator.Input( - headers: headers, - body: body - )) - } - /// Get Authenticators - /// - /// Get details about authenticators for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/query/get_authenticators/post(GetAuthenticators)`. - public func GetAuthenticators( - headers: Operations.GetAuthenticators.Input.Headers = .init(), - body: Operations.GetAuthenticators.Input.Body - ) async throws -> Operations.GetAuthenticators.Output { - try await GetAuthenticators( - Operations.GetAuthenticators.Input( - headers: headers, - body: body - )) - } - /// Get Oauth providers - /// - /// Get details about Oauth providers for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/query/get_oauth_providers/post(GetOauthProviders)`. - public func GetOauthProviders( - headers: Operations.GetOauthProviders.Input.Headers = .init(), - body: Operations.GetOauthProviders.Input.Body - ) async throws -> Operations.GetOauthProviders.Output { - try await GetOauthProviders( - Operations.GetOauthProviders.Input( - headers: headers, - body: body - )) - } - /// Get Configs - /// - /// Get quorum settings and features for an organization - /// - /// - Remark: HTTP `POST /public/v1/query/get_organization_configs`. - /// - Remark: Generated from `#/paths//public/v1/query/get_organization_configs/post(GetOrganizationConfigs)`. - public func GetOrganizationConfigs( - headers: Operations.GetOrganizationConfigs.Input.Headers = .init(), - body: Operations.GetOrganizationConfigs.Input.Body - ) async throws -> Operations.GetOrganizationConfigs.Output { - try await GetOrganizationConfigs( - Operations.GetOrganizationConfigs.Input( - headers: headers, - body: body - )) - } - /// Get Policy - /// - /// Get details about a Policy - /// - /// - Remark: HTTP `POST /public/v1/query/get_policy`. - /// - Remark: Generated from `#/paths//public/v1/query/get_policy/post(GetPolicy)`. - public func GetPolicy( - headers: Operations.GetPolicy.Input.Headers = .init(), - body: Operations.GetPolicy.Input.Body - ) async throws -> Operations.GetPolicy.Output { - try await GetPolicy( - Operations.GetPolicy.Input( - headers: headers, - body: body - )) - } - /// Get Private Key - /// - /// Get details about a Private Key - /// - /// - Remark: HTTP `POST /public/v1/query/get_private_key`. - /// - Remark: Generated from `#/paths//public/v1/query/get_private_key/post(GetPrivateKey)`. - public func GetPrivateKey( - headers: Operations.GetPrivateKey.Input.Headers = .init(), - body: Operations.GetPrivateKey.Input.Body - ) async throws -> Operations.GetPrivateKey.Output { - try await GetPrivateKey( - Operations.GetPrivateKey.Input( - headers: headers, - body: body - )) - } - /// Get User - /// - /// Get details about a User - /// - /// - Remark: HTTP `POST /public/v1/query/get_user`. - /// - Remark: Generated from `#/paths//public/v1/query/get_user/post(GetUser)`. - public func GetUser( - headers: Operations.GetUser.Input.Headers = .init(), - body: Operations.GetUser.Input.Body - ) async throws -> Operations.GetUser.Output { - try await GetUser( - Operations.GetUser.Input( - headers: headers, - body: body - )) - } - /// Get Wallet - /// - /// Get details about a Wallet - /// - /// - Remark: HTTP `POST /public/v1/query/get_wallet`. - /// - Remark: Generated from `#/paths//public/v1/query/get_wallet/post(GetWallet)`. - public func GetWallet( - headers: Operations.GetWallet.Input.Headers = .init(), - body: Operations.GetWallet.Input.Body - ) async throws -> Operations.GetWallet.Output { - try await GetWallet( - Operations.GetWallet.Input( - headers: headers, - body: body - )) - } - /// Get Wallet Account - /// - /// Get a single wallet account - /// - /// - Remark: HTTP `POST /public/v1/query/get_wallet_account`. - /// - Remark: Generated from `#/paths//public/v1/query/get_wallet_account/post(GetWalletAccount)`. - public func GetWalletAccount( - headers: Operations.GetWalletAccount.Input.Headers = .init(), - body: Operations.GetWalletAccount.Input.Body - ) async throws -> Operations.GetWalletAccount.Output { - try await GetWalletAccount( - Operations.GetWalletAccount.Input( - headers: headers, - body: body - )) - } - /// List Activities - /// - /// List all Activities within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_activities`. - /// - Remark: Generated from `#/paths//public/v1/query/list_activities/post(GetActivities)`. - public func GetActivities( - headers: Operations.GetActivities.Input.Headers = .init(), - body: Operations.GetActivities.Input.Body - ) async throws -> Operations.GetActivities.Output { - try await GetActivities( - Operations.GetActivities.Input( - headers: headers, - body: body - )) - } - /// List Policies - /// - /// List all Policies within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_policies`. - /// - Remark: Generated from `#/paths//public/v1/query/list_policies/post(GetPolicies)`. - public func GetPolicies( - headers: Operations.GetPolicies.Input.Headers = .init(), - body: Operations.GetPolicies.Input.Body - ) async throws -> Operations.GetPolicies.Output { - try await GetPolicies( - Operations.GetPolicies.Input( - headers: headers, - body: body - )) - } - /// List Private Key Tags - /// - /// List all Private Key Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_private_key_tags`. - /// - Remark: Generated from `#/paths//public/v1/query/list_private_key_tags/post(ListPrivateKeyTags)`. - public func ListPrivateKeyTags( - headers: Operations.ListPrivateKeyTags.Input.Headers = .init(), - body: Operations.ListPrivateKeyTags.Input.Body - ) async throws -> Operations.ListPrivateKeyTags.Output { - try await ListPrivateKeyTags( - Operations.ListPrivateKeyTags.Input( - headers: headers, - body: body - )) - } - /// List Private Keys - /// - /// List all Private Keys within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/query/list_private_keys/post(GetPrivateKeys)`. - public func GetPrivateKeys( - headers: Operations.GetPrivateKeys.Input.Headers = .init(), - body: Operations.GetPrivateKeys.Input.Body - ) async throws -> Operations.GetPrivateKeys.Output { - try await GetPrivateKeys( - Operations.GetPrivateKeys.Input( - headers: headers, - body: body - )) - } - /// Get Suborgs - /// - /// Get all suborg IDs associated given a parent org ID and an optional filter. - /// - /// - Remark: HTTP `POST /public/v1/query/list_suborgs`. - /// - Remark: Generated from `#/paths//public/v1/query/list_suborgs/post(GetSubOrgIds)`. - public func GetSubOrgIds( - headers: Operations.GetSubOrgIds.Input.Headers = .init(), - body: Operations.GetSubOrgIds.Input.Body - ) async throws -> Operations.GetSubOrgIds.Output { - try await GetSubOrgIds( - Operations.GetSubOrgIds.Input( - headers: headers, - body: body - )) - } - /// List User Tags - /// - /// List all User Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_user_tags`. - /// - Remark: Generated from `#/paths//public/v1/query/list_user_tags/post(ListUserTags)`. - public func ListUserTags( - headers: Operations.ListUserTags.Input.Headers = .init(), - body: Operations.ListUserTags.Input.Body - ) async throws -> Operations.ListUserTags.Output { - try await ListUserTags( - Operations.ListUserTags.Input( - headers: headers, - body: body - )) - } - /// List Users - /// - /// List all Users within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_users`. - /// - Remark: Generated from `#/paths//public/v1/query/list_users/post(GetUsers)`. - public func GetUsers( - headers: Operations.GetUsers.Input.Headers = .init(), - body: Operations.GetUsers.Input.Body - ) async throws -> Operations.GetUsers.Output { - try await GetUsers( - Operations.GetUsers.Input( - headers: headers, - body: body - )) - } - /// Get Verified Suborgs - /// - /// Get all email or phone verified suborg IDs associated given a parent org ID. - /// - /// - Remark: HTTP `POST /public/v1/query/list_verified_suborgs`. - /// - Remark: Generated from `#/paths//public/v1/query/list_verified_suborgs/post(GetVerifiedSubOrgIds)`. - public func GetVerifiedSubOrgIds( - headers: Operations.GetVerifiedSubOrgIds.Input.Headers = .init(), - body: Operations.GetVerifiedSubOrgIds.Input.Body - ) async throws -> Operations.GetVerifiedSubOrgIds.Output { - try await GetVerifiedSubOrgIds( - Operations.GetVerifiedSubOrgIds.Input( - headers: headers, - body: body - )) - } - /// List Wallets Accounts - /// - /// List all Accounts within a Wallet - /// - /// - Remark: HTTP `POST /public/v1/query/list_wallet_accounts`. - /// - Remark: Generated from `#/paths//public/v1/query/list_wallet_accounts/post(GetWalletAccounts)`. - public func GetWalletAccounts( - headers: Operations.GetWalletAccounts.Input.Headers = .init(), - body: Operations.GetWalletAccounts.Input.Body - ) async throws -> Operations.GetWalletAccounts.Output { - try await GetWalletAccounts( - Operations.GetWalletAccounts.Input( - headers: headers, - body: body - )) - } - /// List Wallets - /// - /// List all Wallets within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_wallets`. - /// - Remark: Generated from `#/paths//public/v1/query/list_wallets/post(GetWallets)`. - public func GetWallets( - headers: Operations.GetWallets.Input.Headers = .init(), - body: Operations.GetWallets.Input.Body - ) async throws -> Operations.GetWallets.Output { - try await GetWallets( - Operations.GetWallets.Input( - headers: headers, - body: body - )) - } - /// Who am I? - /// - /// Get basic information about your current API or WebAuthN user and their organization. Affords Sub-Organization look ups via Parent Organization for WebAuthN or API key users. - /// - /// - Remark: HTTP `POST /public/v1/query/whoami`. - /// - Remark: Generated from `#/paths//public/v1/query/whoami/post(GetWhoami)`. - public func GetWhoami( - headers: Operations.GetWhoami.Input.Headers = .init(), - body: Operations.GetWhoami.Input.Body - ) async throws -> Operations.GetWhoami.Output { - try await GetWhoami( - Operations.GetWhoami.Input( - headers: headers, - body: body - )) - } - /// Approve Activity - /// - /// Approve an Activity - /// - /// - Remark: HTTP `POST /public/v1/submit/approve_activity`. - /// - Remark: Generated from `#/paths//public/v1/submit/approve_activity/post(ApproveActivity)`. - public func ApproveActivity( - headers: Operations.ApproveActivity.Input.Headers = .init(), - body: Operations.ApproveActivity.Input.Body - ) async throws -> Operations.ApproveActivity.Output { - try await ApproveActivity( - Operations.ApproveActivity.Input( - headers: headers, - body: body - )) - } - /// Create API Keys - /// - /// Add api keys to an existing User - /// - /// - Remark: HTTP `POST /public/v1/submit/create_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_api_keys/post(CreateApiKeys)`. - public func CreateApiKeys( - headers: Operations.CreateApiKeys.Input.Headers = .init(), - body: Operations.CreateApiKeys.Input.Body - ) async throws -> Operations.CreateApiKeys.Output { - try await CreateApiKeys( - Operations.CreateApiKeys.Input( - headers: headers, - body: body - )) - } - /// Create Authenticators - /// - /// Create Authenticators to authenticate requests to Turnkey - /// - /// - Remark: HTTP `POST /public/v1/submit/create_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_authenticators/post(CreateAuthenticators)`. - public func CreateAuthenticators( - headers: Operations.CreateAuthenticators.Input.Headers = .init(), - body: Operations.CreateAuthenticators.Input.Body - ) async throws -> Operations.CreateAuthenticators.Output { - try await CreateAuthenticators( - Operations.CreateAuthenticators.Input( - headers: headers, - body: body - )) - } - /// Create Invitations - /// - /// Create Invitations to join an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_invitations`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_invitations/post(CreateInvitations)`. - public func CreateInvitations( - headers: Operations.CreateInvitations.Input.Headers = .init(), - body: Operations.CreateInvitations.Input.Body - ) async throws -> Operations.CreateInvitations.Output { - try await CreateInvitations( - Operations.CreateInvitations.Input( - headers: headers, - body: body - )) - } - /// Create Oauth Providers - /// - /// Creates Oauth providers for a specified user - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/create_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_oauth_providers/post(CreateOauthProviders)`. - public func CreateOauthProviders( - headers: Operations.CreateOauthProviders.Input.Headers = .init(), - body: Operations.CreateOauthProviders.Input.Body - ) async throws -> Operations.CreateOauthProviders.Output { - try await CreateOauthProviders( - Operations.CreateOauthProviders.Input( - headers: headers, - body: body - )) - } - /// Create Policies - /// - /// Create new Policies - /// - /// - Remark: HTTP `POST /public/v1/submit/create_policies`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_policies/post(CreatePolicies)`. - public func CreatePolicies( - headers: Operations.CreatePolicies.Input.Headers = .init(), - body: Operations.CreatePolicies.Input.Body - ) async throws -> Operations.CreatePolicies.Output { - try await CreatePolicies( - Operations.CreatePolicies.Input( - headers: headers, - body: body - )) - } - /// Create Policy - /// - /// Create a new Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/create_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_policy/post(CreatePolicy)`. - public func CreatePolicy( - headers: Operations.CreatePolicy.Input.Headers = .init(), - body: Operations.CreatePolicy.Input.Body - ) async throws -> Operations.CreatePolicy.Output { - try await CreatePolicy( - Operations.CreatePolicy.Input( - headers: headers, - body: body - )) - } - /// Create Private Key Tag - /// - /// Create a private key tag and add it to private keys. - /// - /// - Remark: HTTP `POST /public/v1/submit/create_private_key_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_private_key_tag/post(CreatePrivateKeyTag)`. - public func CreatePrivateKeyTag( - headers: Operations.CreatePrivateKeyTag.Input.Headers = .init(), - body: Operations.CreatePrivateKeyTag.Input.Body - ) async throws -> Operations.CreatePrivateKeyTag.Output { - try await CreatePrivateKeyTag( - Operations.CreatePrivateKeyTag.Input( - headers: headers, - body: body - )) - } - /// Create Private Keys - /// - /// Create new Private Keys - /// - /// - Remark: HTTP `POST /public/v1/submit/create_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_private_keys/post(CreatePrivateKeys)`. - public func CreatePrivateKeys( - headers: Operations.CreatePrivateKeys.Input.Headers = .init(), - body: Operations.CreatePrivateKeys.Input.Body - ) async throws -> Operations.CreatePrivateKeys.Output { - try await CreatePrivateKeys( - Operations.CreatePrivateKeys.Input( - headers: headers, - body: body - )) - } - /// Create Read Only Session - /// - /// Create a read only session for a user (valid for 1 hour) - /// - /// - Remark: HTTP `POST /public/v1/submit/create_read_only_session`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_read_only_session/post(CreateReadOnlySession)`. - public func CreateReadOnlySession( - headers: Operations.CreateReadOnlySession.Input.Headers = .init(), - body: Operations.CreateReadOnlySession.Input.Body - ) async throws -> Operations.CreateReadOnlySession.Output { - try await CreateReadOnlySession( - Operations.CreateReadOnlySession.Input( - headers: headers, - body: body - )) - } - /// Create Read Write Session - /// - /// Create a read write session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/create_read_write_session`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_read_write_session/post(CreateReadWriteSession)`. - public func CreateReadWriteSession( - headers: Operations.CreateReadWriteSession.Input.Headers = .init(), - body: Operations.CreateReadWriteSession.Input.Body - ) async throws -> Operations.CreateReadWriteSession.Output { - try await CreateReadWriteSession( - Operations.CreateReadWriteSession.Input( - headers: headers, - body: body - )) - } - /// Create Sub-Organization - /// - /// Create a new Sub-Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_sub_organization`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_sub_organization/post(CreateSubOrganization)`. - public func CreateSubOrganization( - headers: Operations.CreateSubOrganization.Input.Headers = .init(), - body: Operations.CreateSubOrganization.Input.Body - ) async throws -> Operations.CreateSubOrganization.Output { - try await CreateSubOrganization( - Operations.CreateSubOrganization.Input( - headers: headers, - body: body - )) - } - /// Create User Tag - /// - /// Create a user tag and add it to users. - /// - /// - Remark: HTTP `POST /public/v1/submit/create_user_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_user_tag/post(CreateUserTag)`. - public func CreateUserTag( - headers: Operations.CreateUserTag.Input.Headers = .init(), - body: Operations.CreateUserTag.Input.Body - ) async throws -> Operations.CreateUserTag.Output { - try await CreateUserTag( - Operations.CreateUserTag.Input( - headers: headers, - body: body - )) - } - /// Create Users - /// - /// Create Users in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_users`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_users/post(CreateUsers)`. - public func CreateUsers( - headers: Operations.CreateUsers.Input.Headers = .init(), - body: Operations.CreateUsers.Input.Body - ) async throws -> Operations.CreateUsers.Output { - try await CreateUsers( - Operations.CreateUsers.Input( - headers: headers, - body: body - )) - } - /// Create Wallet - /// - /// Create a Wallet and derive addresses - /// - /// - Remark: HTTP `POST /public/v1/submit/create_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_wallet/post(CreateWallet)`. - public func CreateWallet( - headers: Operations.CreateWallet.Input.Headers = .init(), - body: Operations.CreateWallet.Input.Body - ) async throws -> Operations.CreateWallet.Output { - try await CreateWallet( - Operations.CreateWallet.Input( - headers: headers, - body: body - )) - } - /// Create Wallet Accounts - /// - /// Derive additional addresses using an existing wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/create_wallet_accounts`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_wallet_accounts/post(CreateWalletAccounts)`. - public func CreateWalletAccounts( - headers: Operations.CreateWalletAccounts.Input.Headers = .init(), - body: Operations.CreateWalletAccounts.Input.Body - ) async throws -> Operations.CreateWalletAccounts.Output { - try await CreateWalletAccounts( - Operations.CreateWalletAccounts.Input( - headers: headers, - body: body - )) - } - /// Delete API Keys - /// - /// Remove api keys from a User - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_api_keys/post(DeleteApiKeys)`. - public func DeleteApiKeys( - headers: Operations.DeleteApiKeys.Input.Headers = .init(), - body: Operations.DeleteApiKeys.Input.Body - ) async throws -> Operations.DeleteApiKeys.Output { - try await DeleteApiKeys( - Operations.DeleteApiKeys.Input( - headers: headers, - body: body - )) - } - /// Delete Authenticators - /// - /// Remove authenticators from a User - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_authenticators/post(DeleteAuthenticators)`. - public func DeleteAuthenticators( - headers: Operations.DeleteAuthenticators.Input.Headers = .init(), - body: Operations.DeleteAuthenticators.Input.Body - ) async throws -> Operations.DeleteAuthenticators.Output { - try await DeleteAuthenticators( - Operations.DeleteAuthenticators.Input( - headers: headers, - body: body - )) - } - /// Delete Invitation - /// - /// Delete an existing Invitation - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_invitation`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_invitation/post(DeleteInvitation)`. - public func DeleteInvitation( - headers: Operations.DeleteInvitation.Input.Headers = .init(), - body: Operations.DeleteInvitation.Input.Body - ) async throws -> Operations.DeleteInvitation.Output { - try await DeleteInvitation( - Operations.DeleteInvitation.Input( - headers: headers, - body: body - )) - } - /// Delete Oauth Providers - /// - /// Removes Oauth providers for a specified user - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_oauth_providers/post(DeleteOauthProviders)`. - public func DeleteOauthProviders( - headers: Operations.DeleteOauthProviders.Input.Headers = .init(), - body: Operations.DeleteOauthProviders.Input.Body - ) async throws -> Operations.DeleteOauthProviders.Output { - try await DeleteOauthProviders( - Operations.DeleteOauthProviders.Input( - headers: headers, - body: body - )) - } - /// Delete Policy - /// - /// Delete an existing Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_policy/post(DeletePolicy)`. - public func DeletePolicy( - headers: Operations.DeletePolicy.Input.Headers = .init(), - body: Operations.DeletePolicy.Input.Body - ) async throws -> Operations.DeletePolicy.Output { - try await DeletePolicy( - Operations.DeletePolicy.Input( - headers: headers, - body: body - )) - } - /// Delete Private Key Tags - /// - /// Delete Private Key Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_private_key_tags`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_private_key_tags/post(DeletePrivateKeyTags)`. - public func DeletePrivateKeyTags( - headers: Operations.DeletePrivateKeyTags.Input.Headers = .init(), - body: Operations.DeletePrivateKeyTags.Input.Body - ) async throws -> Operations.DeletePrivateKeyTags.Output { - try await DeletePrivateKeyTags( - Operations.DeletePrivateKeyTags.Input( - headers: headers, - body: body - )) - } - /// Delete Private Keys - /// - /// Deletes private keys for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_private_keys/post(DeletePrivateKeys)`. - public func DeletePrivateKeys( - headers: Operations.DeletePrivateKeys.Input.Headers = .init(), - body: Operations.DeletePrivateKeys.Input.Body - ) async throws -> Operations.DeletePrivateKeys.Output { - try await DeletePrivateKeys( - Operations.DeletePrivateKeys.Input( - headers: headers, - body: body - )) - } - /// Delete Sub Organization - /// - /// Deletes a sub organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_sub_organization`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_sub_organization/post(DeleteSubOrganization)`. - public func DeleteSubOrganization( - headers: Operations.DeleteSubOrganization.Input.Headers = .init(), - body: Operations.DeleteSubOrganization.Input.Body - ) async throws -> Operations.DeleteSubOrganization.Output { - try await DeleteSubOrganization( - Operations.DeleteSubOrganization.Input( - headers: headers, - body: body - )) - } - /// Delete User Tags - /// - /// Delete User Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_user_tags`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_user_tags/post(DeleteUserTags)`. - public func DeleteUserTags( - headers: Operations.DeleteUserTags.Input.Headers = .init(), - body: Operations.DeleteUserTags.Input.Body - ) async throws -> Operations.DeleteUserTags.Output { - try await DeleteUserTags( - Operations.DeleteUserTags.Input( - headers: headers, - body: body - )) - } - /// Delete Users - /// - /// Delete Users within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_users`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_users/post(DeleteUsers)`. - public func DeleteUsers( - headers: Operations.DeleteUsers.Input.Headers = .init(), - body: Operations.DeleteUsers.Input.Body - ) async throws -> Operations.DeleteUsers.Output { - try await DeleteUsers( - Operations.DeleteUsers.Input( - headers: headers, - body: body - )) - } - /// Delete Wallets - /// - /// Deletes wallets for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_wallets`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_wallets/post(DeleteWallets)`. - public func DeleteWallets( - headers: Operations.DeleteWallets.Input.Headers = .init(), - body: Operations.DeleteWallets.Input.Body - ) async throws -> Operations.DeleteWallets.Output { - try await DeleteWallets( - Operations.DeleteWallets.Input( - headers: headers, - body: body - )) - } - /// Perform Email Auth - /// - /// Authenticate a user via Email - /// - /// - Remark: HTTP `POST /public/v1/submit/email_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/email_auth/post(EmailAuth)`. - public func EmailAuth( - headers: Operations.EmailAuth.Input.Headers = .init(), - body: Operations.EmailAuth.Input.Body - ) async throws -> Operations.EmailAuth.Output { - try await EmailAuth( - Operations.EmailAuth.Input( - headers: headers, - body: body - )) - } - /// Export Private Key - /// - /// Exports a Private Key - /// - /// - Remark: HTTP `POST /public/v1/submit/export_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_private_key/post(ExportPrivateKey)`. - public func ExportPrivateKey( - headers: Operations.ExportPrivateKey.Input.Headers = .init(), - body: Operations.ExportPrivateKey.Input.Body - ) async throws -> Operations.ExportPrivateKey.Output { - try await ExportPrivateKey( - Operations.ExportPrivateKey.Input( - headers: headers, - body: body - )) - } - /// Export Wallet - /// - /// Exports a Wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/export_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_wallet/post(ExportWallet)`. - public func ExportWallet( - headers: Operations.ExportWallet.Input.Headers = .init(), - body: Operations.ExportWallet.Input.Body - ) async throws -> Operations.ExportWallet.Output { - try await ExportWallet( - Operations.ExportWallet.Input( - headers: headers, - body: body - )) - } - /// Export Wallet Account - /// - /// Exports a Wallet Account - /// - /// - Remark: HTTP `POST /public/v1/submit/export_wallet_account`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_wallet_account/post(ExportWalletAccount)`. - public func ExportWalletAccount( - headers: Operations.ExportWalletAccount.Input.Headers = .init(), - body: Operations.ExportWalletAccount.Input.Body - ) async throws -> Operations.ExportWalletAccount.Output { - try await ExportWalletAccount( - Operations.ExportWalletAccount.Input( - headers: headers, - body: body - )) - } - /// Import Private Key - /// - /// Imports a private key - /// - /// - Remark: HTTP `POST /public/v1/submit/import_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/import_private_key/post(ImportPrivateKey)`. - public func ImportPrivateKey( - headers: Operations.ImportPrivateKey.Input.Headers = .init(), - body: Operations.ImportPrivateKey.Input.Body - ) async throws -> Operations.ImportPrivateKey.Output { - try await ImportPrivateKey( - Operations.ImportPrivateKey.Input( - headers: headers, - body: body - )) - } - /// Import Wallet - /// - /// Imports a wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/import_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/import_wallet/post(ImportWallet)`. - public func ImportWallet( - headers: Operations.ImportWallet.Input.Headers = .init(), - body: Operations.ImportWallet.Input.Body - ) async throws -> Operations.ImportWallet.Output { - try await ImportWallet( - Operations.ImportWallet.Input( - headers: headers, - body: body - )) - } - /// Init Import Private Key - /// - /// Initializes a new private key import - /// - /// - Remark: HTTP `POST /public/v1/submit/init_import_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_import_private_key/post(InitImportPrivateKey)`. - public func InitImportPrivateKey( - headers: Operations.InitImportPrivateKey.Input.Headers = .init(), - body: Operations.InitImportPrivateKey.Input.Body - ) async throws -> Operations.InitImportPrivateKey.Output { - try await InitImportPrivateKey( - Operations.InitImportPrivateKey.Input( - headers: headers, - body: body - )) - } - /// Init Import Wallet - /// - /// Initializes a new wallet import - /// - /// - Remark: HTTP `POST /public/v1/submit/init_import_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_import_wallet/post(InitImportWallet)`. - public func InitImportWallet( - headers: Operations.InitImportWallet.Input.Headers = .init(), - body: Operations.InitImportWallet.Input.Body - ) async throws -> Operations.InitImportWallet.Output { - try await InitImportWallet( - Operations.InitImportWallet.Input( - headers: headers, - body: body - )) - } - /// Init Generic OTP - /// - /// Initiate a Generic OTP activity - /// - /// - Remark: HTTP `POST /public/v1/submit/init_otp`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_otp/post(InitOtp)`. - public func InitOtp( - headers: Operations.InitOtp.Input.Headers = .init(), - body: Operations.InitOtp.Input.Body - ) async throws -> Operations.InitOtp.Output { - try await InitOtp( - Operations.InitOtp.Input( - headers: headers, - body: body - )) - } - /// Init OTP auth - /// - /// Initiate an OTP auth activity - /// - /// - Remark: HTTP `POST /public/v1/submit/init_otp_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_otp_auth/post(InitOtpAuth)`. - public func InitOtpAuth( - headers: Operations.InitOtpAuth.Input.Headers = .init(), - body: Operations.InitOtpAuth.Input.Body - ) async throws -> Operations.InitOtpAuth.Output { - try await InitOtpAuth( - Operations.InitOtpAuth.Input( - headers: headers, - body: body - )) - } - /// Init Email Recovery - /// - /// Initializes a new email recovery - /// - /// - Remark: HTTP `POST /public/v1/submit/init_user_email_recovery`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_user_email_recovery/post(InitUserEmailRecovery)`. - public func InitUserEmailRecovery( - headers: Operations.InitUserEmailRecovery.Input.Headers = .init(), - body: Operations.InitUserEmailRecovery.Input.Body - ) async throws -> Operations.InitUserEmailRecovery.Output { - try await InitUserEmailRecovery( - Operations.InitUserEmailRecovery.Input( - headers: headers, - body: body - )) - } - /// Oauth - /// - /// Authenticate a user with an Oidc token (Oauth) - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/oauth`. - /// - Remark: Generated from `#/paths//public/v1/submit/oauth/post(Oauth)`. - public func Oauth( - headers: Operations.Oauth.Input.Headers = .init(), - body: Operations.Oauth.Input.Body - ) async throws -> Operations.Oauth.Output { - try await Oauth( - Operations.Oauth.Input( - headers: headers, - body: body - )) - } - /// Login with Oauth - /// - /// Create an Oauth session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/oauth_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/oauth_login/post(OauthLogin)`. - public func OauthLogin( - headers: Operations.OauthLogin.Input.Headers = .init(), - body: Operations.OauthLogin.Input.Body - ) async throws -> Operations.OauthLogin.Output { - try await OauthLogin( - Operations.OauthLogin.Input( - headers: headers, - body: body - )) - } - /// OTP auth - /// - /// Authenticate a user with an OTP code sent via email or SMS - /// - /// - Remark: HTTP `POST /public/v1/submit/otp_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/otp_auth/post(OtpAuth)`. - public func OtpAuth( - headers: Operations.OtpAuth.Input.Headers = .init(), - body: Operations.OtpAuth.Input.Body - ) async throws -> Operations.OtpAuth.Output { - try await OtpAuth( - Operations.OtpAuth.Input( - headers: headers, - body: body - )) - } - /// Login with OTP - /// - /// Create an OTP session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/otp_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/otp_login/post(OtpLogin)`. - public func OtpLogin( - headers: Operations.OtpLogin.Input.Headers = .init(), - body: Operations.OtpLogin.Input.Body - ) async throws -> Operations.OtpLogin.Output { - try await OtpLogin( - Operations.OtpLogin.Input( - headers: headers, - body: body - )) - } - /// Recover a user - /// - /// Completes the process of recovering a user by adding an authenticator - /// - /// - Remark: HTTP `POST /public/v1/submit/recover_user`. - /// - Remark: Generated from `#/paths//public/v1/submit/recover_user/post(RecoverUser)`. - public func RecoverUser( - headers: Operations.RecoverUser.Input.Headers = .init(), - body: Operations.RecoverUser.Input.Body - ) async throws -> Operations.RecoverUser.Output { - try await RecoverUser( - Operations.RecoverUser.Input( - headers: headers, - body: body - )) - } - /// Reject Activity - /// - /// Reject an Activity - /// - /// - Remark: HTTP `POST /public/v1/submit/reject_activity`. - /// - Remark: Generated from `#/paths//public/v1/submit/reject_activity/post(RejectActivity)`. - public func RejectActivity( - headers: Operations.RejectActivity.Input.Headers = .init(), - body: Operations.RejectActivity.Input.Body - ) async throws -> Operations.RejectActivity.Output { - try await RejectActivity( - Operations.RejectActivity.Input( - headers: headers, - body: body - )) - } - /// Remove Organization Feature - /// - /// Removes an organization feature. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/remove_organization_feature`. - /// - Remark: Generated from `#/paths//public/v1/submit/remove_organization_feature/post(RemoveOrganizationFeature)`. - public func RemoveOrganizationFeature( - headers: Operations.RemoveOrganizationFeature.Input.Headers = .init(), - body: Operations.RemoveOrganizationFeature.Input.Body - ) async throws -> Operations.RemoveOrganizationFeature.Output { - try await RemoveOrganizationFeature( - Operations.RemoveOrganizationFeature.Input( - headers: headers, - body: body - )) - } - /// Set Organization Feature - /// - /// Sets an organization feature. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/set_organization_feature`. - /// - Remark: Generated from `#/paths//public/v1/submit/set_organization_feature/post(SetOrganizationFeature)`. - public func SetOrganizationFeature( - headers: Operations.SetOrganizationFeature.Input.Headers = .init(), - body: Operations.SetOrganizationFeature.Input.Body - ) async throws -> Operations.SetOrganizationFeature.Output { - try await SetOrganizationFeature( - Operations.SetOrganizationFeature.Input( - headers: headers, - body: body - )) - } - /// Sign Raw Payload - /// - /// Sign a raw payload - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_raw_payload`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_raw_payload/post(SignRawPayload)`. - public func SignRawPayload( - headers: Operations.SignRawPayload.Input.Headers = .init(), - body: Operations.SignRawPayload.Input.Body - ) async throws -> Operations.SignRawPayload.Output { - try await SignRawPayload( - Operations.SignRawPayload.Input( - headers: headers, - body: body - )) - } - /// Sign Raw Payloads - /// - /// Sign multiple raw payloads with the same signing parameters - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_raw_payloads`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_raw_payloads/post(SignRawPayloads)`. - public func SignRawPayloads( - headers: Operations.SignRawPayloads.Input.Headers = .init(), - body: Operations.SignRawPayloads.Input.Body - ) async throws -> Operations.SignRawPayloads.Output { - try await SignRawPayloads( - Operations.SignRawPayloads.Input( - headers: headers, - body: body - )) - } - /// Sign Transaction - /// - /// Sign a transaction - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_transaction`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_transaction/post(SignTransaction)`. - public func SignTransaction( - headers: Operations.SignTransaction.Input.Headers = .init(), - body: Operations.SignTransaction.Input.Body - ) async throws -> Operations.SignTransaction.Output { - try await SignTransaction( - Operations.SignTransaction.Input( - headers: headers, - body: body - )) - } - /// Login with a Stamp - /// - /// Create a session for a user through stamping client side (api key, wallet client, or passkey client) - /// - /// - Remark: HTTP `POST /public/v1/submit/stamp_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/stamp_login/post(StampLogin)`. - public func StampLogin( - headers: Operations.StampLogin.Input.Headers = .init(), - body: Operations.StampLogin.Input.Body - ) async throws -> Operations.StampLogin.Output { - try await StampLogin( - Operations.StampLogin.Input( - headers: headers, - body: body - )) - } - /// Update Policy - /// - /// Update an existing Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/update_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_policy/post(UpdatePolicy)`. - public func UpdatePolicy( - headers: Operations.UpdatePolicy.Input.Headers = .init(), - body: Operations.UpdatePolicy.Input.Body - ) async throws -> Operations.UpdatePolicy.Output { - try await UpdatePolicy( - Operations.UpdatePolicy.Input( - headers: headers, - body: body - )) - } - /// Update Private Key Tag - /// - /// Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_private_key_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_private_key_tag/post(UpdatePrivateKeyTag)`. - public func UpdatePrivateKeyTag( - headers: Operations.UpdatePrivateKeyTag.Input.Headers = .init(), - body: Operations.UpdatePrivateKeyTag.Input.Body - ) async throws -> Operations.UpdatePrivateKeyTag.Output { - try await UpdatePrivateKeyTag( - Operations.UpdatePrivateKeyTag.Input( - headers: headers, - body: body - )) - } - /// Update Root Quorum - /// - /// Set the threshold and members of the root quorum. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_root_quorum`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_root_quorum/post(UpdateRootQuorum)`. - public func UpdateRootQuorum( - headers: Operations.UpdateRootQuorum.Input.Headers = .init(), - body: Operations.UpdateRootQuorum.Input.Body - ) async throws -> Operations.UpdateRootQuorum.Output { - try await UpdateRootQuorum( - Operations.UpdateRootQuorum.Input( - headers: headers, - body: body - )) - } - /// Update User - /// - /// Update a User in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user/post(UpdateUser)`. - public func UpdateUser( - headers: Operations.UpdateUser.Input.Headers = .init(), - body: Operations.UpdateUser.Input.Body - ) async throws -> Operations.UpdateUser.Output { - try await UpdateUser( - Operations.UpdateUser.Input( - headers: headers, - body: body - )) - } - /// Update User's Email - /// - /// Update a User's email in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_email`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_email/post(UpdateUserEmail)`. - public func UpdateUserEmail( - headers: Operations.UpdateUserEmail.Input.Headers = .init(), - body: Operations.UpdateUserEmail.Input.Body - ) async throws -> Operations.UpdateUserEmail.Output { - try await UpdateUserEmail( - Operations.UpdateUserEmail.Input( - headers: headers, - body: body - )) - } - /// Update User's Name - /// - /// Update a User's name in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_name`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_name/post(UpdateUserName)`. - public func UpdateUserName( - headers: Operations.UpdateUserName.Input.Headers = .init(), - body: Operations.UpdateUserName.Input.Body - ) async throws -> Operations.UpdateUserName.Output { - try await UpdateUserName( - Operations.UpdateUserName.Input( - headers: headers, - body: body - )) - } - /// Update User's Phone Number - /// - /// Update a User's phone number in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_phone_number`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_phone_number/post(UpdateUserPhoneNumber)`. - public func UpdateUserPhoneNumber( - headers: Operations.UpdateUserPhoneNumber.Input.Headers = .init(), - body: Operations.UpdateUserPhoneNumber.Input.Body - ) async throws -> Operations.UpdateUserPhoneNumber.Output { - try await UpdateUserPhoneNumber( - Operations.UpdateUserPhoneNumber.Input( - headers: headers, - body: body - )) - } - /// Update User Tag - /// - /// Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_tag/post(UpdateUserTag)`. - public func UpdateUserTag( - headers: Operations.UpdateUserTag.Input.Headers = .init(), - body: Operations.UpdateUserTag.Input.Body - ) async throws -> Operations.UpdateUserTag.Output { - try await UpdateUserTag( - Operations.UpdateUserTag.Input( - headers: headers, - body: body - )) - } - /// Update Wallet - /// - /// Update a wallet for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_wallet/post(UpdateWallet)`. - public func UpdateWallet( - headers: Operations.UpdateWallet.Input.Headers = .init(), - body: Operations.UpdateWallet.Input.Body - ) async throws -> Operations.UpdateWallet.Output { - try await UpdateWallet( - Operations.UpdateWallet.Input( - headers: headers, - body: body - )) - } - /// Verify Generic OTP - /// - /// Verify a Generic OTP - /// - /// - Remark: HTTP `POST /public/v1/submit/verify_otp`. - /// - Remark: Generated from `#/paths//public/v1/submit/verify_otp/post(VerifyOtp)`. - public func VerifyOtp( - headers: Operations.VerifyOtp.Input.Headers = .init(), - body: Operations.VerifyOtp.Input.Body - ) async throws -> Operations.VerifyOtp.Output { - try await VerifyOtp( - Operations.VerifyOtp.Input( - headers: headers, - body: body - )) - } -} - -/// Server URLs defined in the OpenAPI document. -public enum Servers { - public enum Server1 { - public static func url() throws -> Foundation.URL { - try Foundation.URL( - validatingOpenAPIServerURL: "https://api.turnkey.com/", - variables: [] - ) - } - } - @available(*, deprecated, renamed: "Servers.Server1.url") - public static func server1() throws -> Foundation.URL { - try Foundation.URL( - validatingOpenAPIServerURL: "https://api.turnkey.com/", - variables: [] - ) - } -} - -/// Types generated from the components section of the OpenAPI document. -public enum Components { - /// Types generated from the `#/components/schemas` section of the OpenAPI document. - public enum Schemas { - /// - Remark: Generated from `#/components/schemas/AcceptInvitationIntent`. - public struct AcceptInvitationIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Invitation object. - /// - /// - Remark: Generated from `#/components/schemas/AcceptInvitationIntent/invitationId`. - public var invitationId: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/AcceptInvitationIntent/userId`. - public var userId: Swift.String - /// - Remark: Generated from `#/components/schemas/AcceptInvitationIntent/authenticator`. - public var authenticator: Components.Schemas.AuthenticatorParams - /// Creates a new `AcceptInvitationIntent`. - /// - /// - Parameters: - /// - invitationId: Unique identifier for a given Invitation object. - /// - userId: Unique identifier for a given User. - /// - authenticator: - public init( - invitationId: Swift.String, - userId: Swift.String, - authenticator: Components.Schemas.AuthenticatorParams - ) { - self.invitationId = invitationId - self.userId = userId - self.authenticator = authenticator - } - public enum CodingKeys: String, CodingKey { - case invitationId - case userId - case authenticator - } - } - /// - Remark: Generated from `#/components/schemas/AcceptInvitationIntentV2`. - public struct AcceptInvitationIntentV2: Codable, Hashable, Sendable { - /// Unique identifier for a given Invitation object. - /// - /// - Remark: Generated from `#/components/schemas/AcceptInvitationIntentV2/invitationId`. - public var invitationId: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/AcceptInvitationIntentV2/userId`. - public var userId: Swift.String - /// - Remark: Generated from `#/components/schemas/AcceptInvitationIntentV2/authenticator`. - public var authenticator: Components.Schemas.AuthenticatorParamsV2 - /// Creates a new `AcceptInvitationIntentV2`. - /// - /// - Parameters: - /// - invitationId: Unique identifier for a given Invitation object. - /// - userId: Unique identifier for a given User. - /// - authenticator: - public init( - invitationId: Swift.String, - userId: Swift.String, - authenticator: Components.Schemas.AuthenticatorParamsV2 - ) { - self.invitationId = invitationId - self.userId = userId - self.authenticator = authenticator - } - public enum CodingKeys: String, CodingKey { - case invitationId - case userId - case authenticator - } - } - /// - Remark: Generated from `#/components/schemas/AcceptInvitationResult`. - public struct AcceptInvitationResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Invitation. - /// - /// - Remark: Generated from `#/components/schemas/AcceptInvitationResult/invitationId`. - public var invitationId: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/AcceptInvitationResult/userId`. - public var userId: Swift.String - /// Creates a new `AcceptInvitationResult`. - /// - /// - Parameters: - /// - invitationId: Unique identifier for a given Invitation. - /// - userId: Unique identifier for a given User. - public init( - invitationId: Swift.String, - userId: Swift.String - ) { - self.invitationId = invitationId - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case invitationId - case userId - } - } - /// - Remark: Generated from `#/components/schemas/AccessType`. - @frozen public enum AccessType: String, Codable, Hashable, Sendable, CaseIterable { - case ACCESS_TYPE_WEB = "ACCESS_TYPE_WEB" - case ACCESS_TYPE_API = "ACCESS_TYPE_API" - case ACCESS_TYPE_ALL = "ACCESS_TYPE_ALL" - } - /// - Remark: Generated from `#/components/schemas/ActivateBillingTierIntent`. - public struct ActivateBillingTierIntent: Codable, Hashable, Sendable { - /// The product that the customer wants to subscribe to. - /// - /// - Remark: Generated from `#/components/schemas/ActivateBillingTierIntent/productId`. - public var productId: Swift.String - /// Creates a new `ActivateBillingTierIntent`. - /// - /// - Parameters: - /// - productId: The product that the customer wants to subscribe to. - public init(productId: Swift.String) { - self.productId = productId - } - public enum CodingKeys: String, CodingKey { - case productId - } - } - /// - Remark: Generated from `#/components/schemas/ActivateBillingTierResult`. - public struct ActivateBillingTierResult: Codable, Hashable, Sendable { - /// The id of the product being subscribed to. - /// - /// - Remark: Generated from `#/components/schemas/ActivateBillingTierResult/productId`. - public var productId: Swift.String - /// Creates a new `ActivateBillingTierResult`. - /// - /// - Parameters: - /// - productId: The id of the product being subscribed to. - public init(productId: Swift.String) { - self.productId = productId - } - public enum CodingKeys: String, CodingKey { - case productId - } - } - /// - Remark: Generated from `#/components/schemas/Activity`. - public struct Activity: Codable, Hashable, Sendable { - /// Unique identifier for a given Activity object. - /// - /// - Remark: Generated from `#/components/schemas/Activity/id`. - public var id: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/Activity/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/Activity/status`. - public var status: Components.Schemas.ActivityStatus - /// - Remark: Generated from `#/components/schemas/Activity/type`. - public var _type: Components.Schemas.ActivityType - /// - Remark: Generated from `#/components/schemas/Activity/intent`. - public var intent: Components.Schemas.Intent - /// - Remark: Generated from `#/components/schemas/Activity/result`. - public var result: Components.Schemas.Result - /// A list of objects representing a particular User's approval or rejection of a Consensus request, including all relevant metadata. - /// - /// - Remark: Generated from `#/components/schemas/Activity/votes`. - public var votes: [Components.Schemas.Vote] - /// An artifact verifying a User's action. - /// - /// - Remark: Generated from `#/components/schemas/Activity/fingerprint`. - public var fingerprint: Swift.String - /// - Remark: Generated from `#/components/schemas/Activity/canApprove`. - public var canApprove: Swift.Bool - /// - Remark: Generated from `#/components/schemas/Activity/canReject`. - public var canReject: Swift.Bool - /// - Remark: Generated from `#/components/schemas/Activity/createdAt`. - public var createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// - Remark: Generated from `#/components/schemas/Activity/updatedAt`. - public var updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// - Remark: Generated from `#/components/schemas/Activity/failure`. - public var failure: Components.Schemas.Status? - /// Creates a new `Activity`. - /// - /// - Parameters: - /// - id: Unique identifier for a given Activity object. - /// - organizationId: Unique identifier for a given Organization. - /// - status: - /// - _type: - /// - intent: - /// - result: - /// - votes: A list of objects representing a particular User's approval or rejection of a Consensus request, including all relevant metadata. - /// - fingerprint: An artifact verifying a User's action. - /// - canApprove: - /// - canReject: - /// - createdAt: - /// - updatedAt: - /// - failure: - public init( - id: Swift.String, - organizationId: Swift.String, - status: Components.Schemas.ActivityStatus, - _type: Components.Schemas.ActivityType, - intent: Components.Schemas.Intent, - result: Components.Schemas.Result, - votes: [Components.Schemas.Vote], - fingerprint: Swift.String, - canApprove: Swift.Bool, - canReject: Swift.Bool, - createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - failure: Components.Schemas.Status? = nil - ) { - self.id = id - self.organizationId = organizationId - self.status = status - self._type = _type - self.intent = intent - self.result = result - self.votes = votes - self.fingerprint = fingerprint - self.canApprove = canApprove - self.canReject = canReject - self.createdAt = createdAt - self.updatedAt = updatedAt - self.failure = failure - } - public enum CodingKeys: String, CodingKey { - case id - case organizationId - case status - case _type = "type" - case intent - case result - case votes - case fingerprint - case canApprove - case canReject - case createdAt - case updatedAt - case failure - } - } - /// - Remark: Generated from `#/components/schemas/ActivityResponse`. - public struct ActivityResponse: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ActivityResponse/activity`. - public var activity: Components.Schemas.Activity - /// Creates a new `ActivityResponse`. - /// - /// - Parameters: - /// - activity: - public init(activity: Components.Schemas.Activity) { - self.activity = activity - } - public enum CodingKeys: String, CodingKey { - case activity - } - } - /// - Remark: Generated from `#/components/schemas/ActivityStatus`. - @frozen public enum ActivityStatus: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_STATUS_CREATED = "ACTIVITY_STATUS_CREATED" - case ACTIVITY_STATUS_PENDING = "ACTIVITY_STATUS_PENDING" - case ACTIVITY_STATUS_COMPLETED = "ACTIVITY_STATUS_COMPLETED" - case ACTIVITY_STATUS_FAILED = "ACTIVITY_STATUS_FAILED" - case ACTIVITY_STATUS_CONSENSUS_NEEDED = "ACTIVITY_STATUS_CONSENSUS_NEEDED" - case ACTIVITY_STATUS_REJECTED = "ACTIVITY_STATUS_REJECTED" - } - /// - Remark: Generated from `#/components/schemas/ActivityType`. - @frozen public enum ActivityType: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_API_KEYS = "ACTIVITY_TYPE_CREATE_API_KEYS" - case ACTIVITY_TYPE_CREATE_USERS = "ACTIVITY_TYPE_CREATE_USERS" - case ACTIVITY_TYPE_CREATE_PRIVATE_KEYS = "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS" - case ACTIVITY_TYPE_SIGN_RAW_PAYLOAD = "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD" - case ACTIVITY_TYPE_CREATE_INVITATIONS = "ACTIVITY_TYPE_CREATE_INVITATIONS" - case ACTIVITY_TYPE_ACCEPT_INVITATION = "ACTIVITY_TYPE_ACCEPT_INVITATION" - case ACTIVITY_TYPE_CREATE_POLICY = "ACTIVITY_TYPE_CREATE_POLICY" - case ACTIVITY_TYPE_DISABLE_PRIVATE_KEY = "ACTIVITY_TYPE_DISABLE_PRIVATE_KEY" - case ACTIVITY_TYPE_DELETE_USERS = "ACTIVITY_TYPE_DELETE_USERS" - case ACTIVITY_TYPE_DELETE_API_KEYS = "ACTIVITY_TYPE_DELETE_API_KEYS" - case ACTIVITY_TYPE_DELETE_INVITATION = "ACTIVITY_TYPE_DELETE_INVITATION" - case ACTIVITY_TYPE_DELETE_ORGANIZATION = "ACTIVITY_TYPE_DELETE_ORGANIZATION" - case ACTIVITY_TYPE_DELETE_POLICY = "ACTIVITY_TYPE_DELETE_POLICY" - case ACTIVITY_TYPE_CREATE_USER_TAG = "ACTIVITY_TYPE_CREATE_USER_TAG" - case ACTIVITY_TYPE_DELETE_USER_TAGS = "ACTIVITY_TYPE_DELETE_USER_TAGS" - case ACTIVITY_TYPE_CREATE_ORGANIZATION = "ACTIVITY_TYPE_CREATE_ORGANIZATION" - case ACTIVITY_TYPE_SIGN_TRANSACTION = "ACTIVITY_TYPE_SIGN_TRANSACTION" - case ACTIVITY_TYPE_APPROVE_ACTIVITY = "ACTIVITY_TYPE_APPROVE_ACTIVITY" - case ACTIVITY_TYPE_REJECT_ACTIVITY = "ACTIVITY_TYPE_REJECT_ACTIVITY" - case ACTIVITY_TYPE_DELETE_AUTHENTICATORS = "ACTIVITY_TYPE_DELETE_AUTHENTICATORS" - case ACTIVITY_TYPE_CREATE_AUTHENTICATORS = "ACTIVITY_TYPE_CREATE_AUTHENTICATORS" - case ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG = "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG" - case ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS = "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS" - case ACTIVITY_TYPE_SET_PAYMENT_METHOD = "ACTIVITY_TYPE_SET_PAYMENT_METHOD" - case ACTIVITY_TYPE_ACTIVATE_BILLING_TIER = "ACTIVITY_TYPE_ACTIVATE_BILLING_TIER" - case ACTIVITY_TYPE_DELETE_PAYMENT_METHOD = "ACTIVITY_TYPE_DELETE_PAYMENT_METHOD" - case ACTIVITY_TYPE_CREATE_POLICY_V2 = "ACTIVITY_TYPE_CREATE_POLICY_V2" - case ACTIVITY_TYPE_CREATE_POLICY_V3 = "ACTIVITY_TYPE_CREATE_POLICY_V3" - case ACTIVITY_TYPE_CREATE_API_ONLY_USERS = "ACTIVITY_TYPE_CREATE_API_ONLY_USERS" - case ACTIVITY_TYPE_UPDATE_ROOT_QUORUM = "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM" - case ACTIVITY_TYPE_UPDATE_USER_TAG = "ACTIVITY_TYPE_UPDATE_USER_TAG" - case ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG = "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG" - case ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2 = "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2" - case ACTIVITY_TYPE_CREATE_ORGANIZATION_V2 = "ACTIVITY_TYPE_CREATE_ORGANIZATION_V2" - case ACTIVITY_TYPE_CREATE_USERS_V2 = "ACTIVITY_TYPE_CREATE_USERS_V2" - case ACTIVITY_TYPE_ACCEPT_INVITATION_V2 = "ACTIVITY_TYPE_ACCEPT_INVITATION_V2" - case ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION" - case ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2" - case ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS = "ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS" - case ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2 = "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2" - case ACTIVITY_TYPE_UPDATE_USER = "ACTIVITY_TYPE_UPDATE_USER" - case ACTIVITY_TYPE_UPDATE_POLICY = "ACTIVITY_TYPE_UPDATE_POLICY" - case ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2 = "ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2" - case ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3" - case ACTIVITY_TYPE_CREATE_WALLET = "ACTIVITY_TYPE_CREATE_WALLET" - case ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS = "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS" - case ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY = "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY" - case ACTIVITY_TYPE_RECOVER_USER = "ACTIVITY_TYPE_RECOVER_USER" - case ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE = "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE" - case ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE = "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE" - case ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2 = "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2" - case ACTIVITY_TYPE_SIGN_TRANSACTION_V2 = "ACTIVITY_TYPE_SIGN_TRANSACTION_V2" - case ACTIVITY_TYPE_EXPORT_PRIVATE_KEY = "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY" - case ACTIVITY_TYPE_EXPORT_WALLET = "ACTIVITY_TYPE_EXPORT_WALLET" - case ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4" - case ACTIVITY_TYPE_EMAIL_AUTH = "ACTIVITY_TYPE_EMAIL_AUTH" - case ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT = "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT" - case ACTIVITY_TYPE_INIT_IMPORT_WALLET = "ACTIVITY_TYPE_INIT_IMPORT_WALLET" - case ACTIVITY_TYPE_IMPORT_WALLET = "ACTIVITY_TYPE_IMPORT_WALLET" - case ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY = "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY" - case ACTIVITY_TYPE_IMPORT_PRIVATE_KEY = "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY" - case ACTIVITY_TYPE_CREATE_POLICIES = "ACTIVITY_TYPE_CREATE_POLICIES" - case ACTIVITY_TYPE_SIGN_RAW_PAYLOADS = "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS" - case ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION = "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION" - case ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS = "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS" - case ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS = "ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS" - case ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5" - case ACTIVITY_TYPE_OAUTH = "ACTIVITY_TYPE_OAUTH" - case ACTIVITY_TYPE_CREATE_API_KEYS_V2 = "ACTIVITY_TYPE_CREATE_API_KEYS_V2" - case ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION = "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION" - case ACTIVITY_TYPE_EMAIL_AUTH_V2 = "ACTIVITY_TYPE_EMAIL_AUTH_V2" - case ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6" - case ACTIVITY_TYPE_DELETE_PRIVATE_KEYS = "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS" - case ACTIVITY_TYPE_DELETE_WALLETS = "ACTIVITY_TYPE_DELETE_WALLETS" - case ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2 = "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2" - case ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION = "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION" - case ACTIVITY_TYPE_INIT_OTP_AUTH = "ACTIVITY_TYPE_INIT_OTP_AUTH" - case ACTIVITY_TYPE_OTP_AUTH = "ACTIVITY_TYPE_OTP_AUTH" - case ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7" - case ACTIVITY_TYPE_UPDATE_WALLET = "ACTIVITY_TYPE_UPDATE_WALLET" - case ACTIVITY_TYPE_UPDATE_POLICY_V2 = "ACTIVITY_TYPE_UPDATE_POLICY_V2" - case ACTIVITY_TYPE_CREATE_USERS_V3 = "ACTIVITY_TYPE_CREATE_USERS_V3" - case ACTIVITY_TYPE_INIT_OTP_AUTH_V2 = "ACTIVITY_TYPE_INIT_OTP_AUTH_V2" - case ACTIVITY_TYPE_INIT_OTP = "ACTIVITY_TYPE_INIT_OTP" - case ACTIVITY_TYPE_VERIFY_OTP = "ACTIVITY_TYPE_VERIFY_OTP" - case ACTIVITY_TYPE_OTP_LOGIN = "ACTIVITY_TYPE_OTP_LOGIN" - case ACTIVITY_TYPE_STAMP_LOGIN = "ACTIVITY_TYPE_STAMP_LOGIN" - case ACTIVITY_TYPE_OAUTH_LOGIN = "ACTIVITY_TYPE_OAUTH_LOGIN" - case ACTIVITY_TYPE_UPDATE_USER_NAME = "ACTIVITY_TYPE_UPDATE_USER_NAME" - case ACTIVITY_TYPE_UPDATE_USER_EMAIL = "ACTIVITY_TYPE_UPDATE_USER_EMAIL" - case ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER = "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER" - } - /// - Remark: Generated from `#/components/schemas/AddressFormat`. - @frozen public enum AddressFormat: String, Codable, Hashable, Sendable, CaseIterable { - case ADDRESS_FORMAT_UNCOMPRESSED = "ADDRESS_FORMAT_UNCOMPRESSED" - case ADDRESS_FORMAT_COMPRESSED = "ADDRESS_FORMAT_COMPRESSED" - case ADDRESS_FORMAT_ETHEREUM = "ADDRESS_FORMAT_ETHEREUM" - case ADDRESS_FORMAT_SOLANA = "ADDRESS_FORMAT_SOLANA" - case ADDRESS_FORMAT_COSMOS = "ADDRESS_FORMAT_COSMOS" - case ADDRESS_FORMAT_TRON = "ADDRESS_FORMAT_TRON" - case ADDRESS_FORMAT_SUI = "ADDRESS_FORMAT_SUI" - case ADDRESS_FORMAT_APTOS = "ADDRESS_FORMAT_APTOS" - case ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH" - case ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH" - case ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH" - case ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH" - case ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR" - case ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH" - case ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH" - case ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH" - case ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH" - case ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR" - case ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH" - case ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH" - case ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH" - case ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH" - case ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR" - case ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH" - case ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH" - case ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH" - case ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH" - case ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR" - case ADDRESS_FORMAT_SEI = "ADDRESS_FORMAT_SEI" - case ADDRESS_FORMAT_XLM = "ADDRESS_FORMAT_XLM" - case ADDRESS_FORMAT_DOGE_MAINNET = "ADDRESS_FORMAT_DOGE_MAINNET" - case ADDRESS_FORMAT_DOGE_TESTNET = "ADDRESS_FORMAT_DOGE_TESTNET" - case ADDRESS_FORMAT_TON_V3R2 = "ADDRESS_FORMAT_TON_V3R2" - case ADDRESS_FORMAT_TON_V4R2 = "ADDRESS_FORMAT_TON_V4R2" - case ADDRESS_FORMAT_TON_V5R1 = "ADDRESS_FORMAT_TON_V5R1" - case ADDRESS_FORMAT_XRP = "ADDRESS_FORMAT_XRP" - } - /// - Remark: Generated from `#/components/schemas/Any`. - public struct _Any: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Any/@type`. - public var _commat_type: Swift.String? - /// A container of undocumented properties. - public var additionalProperties: [String: OpenAPIRuntime.OpenAPIObjectContainer] - /// Creates a new `_Any`. - /// - /// - Parameters: - /// - _commat_type: - /// - additionalProperties: A container of undocumented properties. - public init( - _commat_type: Swift.String? = nil, - additionalProperties: [String: OpenAPIRuntime.OpenAPIObjectContainer] = .init() - ) { - self._commat_type = _commat_type - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case _commat_type = "@type" - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self._commat_type = try container.decodeIfPresent( - Swift.String.self, - forKey: ._commat_type - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "@type" - ]) - } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self._commat_type, - forKey: ._commat_type - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/components/schemas/ApiKey`. - public struct ApiKey: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ApiKey/credential`. - public var credential: Components.Schemas.external_period_data_period_v1_period_Credential - /// Unique identifier for a given API Key. - /// - /// - Remark: Generated from `#/components/schemas/ApiKey/apiKeyId`. - public var apiKeyId: Swift.String - /// Human-readable name for an API Key. - /// - /// - Remark: Generated from `#/components/schemas/ApiKey/apiKeyName`. - public var apiKeyName: Swift.String - /// - Remark: Generated from `#/components/schemas/ApiKey/createdAt`. - public var createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// - Remark: Generated from `#/components/schemas/ApiKey/updatedAt`. - public var updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// Optional window (in seconds) indicating how long the API Key should last. - /// - /// - Remark: Generated from `#/components/schemas/ApiKey/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Creates a new `ApiKey`. - /// - /// - Parameters: - /// - credential: - /// - apiKeyId: Unique identifier for a given API Key. - /// - apiKeyName: Human-readable name for an API Key. - /// - createdAt: - /// - updatedAt: - /// - expirationSeconds: Optional window (in seconds) indicating how long the API Key should last. - public init( - credential: Components.Schemas.external_period_data_period_v1_period_Credential, - apiKeyId: Swift.String, - apiKeyName: Swift.String, - createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - expirationSeconds: Swift.String? = nil - ) { - self.credential = credential - self.apiKeyId = apiKeyId - self.apiKeyName = apiKeyName - self.createdAt = createdAt - self.updatedAt = updatedAt - self.expirationSeconds = expirationSeconds - } - public enum CodingKeys: String, CodingKey { - case credential - case apiKeyId - case apiKeyName - case createdAt - case updatedAt - case expirationSeconds - } - } - /// - Remark: Generated from `#/components/schemas/ApiKeyCurve`. - @frozen public enum ApiKeyCurve: String, Codable, Hashable, Sendable, CaseIterable { - case API_KEY_CURVE_P256 = "API_KEY_CURVE_P256" - case API_KEY_CURVE_SECP256K1 = "API_KEY_CURVE_SECP256K1" - case API_KEY_CURVE_ED25519 = "API_KEY_CURVE_ED25519" - } - /// - Remark: Generated from `#/components/schemas/ApiKeyParams`. - public struct ApiKeyParams: Codable, Hashable, Sendable { - /// Human-readable name for an API Key. - /// - /// - Remark: Generated from `#/components/schemas/ApiKeyParams/apiKeyName`. - public var apiKeyName: Swift.String - /// The public component of a cryptographic key pair used to sign messages and transactions. - /// - /// - Remark: Generated from `#/components/schemas/ApiKeyParams/publicKey`. - public var publicKey: Swift.String - /// Optional window (in seconds) indicating how long the API Key should last. - /// - /// - Remark: Generated from `#/components/schemas/ApiKeyParams/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Creates a new `ApiKeyParams`. - /// - /// - Parameters: - /// - apiKeyName: Human-readable name for an API Key. - /// - publicKey: The public component of a cryptographic key pair used to sign messages and transactions. - /// - expirationSeconds: Optional window (in seconds) indicating how long the API Key should last. - public init( - apiKeyName: Swift.String, - publicKey: Swift.String, - expirationSeconds: Swift.String? = nil - ) { - self.apiKeyName = apiKeyName - self.publicKey = publicKey - self.expirationSeconds = expirationSeconds - } - public enum CodingKeys: String, CodingKey { - case apiKeyName - case publicKey - case expirationSeconds - } - } - /// - Remark: Generated from `#/components/schemas/ApiKeyParamsV2`. - public struct ApiKeyParamsV2: Codable, Hashable, Sendable { - /// Human-readable name for an API Key. - /// - /// - Remark: Generated from `#/components/schemas/ApiKeyParamsV2/apiKeyName`. - public var apiKeyName: Swift.String - /// The public component of a cryptographic key pair used to sign messages and transactions. - /// - /// - Remark: Generated from `#/components/schemas/ApiKeyParamsV2/publicKey`. - public var publicKey: Swift.String - /// - Remark: Generated from `#/components/schemas/ApiKeyParamsV2/curveType`. - public var curveType: Components.Schemas.ApiKeyCurve - /// Optional window (in seconds) indicating how long the API Key should last. - /// - /// - Remark: Generated from `#/components/schemas/ApiKeyParamsV2/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Creates a new `ApiKeyParamsV2`. - /// - /// - Parameters: - /// - apiKeyName: Human-readable name for an API Key. - /// - publicKey: The public component of a cryptographic key pair used to sign messages and transactions. - /// - curveType: - /// - expirationSeconds: Optional window (in seconds) indicating how long the API Key should last. - public init( - apiKeyName: Swift.String, - publicKey: Swift.String, - curveType: Components.Schemas.ApiKeyCurve, - expirationSeconds: Swift.String? = nil - ) { - self.apiKeyName = apiKeyName - self.publicKey = publicKey - self.curveType = curveType - self.expirationSeconds = expirationSeconds - } - public enum CodingKeys: String, CodingKey { - case apiKeyName - case publicKey - case curveType - case expirationSeconds - } - } - /// - Remark: Generated from `#/components/schemas/ApiOnlyUserParams`. - public struct ApiOnlyUserParams: Codable, Hashable, Sendable { - /// The name of the new API-only User. - /// - /// - Remark: Generated from `#/components/schemas/ApiOnlyUserParams/userName`. - public var userName: Swift.String - /// The email address for this API-only User (optional). - /// - /// - Remark: Generated from `#/components/schemas/ApiOnlyUserParams/userEmail`. - public var userEmail: Swift.String? - /// A list of tags assigned to the new API-only User. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/ApiOnlyUserParams/userTags`. - public var userTags: [Swift.String] - /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/ApiOnlyUserParams/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKeyParams] - /// Creates a new `ApiOnlyUserParams`. - /// - /// - Parameters: - /// - userName: The name of the new API-only User. - /// - userEmail: The email address for this API-only User (optional). - /// - userTags: A list of tags assigned to the new API-only User. This field, if not needed, should be an empty array in your request body. - /// - apiKeys: A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - public init( - userName: Swift.String, - userEmail: Swift.String? = nil, - userTags: [Swift.String], - apiKeys: [Components.Schemas.ApiKeyParams] - ) { - self.userName = userName - self.userEmail = userEmail - self.userTags = userTags - self.apiKeys = apiKeys - } - public enum CodingKeys: String, CodingKey { - case userName - case userEmail - case userTags - case apiKeys - } - } - /// - Remark: Generated from `#/components/schemas/ApproveActivityIntent`. - public struct ApproveActivityIntent: Codable, Hashable, Sendable { - /// An artifact verifying a User's action. - /// - /// - Remark: Generated from `#/components/schemas/ApproveActivityIntent/fingerprint`. - public var fingerprint: Swift.String - /// Creates a new `ApproveActivityIntent`. - /// - /// - Parameters: - /// - fingerprint: An artifact verifying a User's action. - public init(fingerprint: Swift.String) { - self.fingerprint = fingerprint - } - public enum CodingKeys: String, CodingKey { - case fingerprint - } - } - /// - Remark: Generated from `#/components/schemas/ApproveActivityRequest`. - public struct ApproveActivityRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ApproveActivityRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_APPROVE_ACTIVITY = "ACTIVITY_TYPE_APPROVE_ACTIVITY" - } - /// - Remark: Generated from `#/components/schemas/ApproveActivityRequest/type`. - public var _type: Components.Schemas.ApproveActivityRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/ApproveActivityRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/ApproveActivityRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/ApproveActivityRequest/parameters`. - public var parameters: Components.Schemas.ApproveActivityIntent - /// Creates a new `ApproveActivityRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.ApproveActivityRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.ApproveActivityIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/Attestation`. - public struct Attestation: Codable, Hashable, Sendable { - /// The cbor encoded then base64 url encoded id of the credential. - /// - /// - Remark: Generated from `#/components/schemas/Attestation/credentialId`. - public var credentialId: Swift.String - /// A base64 url encoded payload containing metadata about the signing context and the challenge. - /// - /// - Remark: Generated from `#/components/schemas/Attestation/clientDataJson`. - public var clientDataJson: Swift.String - /// A base64 url encoded payload containing authenticator data and any attestation the webauthn provider chooses. - /// - /// - Remark: Generated from `#/components/schemas/Attestation/attestationObject`. - public var attestationObject: Swift.String - /// The type of authenticator transports. - /// - /// - Remark: Generated from `#/components/schemas/Attestation/transports`. - public var transports: [Components.Schemas.AuthenticatorTransport] - /// Creates a new `Attestation`. - /// - /// - Parameters: - /// - credentialId: The cbor encoded then base64 url encoded id of the credential. - /// - clientDataJson: A base64 url encoded payload containing metadata about the signing context and the challenge. - /// - attestationObject: A base64 url encoded payload containing authenticator data and any attestation the webauthn provider chooses. - /// - transports: The type of authenticator transports. - public init( - credentialId: Swift.String, - clientDataJson: Swift.String, - attestationObject: Swift.String, - transports: [Components.Schemas.AuthenticatorTransport] - ) { - self.credentialId = credentialId - self.clientDataJson = clientDataJson - self.attestationObject = attestationObject - self.transports = transports - } - public enum CodingKeys: String, CodingKey { - case credentialId - case clientDataJson - case attestationObject - case transports - } - } - /// - Remark: Generated from `#/components/schemas/Authenticator`. - public struct Authenticator: Codable, Hashable, Sendable { - /// Types of transports that may be used by an Authenticator (e.g., USB, NFC, BLE). - /// - /// - Remark: Generated from `#/components/schemas/Authenticator/transports`. - public var transports: [Components.Schemas.AuthenticatorTransport] - /// - Remark: Generated from `#/components/schemas/Authenticator/attestationType`. - public var attestationType: Swift.String - /// Identifier indicating the type of the Security Key. - /// - /// - Remark: Generated from `#/components/schemas/Authenticator/aaguid`. - public var aaguid: Swift.String - /// Unique identifier for a WebAuthn credential. - /// - /// - Remark: Generated from `#/components/schemas/Authenticator/credentialId`. - public var credentialId: Swift.String - /// The type of Authenticator device. - /// - /// - Remark: Generated from `#/components/schemas/Authenticator/model`. - public var model: Swift.String - /// - Remark: Generated from `#/components/schemas/Authenticator/credential`. - public var credential: Components.Schemas.external_period_data_period_v1_period_Credential - /// Unique identifier for a given Authenticator. - /// - /// - Remark: Generated from `#/components/schemas/Authenticator/authenticatorId`. - public var authenticatorId: Swift.String - /// Human-readable name for an Authenticator. - /// - /// - Remark: Generated from `#/components/schemas/Authenticator/authenticatorName`. - public var authenticatorName: Swift.String - /// - Remark: Generated from `#/components/schemas/Authenticator/createdAt`. - public var createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// - Remark: Generated from `#/components/schemas/Authenticator/updatedAt`. - public var updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// Creates a new `Authenticator`. - /// - /// - Parameters: - /// - transports: Types of transports that may be used by an Authenticator (e.g., USB, NFC, BLE). - /// - attestationType: - /// - aaguid: Identifier indicating the type of the Security Key. - /// - credentialId: Unique identifier for a WebAuthn credential. - /// - model: The type of Authenticator device. - /// - credential: - /// - authenticatorId: Unique identifier for a given Authenticator. - /// - authenticatorName: Human-readable name for an Authenticator. - /// - createdAt: - /// - updatedAt: - public init( - transports: [Components.Schemas.AuthenticatorTransport], - attestationType: Swift.String, - aaguid: Swift.String, - credentialId: Swift.String, - model: Swift.String, - credential: Components.Schemas.external_period_data_period_v1_period_Credential, - authenticatorId: Swift.String, - authenticatorName: Swift.String, - createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - ) { - self.transports = transports - self.attestationType = attestationType - self.aaguid = aaguid - self.credentialId = credentialId - self.model = model - self.credential = credential - self.authenticatorId = authenticatorId - self.authenticatorName = authenticatorName - self.createdAt = createdAt - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case transports - case attestationType - case aaguid - case credentialId - case model - case credential - case authenticatorId - case authenticatorName - case createdAt - case updatedAt - } - } - /// - Remark: Generated from `#/components/schemas/AuthenticatorAttestationResponse`. - public struct AuthenticatorAttestationResponse: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/AuthenticatorAttestationResponse/clientDataJson`. - public var clientDataJson: Swift.String - /// - Remark: Generated from `#/components/schemas/AuthenticatorAttestationResponse/attestationObject`. - public var attestationObject: Swift.String - /// - Remark: Generated from `#/components/schemas/AuthenticatorAttestationResponse/transports`. - public var transports: [Components.Schemas.AuthenticatorTransport]? - /// - Remark: Generated from `#/components/schemas/AuthenticatorAttestationResponse/authenticatorAttachment`. - @frozen - public enum authenticatorAttachmentPayload: String, Codable, Hashable, Sendable, CaseIterable - { - case cross_hyphen_platform = "cross-platform" - case platform = "platform" - } - /// - Remark: Generated from `#/components/schemas/AuthenticatorAttestationResponse/authenticatorAttachment`. - public var authenticatorAttachment: - Components.Schemas.AuthenticatorAttestationResponse.authenticatorAttachmentPayload? - /// Creates a new `AuthenticatorAttestationResponse`. - /// - /// - Parameters: - /// - clientDataJson: - /// - attestationObject: - /// - transports: - /// - authenticatorAttachment: - public init( - clientDataJson: Swift.String, - attestationObject: Swift.String, - transports: [Components.Schemas.AuthenticatorTransport]? = nil, - authenticatorAttachment: Components.Schemas.AuthenticatorAttestationResponse - .authenticatorAttachmentPayload? = nil - ) { - self.clientDataJson = clientDataJson - self.attestationObject = attestationObject - self.transports = transports - self.authenticatorAttachment = authenticatorAttachment - } - public enum CodingKeys: String, CodingKey { - case clientDataJson - case attestationObject - case transports - case authenticatorAttachment - } - } - /// - Remark: Generated from `#/components/schemas/AuthenticatorParams`. - public struct AuthenticatorParams: Codable, Hashable, Sendable { - /// Human-readable name for an Authenticator. - /// - /// - Remark: Generated from `#/components/schemas/AuthenticatorParams/authenticatorName`. - public var authenticatorName: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/AuthenticatorParams/userId`. - public var userId: Swift.String - /// - Remark: Generated from `#/components/schemas/AuthenticatorParams/attestation`. - public var attestation: Components.Schemas.PublicKeyCredentialWithAttestation - /// Challenge presented for authentication purposes. - /// - /// - Remark: Generated from `#/components/schemas/AuthenticatorParams/challenge`. - public var challenge: Swift.String - /// Creates a new `AuthenticatorParams`. - /// - /// - Parameters: - /// - authenticatorName: Human-readable name for an Authenticator. - /// - userId: Unique identifier for a given User. - /// - attestation: - /// - challenge: Challenge presented for authentication purposes. - public init( - authenticatorName: Swift.String, - userId: Swift.String, - attestation: Components.Schemas.PublicKeyCredentialWithAttestation, - challenge: Swift.String - ) { - self.authenticatorName = authenticatorName - self.userId = userId - self.attestation = attestation - self.challenge = challenge - } - public enum CodingKeys: String, CodingKey { - case authenticatorName - case userId - case attestation - case challenge - } - } - /// - Remark: Generated from `#/components/schemas/AuthenticatorParamsV2`. - public struct AuthenticatorParamsV2: Codable, Hashable, Sendable { - /// Human-readable name for an Authenticator. - /// - /// - Remark: Generated from `#/components/schemas/AuthenticatorParamsV2/authenticatorName`. - public var authenticatorName: Swift.String - /// Challenge presented for authentication purposes. - /// - /// - Remark: Generated from `#/components/schemas/AuthenticatorParamsV2/challenge`. - public var challenge: Swift.String - /// - Remark: Generated from `#/components/schemas/AuthenticatorParamsV2/attestation`. - public var attestation: Components.Schemas.Attestation - /// Creates a new `AuthenticatorParamsV2`. - /// - /// - Parameters: - /// - authenticatorName: Human-readable name for an Authenticator. - /// - challenge: Challenge presented for authentication purposes. - /// - attestation: - public init( - authenticatorName: Swift.String, - challenge: Swift.String, - attestation: Components.Schemas.Attestation - ) { - self.authenticatorName = authenticatorName - self.challenge = challenge - self.attestation = attestation - } - public enum CodingKeys: String, CodingKey { - case authenticatorName - case challenge - case attestation - } - } - /// - Remark: Generated from `#/components/schemas/AuthenticatorTransport`. - @frozen public enum AuthenticatorTransport: String, Codable, Hashable, Sendable, CaseIterable { - case AUTHENTICATOR_TRANSPORT_BLE = "AUTHENTICATOR_TRANSPORT_BLE" - case AUTHENTICATOR_TRANSPORT_INTERNAL = "AUTHENTICATOR_TRANSPORT_INTERNAL" - case AUTHENTICATOR_TRANSPORT_NFC = "AUTHENTICATOR_TRANSPORT_NFC" - case AUTHENTICATOR_TRANSPORT_USB = "AUTHENTICATOR_TRANSPORT_USB" - case AUTHENTICATOR_TRANSPORT_HYBRID = "AUTHENTICATOR_TRANSPORT_HYBRID" - } - /// - Remark: Generated from `#/components/schemas/Config`. - public struct Config: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Config/features`. - public var features: [Components.Schemas.Feature]? - /// - Remark: Generated from `#/components/schemas/Config/quorum`. - public var quorum: Components.Schemas.external_period_data_period_v1_period_Quorum? - /// Creates a new `Config`. - /// - /// - Parameters: - /// - features: - /// - quorum: - public init( - features: [Components.Schemas.Feature]? = nil, - quorum: Components.Schemas.external_period_data_period_v1_period_Quorum? = nil - ) { - self.features = features - self.quorum = quorum - } - public enum CodingKeys: String, CodingKey { - case features - case quorum - } - } - /// - Remark: Generated from `#/components/schemas/CreateApiKeysIntent`. - public struct CreateApiKeysIntent: Codable, Hashable, Sendable { - /// A list of API Keys. - /// - /// - Remark: Generated from `#/components/schemas/CreateApiKeysIntent/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKeyParams] - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/CreateApiKeysIntent/userId`. - public var userId: Swift.String - /// Creates a new `CreateApiKeysIntent`. - /// - /// - Parameters: - /// - apiKeys: A list of API Keys. - /// - userId: Unique identifier for a given User. - public init( - apiKeys: [Components.Schemas.ApiKeyParams], - userId: Swift.String - ) { - self.apiKeys = apiKeys - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case apiKeys - case userId - } - } - /// - Remark: Generated from `#/components/schemas/CreateApiKeysIntentV2`. - public struct CreateApiKeysIntentV2: Codable, Hashable, Sendable { - /// A list of API Keys. - /// - /// - Remark: Generated from `#/components/schemas/CreateApiKeysIntentV2/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKeyParamsV2] - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/CreateApiKeysIntentV2/userId`. - public var userId: Swift.String - /// Creates a new `CreateApiKeysIntentV2`. - /// - /// - Parameters: - /// - apiKeys: A list of API Keys. - /// - userId: Unique identifier for a given User. - public init( - apiKeys: [Components.Schemas.ApiKeyParamsV2], - userId: Swift.String - ) { - self.apiKeys = apiKeys - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case apiKeys - case userId - } - } - /// - Remark: Generated from `#/components/schemas/CreateApiKeysRequest`. - public struct CreateApiKeysRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateApiKeysRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_API_KEYS_V2 = "ACTIVITY_TYPE_CREATE_API_KEYS_V2" - } - /// - Remark: Generated from `#/components/schemas/CreateApiKeysRequest/type`. - public var _type: Components.Schemas.CreateApiKeysRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreateApiKeysRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateApiKeysRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateApiKeysRequest/parameters`. - public var parameters: Components.Schemas.CreateApiKeysIntentV2 - /// Creates a new `CreateApiKeysRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreateApiKeysRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreateApiKeysIntentV2 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreateApiKeysResult`. - public struct CreateApiKeysResult: Codable, Hashable, Sendable { - /// A list of API Key IDs. - /// - /// - Remark: Generated from `#/components/schemas/CreateApiKeysResult/apiKeyIds`. - public var apiKeyIds: [Swift.String] - /// Creates a new `CreateApiKeysResult`. - /// - /// - Parameters: - /// - apiKeyIds: A list of API Key IDs. - public init(apiKeyIds: [Swift.String]) { - self.apiKeyIds = apiKeyIds - } - public enum CodingKeys: String, CodingKey { - case apiKeyIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateApiOnlyUsersIntent`. - public struct CreateApiOnlyUsersIntent: Codable, Hashable, Sendable { - /// A list of API-only Users to create. - /// - /// - Remark: Generated from `#/components/schemas/CreateApiOnlyUsersIntent/apiOnlyUsers`. - public var apiOnlyUsers: [Components.Schemas.ApiOnlyUserParams] - /// Creates a new `CreateApiOnlyUsersIntent`. - /// - /// - Parameters: - /// - apiOnlyUsers: A list of API-only Users to create. - public init(apiOnlyUsers: [Components.Schemas.ApiOnlyUserParams]) { - self.apiOnlyUsers = apiOnlyUsers - } - public enum CodingKeys: String, CodingKey { - case apiOnlyUsers - } - } - /// - Remark: Generated from `#/components/schemas/CreateApiOnlyUsersResult`. - public struct CreateApiOnlyUsersResult: Codable, Hashable, Sendable { - /// A list of API-only User IDs. - /// - /// - Remark: Generated from `#/components/schemas/CreateApiOnlyUsersResult/userIds`. - public var userIds: [Swift.String] - /// Creates a new `CreateApiOnlyUsersResult`. - /// - /// - Parameters: - /// - userIds: A list of API-only User IDs. - public init(userIds: [Swift.String]) { - self.userIds = userIds - } - public enum CodingKeys: String, CodingKey { - case userIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsIntent`. - public struct CreateAuthenticatorsIntent: Codable, Hashable, Sendable { - /// A list of Authenticators. - /// - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsIntent/authenticators`. - public var authenticators: [Components.Schemas.AuthenticatorParams] - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsIntent/userId`. - public var userId: Swift.String - /// Creates a new `CreateAuthenticatorsIntent`. - /// - /// - Parameters: - /// - authenticators: A list of Authenticators. - /// - userId: Unique identifier for a given User. - public init( - authenticators: [Components.Schemas.AuthenticatorParams], - userId: Swift.String - ) { - self.authenticators = authenticators - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case authenticators - case userId - } - } - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsIntentV2`. - public struct CreateAuthenticatorsIntentV2: Codable, Hashable, Sendable { - /// A list of Authenticators. - /// - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsIntentV2/authenticators`. - public var authenticators: [Components.Schemas.AuthenticatorParamsV2] - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsIntentV2/userId`. - public var userId: Swift.String - /// Creates a new `CreateAuthenticatorsIntentV2`. - /// - /// - Parameters: - /// - authenticators: A list of Authenticators. - /// - userId: Unique identifier for a given User. - public init( - authenticators: [Components.Schemas.AuthenticatorParamsV2], - userId: Swift.String - ) { - self.authenticators = authenticators - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case authenticators - case userId - } - } - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsRequest`. - public struct CreateAuthenticatorsRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2 = "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2" - } - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsRequest/type`. - public var _type: Components.Schemas.CreateAuthenticatorsRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsRequest/parameters`. - public var parameters: Components.Schemas.CreateAuthenticatorsIntentV2 - /// Creates a new `CreateAuthenticatorsRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreateAuthenticatorsRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreateAuthenticatorsIntentV2 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsResult`. - public struct CreateAuthenticatorsResult: Codable, Hashable, Sendable { - /// A list of Authenticator IDs. - /// - /// - Remark: Generated from `#/components/schemas/CreateAuthenticatorsResult/authenticatorIds`. - public var authenticatorIds: [Swift.String] - /// Creates a new `CreateAuthenticatorsResult`. - /// - /// - Parameters: - /// - authenticatorIds: A list of Authenticator IDs. - public init(authenticatorIds: [Swift.String]) { - self.authenticatorIds = authenticatorIds - } - public enum CodingKeys: String, CodingKey { - case authenticatorIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateInvitationsIntent`. - public struct CreateInvitationsIntent: Codable, Hashable, Sendable { - /// A list of Invitations. - /// - /// - Remark: Generated from `#/components/schemas/CreateInvitationsIntent/invitations`. - public var invitations: [Components.Schemas.InvitationParams] - /// Creates a new `CreateInvitationsIntent`. - /// - /// - Parameters: - /// - invitations: A list of Invitations. - public init(invitations: [Components.Schemas.InvitationParams]) { - self.invitations = invitations - } - public enum CodingKeys: String, CodingKey { - case invitations - } - } - /// - Remark: Generated from `#/components/schemas/CreateInvitationsRequest`. - public struct CreateInvitationsRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateInvitationsRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_INVITATIONS = "ACTIVITY_TYPE_CREATE_INVITATIONS" - } - /// - Remark: Generated from `#/components/schemas/CreateInvitationsRequest/type`. - public var _type: Components.Schemas.CreateInvitationsRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreateInvitationsRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateInvitationsRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateInvitationsRequest/parameters`. - public var parameters: Components.Schemas.CreateInvitationsIntent - /// Creates a new `CreateInvitationsRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreateInvitationsRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreateInvitationsIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreateInvitationsResult`. - public struct CreateInvitationsResult: Codable, Hashable, Sendable { - /// A list of Invitation IDs - /// - /// - Remark: Generated from `#/components/schemas/CreateInvitationsResult/invitationIds`. - public var invitationIds: [Swift.String] - /// Creates a new `CreateInvitationsResult`. - /// - /// - Parameters: - /// - invitationIds: A list of Invitation IDs - public init(invitationIds: [Swift.String]) { - self.invitationIds = invitationIds - } - public enum CodingKeys: String, CodingKey { - case invitationIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateOauthProvidersIntent`. - public struct CreateOauthProvidersIntent: Codable, Hashable, Sendable { - /// The ID of the User to add an Oauth provider to - /// - /// - Remark: Generated from `#/components/schemas/CreateOauthProvidersIntent/userId`. - public var userId: Swift.String - /// A list of Oauth providers. - /// - /// - Remark: Generated from `#/components/schemas/CreateOauthProvidersIntent/oauthProviders`. - public var oauthProviders: [Components.Schemas.OauthProviderParams] - /// Creates a new `CreateOauthProvidersIntent`. - /// - /// - Parameters: - /// - userId: The ID of the User to add an Oauth provider to - /// - oauthProviders: A list of Oauth providers. - public init( - userId: Swift.String, - oauthProviders: [Components.Schemas.OauthProviderParams] - ) { - self.userId = userId - self.oauthProviders = oauthProviders - } - public enum CodingKeys: String, CodingKey { - case userId - case oauthProviders - } - } - /// - Remark: Generated from `#/components/schemas/CreateOauthProvidersRequest`. - public struct CreateOauthProvidersRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateOauthProvidersRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS = "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS" - } - /// - Remark: Generated from `#/components/schemas/CreateOauthProvidersRequest/type`. - public var _type: Components.Schemas.CreateOauthProvidersRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreateOauthProvidersRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateOauthProvidersRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateOauthProvidersRequest/parameters`. - public var parameters: Components.Schemas.CreateOauthProvidersIntent - /// Creates a new `CreateOauthProvidersRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreateOauthProvidersRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreateOauthProvidersIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreateOauthProvidersResult`. - public struct CreateOauthProvidersResult: Codable, Hashable, Sendable { - /// A list of unique identifiers for Oauth Providers - /// - /// - Remark: Generated from `#/components/schemas/CreateOauthProvidersResult/providerIds`. - public var providerIds: [Swift.String] - /// Creates a new `CreateOauthProvidersResult`. - /// - /// - Parameters: - /// - providerIds: A list of unique identifiers for Oauth Providers - public init(providerIds: [Swift.String]) { - self.providerIds = providerIds - } - public enum CodingKeys: String, CodingKey { - case providerIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateOrganizationIntent`. - public struct CreateOrganizationIntent: Codable, Hashable, Sendable { - /// Human-readable name for an Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateOrganizationIntent/organizationName`. - public var organizationName: Swift.String - /// The root user's email address. - /// - /// - Remark: Generated from `#/components/schemas/CreateOrganizationIntent/rootEmail`. - public var rootEmail: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateOrganizationIntent/rootAuthenticator`. - public var rootAuthenticator: Components.Schemas.AuthenticatorParams - /// Unique identifier for the root user object. - /// - /// - Remark: Generated from `#/components/schemas/CreateOrganizationIntent/rootUserId`. - public var rootUserId: Swift.String? - /// Creates a new `CreateOrganizationIntent`. - /// - /// - Parameters: - /// - organizationName: Human-readable name for an Organization. - /// - rootEmail: The root user's email address. - /// - rootAuthenticator: - /// - rootUserId: Unique identifier for the root user object. - public init( - organizationName: Swift.String, - rootEmail: Swift.String, - rootAuthenticator: Components.Schemas.AuthenticatorParams, - rootUserId: Swift.String? = nil - ) { - self.organizationName = organizationName - self.rootEmail = rootEmail - self.rootAuthenticator = rootAuthenticator - self.rootUserId = rootUserId - } - public enum CodingKeys: String, CodingKey { - case organizationName - case rootEmail - case rootAuthenticator - case rootUserId - } - } - /// - Remark: Generated from `#/components/schemas/CreateOrganizationIntentV2`. - public struct CreateOrganizationIntentV2: Codable, Hashable, Sendable { - /// Human-readable name for an Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateOrganizationIntentV2/organizationName`. - public var organizationName: Swift.String - /// The root user's email address. - /// - /// - Remark: Generated from `#/components/schemas/CreateOrganizationIntentV2/rootEmail`. - public var rootEmail: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateOrganizationIntentV2/rootAuthenticator`. - public var rootAuthenticator: Components.Schemas.AuthenticatorParamsV2 - /// Unique identifier for the root user object. - /// - /// - Remark: Generated from `#/components/schemas/CreateOrganizationIntentV2/rootUserId`. - public var rootUserId: Swift.String? - /// Creates a new `CreateOrganizationIntentV2`. - /// - /// - Parameters: - /// - organizationName: Human-readable name for an Organization. - /// - rootEmail: The root user's email address. - /// - rootAuthenticator: - /// - rootUserId: Unique identifier for the root user object. - public init( - organizationName: Swift.String, - rootEmail: Swift.String, - rootAuthenticator: Components.Schemas.AuthenticatorParamsV2, - rootUserId: Swift.String? = nil - ) { - self.organizationName = organizationName - self.rootEmail = rootEmail - self.rootAuthenticator = rootAuthenticator - self.rootUserId = rootUserId - } - public enum CodingKeys: String, CodingKey { - case organizationName - case rootEmail - case rootAuthenticator - case rootUserId - } - } - /// - Remark: Generated from `#/components/schemas/CreateOrganizationResult`. - public struct CreateOrganizationResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateOrganizationResult/organizationId`. - public var organizationId: Swift.String - /// Creates a new `CreateOrganizationResult`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - public init(organizationId: Swift.String) { - self.organizationId = organizationId - } - public enum CodingKeys: String, CodingKey { - case organizationId - } - } - /// - Remark: Generated from `#/components/schemas/CreatePoliciesIntent`. - public struct CreatePoliciesIntent: Codable, Hashable, Sendable { - /// An array of policy intents to be created. - /// - /// - Remark: Generated from `#/components/schemas/CreatePoliciesIntent/policies`. - public var policies: [Components.Schemas.CreatePolicyIntentV3] - /// Creates a new `CreatePoliciesIntent`. - /// - /// - Parameters: - /// - policies: An array of policy intents to be created. - public init(policies: [Components.Schemas.CreatePolicyIntentV3]) { - self.policies = policies - } - public enum CodingKeys: String, CodingKey { - case policies - } - } - /// - Remark: Generated from `#/components/schemas/CreatePoliciesRequest`. - public struct CreatePoliciesRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreatePoliciesRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_POLICIES = "ACTIVITY_TYPE_CREATE_POLICIES" - } - /// - Remark: Generated from `#/components/schemas/CreatePoliciesRequest/type`. - public var _type: Components.Schemas.CreatePoliciesRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreatePoliciesRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreatePoliciesRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreatePoliciesRequest/parameters`. - public var parameters: Components.Schemas.CreatePoliciesIntent - /// Creates a new `CreatePoliciesRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreatePoliciesRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreatePoliciesIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreatePoliciesResult`. - public struct CreatePoliciesResult: Codable, Hashable, Sendable { - /// A list of unique identifiers for the created policies. - /// - /// - Remark: Generated from `#/components/schemas/CreatePoliciesResult/policyIds`. - public var policyIds: [Swift.String] - /// Creates a new `CreatePoliciesResult`. - /// - /// - Parameters: - /// - policyIds: A list of unique identifiers for the created policies. - public init(policyIds: [Swift.String]) { - self.policyIds = policyIds - } - public enum CodingKeys: String, CodingKey { - case policyIds - } - } - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntent`. - public struct CreatePolicyIntent: Codable, Hashable, Sendable { - /// Human-readable name for a Policy. - /// - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntent/policyName`. - public var policyName: Swift.String - /// A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details. - /// - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntent/selectors`. - public var selectors: [Components.Schemas.Selector] - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntent/effect`. - public var effect: Components.Schemas.Effect - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntent/notes`. - public var notes: Swift.String? - /// Creates a new `CreatePolicyIntent`. - /// - /// - Parameters: - /// - policyName: Human-readable name for a Policy. - /// - selectors: A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details. - /// - effect: - /// - notes: - public init( - policyName: Swift.String, - selectors: [Components.Schemas.Selector], - effect: Components.Schemas.Effect, - notes: Swift.String? = nil - ) { - self.policyName = policyName - self.selectors = selectors - self.effect = effect - self.notes = notes - } - public enum CodingKeys: String, CodingKey { - case policyName - case selectors - case effect - case notes - } - } - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntentV2`. - public struct CreatePolicyIntentV2: Codable, Hashable, Sendable { - /// Human-readable name for a Policy. - /// - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntentV2/policyName`. - public var policyName: Swift.String - /// A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details. - /// - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntentV2/selectors`. - public var selectors: [Components.Schemas.SelectorV2] - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntentV2/effect`. - public var effect: Components.Schemas.Effect - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntentV2/notes`. - public var notes: Swift.String? - /// Creates a new `CreatePolicyIntentV2`. - /// - /// - Parameters: - /// - policyName: Human-readable name for a Policy. - /// - selectors: A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details. - /// - effect: - /// - notes: - public init( - policyName: Swift.String, - selectors: [Components.Schemas.SelectorV2], - effect: Components.Schemas.Effect, - notes: Swift.String? = nil - ) { - self.policyName = policyName - self.selectors = selectors - self.effect = effect - self.notes = notes - } - public enum CodingKeys: String, CodingKey { - case policyName - case selectors - case effect - case notes - } - } - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntentV3`. - public struct CreatePolicyIntentV3: Codable, Hashable, Sendable { - /// Human-readable name for a Policy. - /// - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntentV3/policyName`. - public var policyName: Swift.String - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntentV3/effect`. - public var effect: Components.Schemas.Effect - /// The condition expression that triggers the Effect - /// - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntentV3/condition`. - public var condition: Swift.String? - /// The consensus expression that triggers the Effect - /// - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntentV3/consensus`. - public var consensus: Swift.String? - /// - Remark: Generated from `#/components/schemas/CreatePolicyIntentV3/notes`. - public var notes: Swift.String? - /// Creates a new `CreatePolicyIntentV3`. - /// - /// - Parameters: - /// - policyName: Human-readable name for a Policy. - /// - effect: - /// - condition: The condition expression that triggers the Effect - /// - consensus: The consensus expression that triggers the Effect - /// - notes: - public init( - policyName: Swift.String, - effect: Components.Schemas.Effect, - condition: Swift.String? = nil, - consensus: Swift.String? = nil, - notes: Swift.String? = nil - ) { - self.policyName = policyName - self.effect = effect - self.condition = condition - self.consensus = consensus - self.notes = notes - } - public enum CodingKeys: String, CodingKey { - case policyName - case effect - case condition - case consensus - case notes - } - } - /// - Remark: Generated from `#/components/schemas/CreatePolicyRequest`. - public struct CreatePolicyRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreatePolicyRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_POLICY_V3 = "ACTIVITY_TYPE_CREATE_POLICY_V3" - } - /// - Remark: Generated from `#/components/schemas/CreatePolicyRequest/type`. - public var _type: Components.Schemas.CreatePolicyRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreatePolicyRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreatePolicyRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreatePolicyRequest/parameters`. - public var parameters: Components.Schemas.CreatePolicyIntentV3 - /// Creates a new `CreatePolicyRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreatePolicyRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreatePolicyIntentV3 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreatePolicyResult`. - public struct CreatePolicyResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Policy. - /// - /// - Remark: Generated from `#/components/schemas/CreatePolicyResult/policyId`. - public var policyId: Swift.String - /// Creates a new `CreatePolicyResult`. - /// - /// - Parameters: - /// - policyId: Unique identifier for a given Policy. - public init(policyId: Swift.String) { - self.policyId = policyId - } - public enum CodingKeys: String, CodingKey { - case policyId - } - } - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagIntent`. - public struct CreatePrivateKeyTagIntent: Codable, Hashable, Sendable { - /// Human-readable name for a Private Key Tag. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagIntent/privateKeyTagName`. - public var privateKeyTagName: Swift.String - /// A list of Private Key IDs. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagIntent/privateKeyIds`. - public var privateKeyIds: [Swift.String] - /// Creates a new `CreatePrivateKeyTagIntent`. - /// - /// - Parameters: - /// - privateKeyTagName: Human-readable name for a Private Key Tag. - /// - privateKeyIds: A list of Private Key IDs. - public init( - privateKeyTagName: Swift.String, - privateKeyIds: [Swift.String] - ) { - self.privateKeyTagName = privateKeyTagName - self.privateKeyIds = privateKeyIds - } - public enum CodingKeys: String, CodingKey { - case privateKeyTagName - case privateKeyIds - } - } - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagRequest`. - public struct CreatePrivateKeyTagRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG = "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG" - } - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagRequest/type`. - public var _type: Components.Schemas.CreatePrivateKeyTagRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagRequest/parameters`. - public var parameters: Components.Schemas.CreatePrivateKeyTagIntent - /// Creates a new `CreatePrivateKeyTagRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreatePrivateKeyTagRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreatePrivateKeyTagIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagResult`. - public struct CreatePrivateKeyTagResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Private Key Tag. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagResult/privateKeyTagId`. - public var privateKeyTagId: Swift.String - /// A list of Private Key IDs. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeyTagResult/privateKeyIds`. - public var privateKeyIds: [Swift.String] - /// Creates a new `CreatePrivateKeyTagResult`. - /// - /// - Parameters: - /// - privateKeyTagId: Unique identifier for a given Private Key Tag. - /// - privateKeyIds: A list of Private Key IDs. - public init( - privateKeyTagId: Swift.String, - privateKeyIds: [Swift.String] - ) { - self.privateKeyTagId = privateKeyTagId - self.privateKeyIds = privateKeyIds - } - public enum CodingKeys: String, CodingKey { - case privateKeyTagId - case privateKeyIds - } - } - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysIntent`. - public struct CreatePrivateKeysIntent: Codable, Hashable, Sendable { - /// A list of Private Keys. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysIntent/privateKeys`. - public var privateKeys: [Components.Schemas.PrivateKeyParams] - /// Creates a new `CreatePrivateKeysIntent`. - /// - /// - Parameters: - /// - privateKeys: A list of Private Keys. - public init(privateKeys: [Components.Schemas.PrivateKeyParams]) { - self.privateKeys = privateKeys - } - public enum CodingKeys: String, CodingKey { - case privateKeys - } - } - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysIntentV2`. - public struct CreatePrivateKeysIntentV2: Codable, Hashable, Sendable { - /// A list of Private Keys. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysIntentV2/privateKeys`. - public var privateKeys: [Components.Schemas.PrivateKeyParams] - /// Creates a new `CreatePrivateKeysIntentV2`. - /// - /// - Parameters: - /// - privateKeys: A list of Private Keys. - public init(privateKeys: [Components.Schemas.PrivateKeyParams]) { - self.privateKeys = privateKeys - } - public enum CodingKeys: String, CodingKey { - case privateKeys - } - } - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysRequest`. - public struct CreatePrivateKeysRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2 = "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2" - } - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysRequest/type`. - public var _type: Components.Schemas.CreatePrivateKeysRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysRequest/parameters`. - public var parameters: Components.Schemas.CreatePrivateKeysIntentV2 - /// Creates a new `CreatePrivateKeysRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreatePrivateKeysRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreatePrivateKeysIntentV2 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysResult`. - public struct CreatePrivateKeysResult: Codable, Hashable, Sendable { - /// A list of Private Key IDs. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysResult/privateKeyIds`. - public var privateKeyIds: [Swift.String] - /// Creates a new `CreatePrivateKeysResult`. - /// - /// - Parameters: - /// - privateKeyIds: A list of Private Key IDs. - public init(privateKeyIds: [Swift.String]) { - self.privateKeyIds = privateKeyIds - } - public enum CodingKeys: String, CodingKey { - case privateKeyIds - } - } - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysResultV2`. - public struct CreatePrivateKeysResultV2: Codable, Hashable, Sendable { - /// A list of Private Key IDs and addresses. - /// - /// - Remark: Generated from `#/components/schemas/CreatePrivateKeysResultV2/privateKeys`. - public var privateKeys: [Components.Schemas.PrivateKeyResult] - /// Creates a new `CreatePrivateKeysResultV2`. - /// - /// - Parameters: - /// - privateKeys: A list of Private Key IDs and addresses. - public init(privateKeys: [Components.Schemas.PrivateKeyResult]) { - self.privateKeys = privateKeys - } - public enum CodingKeys: String, CodingKey { - case privateKeys - } - } - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionIntent`. - public typealias CreateReadOnlySessionIntent = OpenAPIRuntime.OpenAPIObjectContainer - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionRequest`. - public struct CreateReadOnlySessionRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION = "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION" - } - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionRequest/type`. - public var _type: Components.Schemas.CreateReadOnlySessionRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionRequest/parameters`. - public var parameters: Components.Schemas.CreateReadOnlySessionIntent - /// Creates a new `CreateReadOnlySessionRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreateReadOnlySessionRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreateReadOnlySessionIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionResult`. - public struct CreateReadOnlySessionResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionResult/organizationId`. - public var organizationId: Swift.String - /// Human-readable name for an Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionResult/organizationName`. - public var organizationName: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionResult/userId`. - public var userId: Swift.String - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionResult/username`. - public var username: Swift.String - /// String representing a read only session - /// - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionResult/session`. - public var session: Swift.String - /// UTC timestamp in seconds representing the expiry time for the read only session. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadOnlySessionResult/sessionExpiry`. - public var sessionExpiry: Swift.String - /// Creates a new `CreateReadOnlySessionResult`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. - /// - organizationName: Human-readable name for an Organization. - /// - userId: Unique identifier for a given User. - /// - username: Human-readable name for a User. - /// - session: String representing a read only session - /// - sessionExpiry: UTC timestamp in seconds representing the expiry time for the read only session. - public init( - organizationId: Swift.String, - organizationName: Swift.String, - userId: Swift.String, - username: Swift.String, - session: Swift.String, - sessionExpiry: Swift.String - ) { - self.organizationId = organizationId - self.organizationName = organizationName - self.userId = userId - self.username = username - self.session = session - self.sessionExpiry = sessionExpiry - } - public enum CodingKeys: String, CodingKey { - case organizationId - case organizationName - case userId - case username - case session - case sessionExpiry - } - } - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionIntent`. - public struct CreateReadWriteSessionIntent: Codable, Hashable, Sendable { - /// Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionIntent/targetPublicKey`. - public var targetPublicKey: Swift.String - /// Email of the user to create a read write session for - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionIntent/email`. - public var email: Swift.String - /// Optional human-readable name for an API Key. If none provided, default to Read Write Session - - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionIntent/apiKeyName`. - public var apiKeyName: Swift.String? - /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionIntent/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Creates a new `CreateReadWriteSessionIntent`. - /// - /// - Parameters: - /// - targetPublicKey: Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted. - /// - email: Email of the user to create a read write session for - /// - apiKeyName: Optional human-readable name for an API Key. If none provided, default to Read Write Session - - /// - expirationSeconds: Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - public init( - targetPublicKey: Swift.String, - email: Swift.String, - apiKeyName: Swift.String? = nil, - expirationSeconds: Swift.String? = nil - ) { - self.targetPublicKey = targetPublicKey - self.email = email - self.apiKeyName = apiKeyName - self.expirationSeconds = expirationSeconds - } - public enum CodingKeys: String, CodingKey { - case targetPublicKey - case email - case apiKeyName - case expirationSeconds - } - } - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionIntentV2`. - public struct CreateReadWriteSessionIntentV2: Codable, Hashable, Sendable { - /// Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionIntentV2/targetPublicKey`. - public var targetPublicKey: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionIntentV2/userId`. - public var userId: Swift.String? - /// Optional human-readable name for an API Key. If none provided, default to Read Write Session - - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionIntentV2/apiKeyName`. - public var apiKeyName: Swift.String? - /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionIntentV2/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Invalidate all other previously generated ReadWriteSession API keys - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionIntentV2/invalidateExisting`. - public var invalidateExisting: Swift.Bool? - /// Creates a new `CreateReadWriteSessionIntentV2`. - /// - /// - Parameters: - /// - targetPublicKey: Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted. - /// - userId: Unique identifier for a given User. - /// - apiKeyName: Optional human-readable name for an API Key. If none provided, default to Read Write Session - - /// - expirationSeconds: Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - /// - invalidateExisting: Invalidate all other previously generated ReadWriteSession API keys - public init( - targetPublicKey: Swift.String, - userId: Swift.String? = nil, - apiKeyName: Swift.String? = nil, - expirationSeconds: Swift.String? = nil, - invalidateExisting: Swift.Bool? = nil - ) { - self.targetPublicKey = targetPublicKey - self.userId = userId - self.apiKeyName = apiKeyName - self.expirationSeconds = expirationSeconds - self.invalidateExisting = invalidateExisting - } - public enum CodingKeys: String, CodingKey { - case targetPublicKey - case userId - case apiKeyName - case expirationSeconds - case invalidateExisting - } - } - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionRequest`. - public struct CreateReadWriteSessionRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2 = - "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2" - } - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionRequest/type`. - public var _type: Components.Schemas.CreateReadWriteSessionRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionRequest/parameters`. - public var parameters: Components.Schemas.CreateReadWriteSessionIntentV2 - /// Creates a new `CreateReadWriteSessionRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreateReadWriteSessionRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreateReadWriteSessionIntentV2 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResult`. - public struct CreateReadWriteSessionResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResult/organizationId`. - public var organizationId: Swift.String - /// Human-readable name for an Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResult/organizationName`. - public var organizationName: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResult/userId`. - public var userId: Swift.String - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResult/username`. - public var username: Swift.String - /// Unique identifier for the created API key. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResult/apiKeyId`. - public var apiKeyId: Swift.String - /// HPKE encrypted credential bundle - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResult/credentialBundle`. - public var credentialBundle: Swift.String - /// Creates a new `CreateReadWriteSessionResult`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. - /// - organizationName: Human-readable name for an Organization. - /// - userId: Unique identifier for a given User. - /// - username: Human-readable name for a User. - /// - apiKeyId: Unique identifier for the created API key. - /// - credentialBundle: HPKE encrypted credential bundle - public init( - organizationId: Swift.String, - organizationName: Swift.String, - userId: Swift.String, - username: Swift.String, - apiKeyId: Swift.String, - credentialBundle: Swift.String - ) { - self.organizationId = organizationId - self.organizationName = organizationName - self.userId = userId - self.username = username - self.apiKeyId = apiKeyId - self.credentialBundle = credentialBundle - } - public enum CodingKeys: String, CodingKey { - case organizationId - case organizationName - case userId - case username - case apiKeyId - case credentialBundle - } - } - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResultV2`. - public struct CreateReadWriteSessionResultV2: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResultV2/organizationId`. - public var organizationId: Swift.String - /// Human-readable name for an Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResultV2/organizationName`. - public var organizationName: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResultV2/userId`. - public var userId: Swift.String - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResultV2/username`. - public var username: Swift.String - /// Unique identifier for the created API key. - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResultV2/apiKeyId`. - public var apiKeyId: Swift.String - /// HPKE encrypted credential bundle - /// - /// - Remark: Generated from `#/components/schemas/CreateReadWriteSessionResultV2/credentialBundle`. - public var credentialBundle: Swift.String - /// Creates a new `CreateReadWriteSessionResultV2`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. - /// - organizationName: Human-readable name for an Organization. - /// - userId: Unique identifier for a given User. - /// - username: Human-readable name for a User. - /// - apiKeyId: Unique identifier for the created API key. - /// - credentialBundle: HPKE encrypted credential bundle - public init( - organizationId: Swift.String, - organizationName: Swift.String, - userId: Swift.String, - username: Swift.String, - apiKeyId: Swift.String, - credentialBundle: Swift.String - ) { - self.organizationId = organizationId - self.organizationName = organizationName - self.userId = userId - self.username = username - self.apiKeyId = apiKeyId - self.credentialBundle = credentialBundle - } - public enum CodingKeys: String, CodingKey { - case organizationId - case organizationName - case userId - case username - case apiKeyId - case credentialBundle - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntent`. - public struct CreateSubOrganizationIntent: Codable, Hashable, Sendable { - /// Name for this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntent/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntent/rootAuthenticator`. - public var rootAuthenticator: Components.Schemas.AuthenticatorParamsV2 - /// Creates a new `CreateSubOrganizationIntent`. - /// - /// - Parameters: - /// - name: Name for this sub-organization - /// - rootAuthenticator: - public init( - name: Swift.String, - rootAuthenticator: Components.Schemas.AuthenticatorParamsV2 - ) { - self.name = name - self.rootAuthenticator = rootAuthenticator - } - public enum CodingKeys: String, CodingKey { - case name - case rootAuthenticator - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV2`. - public struct CreateSubOrganizationIntentV2: Codable, Hashable, Sendable { - /// Name for this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV2/subOrganizationName`. - public var subOrganizationName: Swift.String - /// Root users to create within this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV2/rootUsers`. - public var rootUsers: [Components.Schemas.RootUserParams] - /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV2/rootQuorumThreshold`. - public var rootQuorumThreshold: Swift.Int32 - /// Creates a new `CreateSubOrganizationIntentV2`. - /// - /// - Parameters: - /// - subOrganizationName: Name for this sub-organization - /// - rootUsers: Root users to create within this sub-organization - /// - rootQuorumThreshold: The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - public init( - subOrganizationName: Swift.String, - rootUsers: [Components.Schemas.RootUserParams], - rootQuorumThreshold: Swift.Int32 - ) { - self.subOrganizationName = subOrganizationName - self.rootUsers = rootUsers - self.rootQuorumThreshold = rootQuorumThreshold - } - public enum CodingKeys: String, CodingKey { - case subOrganizationName - case rootUsers - case rootQuorumThreshold - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV3`. - public struct CreateSubOrganizationIntentV3: Codable, Hashable, Sendable { - /// Name for this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV3/subOrganizationName`. - public var subOrganizationName: Swift.String - /// Root users to create within this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV3/rootUsers`. - public var rootUsers: [Components.Schemas.RootUserParams] - /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV3/rootQuorumThreshold`. - public var rootQuorumThreshold: Swift.Int32 - /// A list of Private Keys. - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV3/privateKeys`. - public var privateKeys: [Components.Schemas.PrivateKeyParams] - /// Creates a new `CreateSubOrganizationIntentV3`. - /// - /// - Parameters: - /// - subOrganizationName: Name for this sub-organization - /// - rootUsers: Root users to create within this sub-organization - /// - rootQuorumThreshold: The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - /// - privateKeys: A list of Private Keys. - public init( - subOrganizationName: Swift.String, - rootUsers: [Components.Schemas.RootUserParams], - rootQuorumThreshold: Swift.Int32, - privateKeys: [Components.Schemas.PrivateKeyParams] - ) { - self.subOrganizationName = subOrganizationName - self.rootUsers = rootUsers - self.rootQuorumThreshold = rootQuorumThreshold - self.privateKeys = privateKeys - } - public enum CodingKeys: String, CodingKey { - case subOrganizationName - case rootUsers - case rootQuorumThreshold - case privateKeys - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV4`. - public struct CreateSubOrganizationIntentV4: Codable, Hashable, Sendable { - /// Name for this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV4/subOrganizationName`. - public var subOrganizationName: Swift.String - /// Root users to create within this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV4/rootUsers`. - public var rootUsers: [Components.Schemas.RootUserParams] - /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV4/rootQuorumThreshold`. - public var rootQuorumThreshold: Swift.Int32 - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV4/wallet`. - public var wallet: Components.Schemas.WalletParams? - /// Disable email recovery for the sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV4/disableEmailRecovery`. - public var disableEmailRecovery: Swift.Bool? - /// Disable email auth for the sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV4/disableEmailAuth`. - public var disableEmailAuth: Swift.Bool? - /// Creates a new `CreateSubOrganizationIntentV4`. - /// - /// - Parameters: - /// - subOrganizationName: Name for this sub-organization - /// - rootUsers: Root users to create within this sub-organization - /// - rootQuorumThreshold: The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - /// - wallet: - /// - disableEmailRecovery: Disable email recovery for the sub-organization - /// - disableEmailAuth: Disable email auth for the sub-organization - public init( - subOrganizationName: Swift.String, - rootUsers: [Components.Schemas.RootUserParams], - rootQuorumThreshold: Swift.Int32, - wallet: Components.Schemas.WalletParams? = nil, - disableEmailRecovery: Swift.Bool? = nil, - disableEmailAuth: Swift.Bool? = nil - ) { - self.subOrganizationName = subOrganizationName - self.rootUsers = rootUsers - self.rootQuorumThreshold = rootQuorumThreshold - self.wallet = wallet - self.disableEmailRecovery = disableEmailRecovery - self.disableEmailAuth = disableEmailAuth - } - public enum CodingKeys: String, CodingKey { - case subOrganizationName - case rootUsers - case rootQuorumThreshold - case wallet - case disableEmailRecovery - case disableEmailAuth - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV5`. - public struct CreateSubOrganizationIntentV5: Codable, Hashable, Sendable { - /// Name for this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV5/subOrganizationName`. - public var subOrganizationName: Swift.String - /// Root users to create within this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV5/rootUsers`. - public var rootUsers: [Components.Schemas.RootUserParamsV2] - /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV5/rootQuorumThreshold`. - public var rootQuorumThreshold: Swift.Int32 - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV5/wallet`. - public var wallet: Components.Schemas.WalletParams? - /// Disable email recovery for the sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV5/disableEmailRecovery`. - public var disableEmailRecovery: Swift.Bool? - /// Disable email auth for the sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV5/disableEmailAuth`. - public var disableEmailAuth: Swift.Bool? - /// Creates a new `CreateSubOrganizationIntentV5`. - /// - /// - Parameters: - /// - subOrganizationName: Name for this sub-organization - /// - rootUsers: Root users to create within this sub-organization - /// - rootQuorumThreshold: The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - /// - wallet: - /// - disableEmailRecovery: Disable email recovery for the sub-organization - /// - disableEmailAuth: Disable email auth for the sub-organization - public init( - subOrganizationName: Swift.String, - rootUsers: [Components.Schemas.RootUserParamsV2], - rootQuorumThreshold: Swift.Int32, - wallet: Components.Schemas.WalletParams? = nil, - disableEmailRecovery: Swift.Bool? = nil, - disableEmailAuth: Swift.Bool? = nil - ) { - self.subOrganizationName = subOrganizationName - self.rootUsers = rootUsers - self.rootQuorumThreshold = rootQuorumThreshold - self.wallet = wallet - self.disableEmailRecovery = disableEmailRecovery - self.disableEmailAuth = disableEmailAuth - } - public enum CodingKeys: String, CodingKey { - case subOrganizationName - case rootUsers - case rootQuorumThreshold - case wallet - case disableEmailRecovery - case disableEmailAuth - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV6`. - public struct CreateSubOrganizationIntentV6: Codable, Hashable, Sendable { - /// Name for this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV6/subOrganizationName`. - public var subOrganizationName: Swift.String - /// Root users to create within this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV6/rootUsers`. - public var rootUsers: [Components.Schemas.RootUserParamsV3] - /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV6/rootQuorumThreshold`. - public var rootQuorumThreshold: Swift.Int32 - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV6/wallet`. - public var wallet: Components.Schemas.WalletParams? - /// Disable email recovery for the sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV6/disableEmailRecovery`. - public var disableEmailRecovery: Swift.Bool? - /// Disable email auth for the sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV6/disableEmailAuth`. - public var disableEmailAuth: Swift.Bool? - /// Creates a new `CreateSubOrganizationIntentV6`. - /// - /// - Parameters: - /// - subOrganizationName: Name for this sub-organization - /// - rootUsers: Root users to create within this sub-organization - /// - rootQuorumThreshold: The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - /// - wallet: - /// - disableEmailRecovery: Disable email recovery for the sub-organization - /// - disableEmailAuth: Disable email auth for the sub-organization - public init( - subOrganizationName: Swift.String, - rootUsers: [Components.Schemas.RootUserParamsV3], - rootQuorumThreshold: Swift.Int32, - wallet: Components.Schemas.WalletParams? = nil, - disableEmailRecovery: Swift.Bool? = nil, - disableEmailAuth: Swift.Bool? = nil - ) { - self.subOrganizationName = subOrganizationName - self.rootUsers = rootUsers - self.rootQuorumThreshold = rootQuorumThreshold - self.wallet = wallet - self.disableEmailRecovery = disableEmailRecovery - self.disableEmailAuth = disableEmailAuth - } - public enum CodingKeys: String, CodingKey { - case subOrganizationName - case rootUsers - case rootQuorumThreshold - case wallet - case disableEmailRecovery - case disableEmailAuth - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV7`. - public struct CreateSubOrganizationIntentV7: Codable, Hashable, Sendable { - /// Name for this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV7/subOrganizationName`. - public var subOrganizationName: Swift.String - /// Root users to create within this sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV7/rootUsers`. - public var rootUsers: [Components.Schemas.RootUserParamsV4] - /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV7/rootQuorumThreshold`. - public var rootQuorumThreshold: Swift.Int32 - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV7/wallet`. - public var wallet: Components.Schemas.WalletParams? - /// Disable email recovery for the sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV7/disableEmailRecovery`. - public var disableEmailRecovery: Swift.Bool? - /// Disable email auth for the sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV7/disableEmailAuth`. - public var disableEmailAuth: Swift.Bool? - /// Disable OTP SMS auth for the sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV7/disableSmsAuth`. - public var disableSmsAuth: Swift.Bool? - /// Disable OTP email auth for the sub-organization - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationIntentV7/disableOtpEmailAuth`. - public var disableOtpEmailAuth: Swift.Bool? - /// Creates a new `CreateSubOrganizationIntentV7`. - /// - /// - Parameters: - /// - subOrganizationName: Name for this sub-organization - /// - rootUsers: Root users to create within this sub-organization - /// - rootQuorumThreshold: The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users - /// - wallet: - /// - disableEmailRecovery: Disable email recovery for the sub-organization - /// - disableEmailAuth: Disable email auth for the sub-organization - /// - disableSmsAuth: Disable OTP SMS auth for the sub-organization - /// - disableOtpEmailAuth: Disable OTP email auth for the sub-organization - public init( - subOrganizationName: Swift.String, - rootUsers: [Components.Schemas.RootUserParamsV4], - rootQuorumThreshold: Swift.Int32, - wallet: Components.Schemas.WalletParams? = nil, - disableEmailRecovery: Swift.Bool? = nil, - disableEmailAuth: Swift.Bool? = nil, - disableSmsAuth: Swift.Bool? = nil, - disableOtpEmailAuth: Swift.Bool? = nil - ) { - self.subOrganizationName = subOrganizationName - self.rootUsers = rootUsers - self.rootQuorumThreshold = rootQuorumThreshold - self.wallet = wallet - self.disableEmailRecovery = disableEmailRecovery - self.disableEmailAuth = disableEmailAuth - self.disableSmsAuth = disableSmsAuth - self.disableOtpEmailAuth = disableOtpEmailAuth - } - public enum CodingKeys: String, CodingKey { - case subOrganizationName - case rootUsers - case rootQuorumThreshold - case wallet - case disableEmailRecovery - case disableEmailAuth - case disableSmsAuth - case disableOtpEmailAuth - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationRequest`. - public struct CreateSubOrganizationRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7" - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationRequest/type`. - public var _type: Components.Schemas.CreateSubOrganizationRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationRequest/parameters`. - public var parameters: Components.Schemas.CreateSubOrganizationIntentV7 - /// Creates a new `CreateSubOrganizationRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreateSubOrganizationRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreateSubOrganizationIntentV7 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResult`. - public struct CreateSubOrganizationResult: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResult/subOrganizationId`. - public var subOrganizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResult/rootUserIds`. - public var rootUserIds: [Swift.String]? - /// Creates a new `CreateSubOrganizationResult`. - /// - /// - Parameters: - /// - subOrganizationId: - /// - rootUserIds: - public init( - subOrganizationId: Swift.String, - rootUserIds: [Swift.String]? = nil - ) { - self.subOrganizationId = subOrganizationId - self.rootUserIds = rootUserIds - } - public enum CodingKeys: String, CodingKey { - case subOrganizationId - case rootUserIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV3`. - public struct CreateSubOrganizationResultV3: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV3/subOrganizationId`. - public var subOrganizationId: Swift.String - /// A list of Private Key IDs and addresses. - /// - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV3/privateKeys`. - public var privateKeys: [Components.Schemas.PrivateKeyResult] - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV3/rootUserIds`. - public var rootUserIds: [Swift.String]? - /// Creates a new `CreateSubOrganizationResultV3`. - /// - /// - Parameters: - /// - subOrganizationId: - /// - privateKeys: A list of Private Key IDs and addresses. - /// - rootUserIds: - public init( - subOrganizationId: Swift.String, - privateKeys: [Components.Schemas.PrivateKeyResult], - rootUserIds: [Swift.String]? = nil - ) { - self.subOrganizationId = subOrganizationId - self.privateKeys = privateKeys - self.rootUserIds = rootUserIds - } - public enum CodingKeys: String, CodingKey { - case subOrganizationId - case privateKeys - case rootUserIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV4`. - public struct CreateSubOrganizationResultV4: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV4/subOrganizationId`. - public var subOrganizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV4/wallet`. - public var wallet: Components.Schemas.WalletResult? - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV4/rootUserIds`. - public var rootUserIds: [Swift.String]? - /// Creates a new `CreateSubOrganizationResultV4`. - /// - /// - Parameters: - /// - subOrganizationId: - /// - wallet: - /// - rootUserIds: - public init( - subOrganizationId: Swift.String, - wallet: Components.Schemas.WalletResult? = nil, - rootUserIds: [Swift.String]? = nil - ) { - self.subOrganizationId = subOrganizationId - self.wallet = wallet - self.rootUserIds = rootUserIds - } - public enum CodingKeys: String, CodingKey { - case subOrganizationId - case wallet - case rootUserIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV5`. - public struct CreateSubOrganizationResultV5: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV5/subOrganizationId`. - public var subOrganizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV5/wallet`. - public var wallet: Components.Schemas.WalletResult? - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV5/rootUserIds`. - public var rootUserIds: [Swift.String]? - /// Creates a new `CreateSubOrganizationResultV5`. - /// - /// - Parameters: - /// - subOrganizationId: - /// - wallet: - /// - rootUserIds: - public init( - subOrganizationId: Swift.String, - wallet: Components.Schemas.WalletResult? = nil, - rootUserIds: [Swift.String]? = nil - ) { - self.subOrganizationId = subOrganizationId - self.wallet = wallet - self.rootUserIds = rootUserIds - } - public enum CodingKeys: String, CodingKey { - case subOrganizationId - case wallet - case rootUserIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV6`. - public struct CreateSubOrganizationResultV6: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV6/subOrganizationId`. - public var subOrganizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV6/wallet`. - public var wallet: Components.Schemas.WalletResult? - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV6/rootUserIds`. - public var rootUserIds: [Swift.String]? - /// Creates a new `CreateSubOrganizationResultV6`. - /// - /// - Parameters: - /// - subOrganizationId: - /// - wallet: - /// - rootUserIds: - public init( - subOrganizationId: Swift.String, - wallet: Components.Schemas.WalletResult? = nil, - rootUserIds: [Swift.String]? = nil - ) { - self.subOrganizationId = subOrganizationId - self.wallet = wallet - self.rootUserIds = rootUserIds - } - public enum CodingKeys: String, CodingKey { - case subOrganizationId - case wallet - case rootUserIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV7`. - public struct CreateSubOrganizationResultV7: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV7/subOrganizationId`. - public var subOrganizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV7/wallet`. - public var wallet: Components.Schemas.WalletResult? - /// - Remark: Generated from `#/components/schemas/CreateSubOrganizationResultV7/rootUserIds`. - public var rootUserIds: [Swift.String]? - /// Creates a new `CreateSubOrganizationResultV7`. - /// - /// - Parameters: - /// - subOrganizationId: - /// - wallet: - /// - rootUserIds: - public init( - subOrganizationId: Swift.String, - wallet: Components.Schemas.WalletResult? = nil, - rootUserIds: [Swift.String]? = nil - ) { - self.subOrganizationId = subOrganizationId - self.wallet = wallet - self.rootUserIds = rootUserIds - } - public enum CodingKeys: String, CodingKey { - case subOrganizationId - case wallet - case rootUserIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateUserTagIntent`. - public struct CreateUserTagIntent: Codable, Hashable, Sendable { - /// Human-readable name for a User Tag. - /// - /// - Remark: Generated from `#/components/schemas/CreateUserTagIntent/userTagName`. - public var userTagName: Swift.String - /// A list of User IDs. - /// - /// - Remark: Generated from `#/components/schemas/CreateUserTagIntent/userIds`. - public var userIds: [Swift.String] - /// Creates a new `CreateUserTagIntent`. - /// - /// - Parameters: - /// - userTagName: Human-readable name for a User Tag. - /// - userIds: A list of User IDs. - public init( - userTagName: Swift.String, - userIds: [Swift.String] - ) { - self.userTagName = userTagName - self.userIds = userIds - } - public enum CodingKeys: String, CodingKey { - case userTagName - case userIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateUserTagRequest`. - public struct CreateUserTagRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateUserTagRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_USER_TAG = "ACTIVITY_TYPE_CREATE_USER_TAG" - } - /// - Remark: Generated from `#/components/schemas/CreateUserTagRequest/type`. - public var _type: Components.Schemas.CreateUserTagRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreateUserTagRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateUserTagRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateUserTagRequest/parameters`. - public var parameters: Components.Schemas.CreateUserTagIntent - /// Creates a new `CreateUserTagRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreateUserTagRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreateUserTagIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreateUserTagResult`. - public struct CreateUserTagResult: Codable, Hashable, Sendable { - /// Unique identifier for a given User Tag. - /// - /// - Remark: Generated from `#/components/schemas/CreateUserTagResult/userTagId`. - public var userTagId: Swift.String - /// A list of User IDs. - /// - /// - Remark: Generated from `#/components/schemas/CreateUserTagResult/userIds`. - public var userIds: [Swift.String] - /// Creates a new `CreateUserTagResult`. - /// - /// - Parameters: - /// - userTagId: Unique identifier for a given User Tag. - /// - userIds: A list of User IDs. - public init( - userTagId: Swift.String, - userIds: [Swift.String] - ) { - self.userTagId = userTagId - self.userIds = userIds - } - public enum CodingKeys: String, CodingKey { - case userTagId - case userIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateUsersIntent`. - public struct CreateUsersIntent: Codable, Hashable, Sendable { - /// A list of Users. - /// - /// - Remark: Generated from `#/components/schemas/CreateUsersIntent/users`. - public var users: [Components.Schemas.UserParams] - /// Creates a new `CreateUsersIntent`. - /// - /// - Parameters: - /// - users: A list of Users. - public init(users: [Components.Schemas.UserParams]) { - self.users = users - } - public enum CodingKeys: String, CodingKey { - case users - } - } - /// - Remark: Generated from `#/components/schemas/CreateUsersIntentV2`. - public struct CreateUsersIntentV2: Codable, Hashable, Sendable { - /// A list of Users. - /// - /// - Remark: Generated from `#/components/schemas/CreateUsersIntentV2/users`. - public var users: [Components.Schemas.UserParamsV2] - /// Creates a new `CreateUsersIntentV2`. - /// - /// - Parameters: - /// - users: A list of Users. - public init(users: [Components.Schemas.UserParamsV2]) { - self.users = users - } - public enum CodingKeys: String, CodingKey { - case users - } - } - /// - Remark: Generated from `#/components/schemas/CreateUsersIntentV3`. - public struct CreateUsersIntentV3: Codable, Hashable, Sendable { - /// A list of Users. - /// - /// - Remark: Generated from `#/components/schemas/CreateUsersIntentV3/users`. - public var users: [Components.Schemas.UserParamsV3] - /// Creates a new `CreateUsersIntentV3`. - /// - /// - Parameters: - /// - users: A list of Users. - public init(users: [Components.Schemas.UserParamsV3]) { - self.users = users - } - public enum CodingKeys: String, CodingKey { - case users - } - } - /// - Remark: Generated from `#/components/schemas/CreateUsersRequest`. - public struct CreateUsersRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateUsersRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_USERS_V3 = "ACTIVITY_TYPE_CREATE_USERS_V3" - } - /// - Remark: Generated from `#/components/schemas/CreateUsersRequest/type`. - public var _type: Components.Schemas.CreateUsersRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreateUsersRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateUsersRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateUsersRequest/parameters`. - public var parameters: Components.Schemas.CreateUsersIntentV3 - /// Creates a new `CreateUsersRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreateUsersRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreateUsersIntentV3 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreateUsersResult`. - public struct CreateUsersResult: Codable, Hashable, Sendable { - /// A list of User IDs. - /// - /// - Remark: Generated from `#/components/schemas/CreateUsersResult/userIds`. - public var userIds: [Swift.String] - /// Creates a new `CreateUsersResult`. - /// - /// - Parameters: - /// - userIds: A list of User IDs. - public init(userIds: [Swift.String]) { - self.userIds = userIds - } - public enum CodingKeys: String, CodingKey { - case userIds - } - } - /// - Remark: Generated from `#/components/schemas/CreateWalletAccountsIntent`. - public struct CreateWalletAccountsIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Wallet. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletAccountsIntent/walletId`. - public var walletId: Swift.String - /// A list of wallet Accounts. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletAccountsIntent/accounts`. - public var accounts: [Components.Schemas.WalletAccountParams] - /// Creates a new `CreateWalletAccountsIntent`. - /// - /// - Parameters: - /// - walletId: Unique identifier for a given Wallet. - /// - accounts: A list of wallet Accounts. - public init( - walletId: Swift.String, - accounts: [Components.Schemas.WalletAccountParams] - ) { - self.walletId = walletId - self.accounts = accounts - } - public enum CodingKeys: String, CodingKey { - case walletId - case accounts - } - } - /// - Remark: Generated from `#/components/schemas/CreateWalletAccountsRequest`. - public struct CreateWalletAccountsRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateWalletAccountsRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS = "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS" - } - /// - Remark: Generated from `#/components/schemas/CreateWalletAccountsRequest/type`. - public var _type: Components.Schemas.CreateWalletAccountsRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletAccountsRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletAccountsRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateWalletAccountsRequest/parameters`. - public var parameters: Components.Schemas.CreateWalletAccountsIntent - /// Creates a new `CreateWalletAccountsRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreateWalletAccountsRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreateWalletAccountsIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreateWalletAccountsResult`. - public struct CreateWalletAccountsResult: Codable, Hashable, Sendable { - /// A list of derived addresses. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletAccountsResult/addresses`. - public var addresses: [Swift.String] - /// Creates a new `CreateWalletAccountsResult`. - /// - /// - Parameters: - /// - addresses: A list of derived addresses. - public init(addresses: [Swift.String]) { - self.addresses = addresses - } - public enum CodingKeys: String, CodingKey { - case addresses - } - } - /// - Remark: Generated from `#/components/schemas/CreateWalletIntent`. - public struct CreateWalletIntent: Codable, Hashable, Sendable { - /// Human-readable name for a Wallet. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletIntent/walletName`. - public var walletName: Swift.String - /// A list of wallet Accounts. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletIntent/accounts`. - public var accounts: [Components.Schemas.WalletAccountParams] - /// Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletIntent/mnemonicLength`. - public var mnemonicLength: Swift.Int32? - /// Creates a new `CreateWalletIntent`. - /// - /// - Parameters: - /// - walletName: Human-readable name for a Wallet. - /// - accounts: A list of wallet Accounts. This field, if not needed, should be an empty array in your request body. - /// - mnemonicLength: Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24. - public init( - walletName: Swift.String, - accounts: [Components.Schemas.WalletAccountParams], - mnemonicLength: Swift.Int32? = nil - ) { - self.walletName = walletName - self.accounts = accounts - self.mnemonicLength = mnemonicLength - } - public enum CodingKeys: String, CodingKey { - case walletName - case accounts - case mnemonicLength - } - } - /// - Remark: Generated from `#/components/schemas/CreateWalletRequest`. - public struct CreateWalletRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CreateWalletRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_CREATE_WALLET = "ACTIVITY_TYPE_CREATE_WALLET" - } - /// - Remark: Generated from `#/components/schemas/CreateWalletRequest/type`. - public var _type: Components.Schemas.CreateWalletRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/CreateWalletRequest/parameters`. - public var parameters: Components.Schemas.CreateWalletIntent - /// Creates a new `CreateWalletRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.CreateWalletRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.CreateWalletIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/CreateWalletResult`. - public struct CreateWalletResult: Codable, Hashable, Sendable { - /// Unique identifier for a Wallet. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletResult/walletId`. - public var walletId: Swift.String - /// A list of account addresses. - /// - /// - Remark: Generated from `#/components/schemas/CreateWalletResult/addresses`. - public var addresses: [Swift.String] - /// Creates a new `CreateWalletResult`. - /// - /// - Parameters: - /// - walletId: Unique identifier for a Wallet. - /// - addresses: A list of account addresses. - public init( - walletId: Swift.String, - addresses: [Swift.String] - ) { - self.walletId = walletId - self.addresses = addresses - } - public enum CodingKeys: String, CodingKey { - case walletId - case addresses - } - } - /// - Remark: Generated from `#/components/schemas/CredPropsAuthenticationExtensionsClientOutputs`. - public struct CredPropsAuthenticationExtensionsClientOutputs: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/CredPropsAuthenticationExtensionsClientOutputs/rk`. - public var rk: Swift.Bool - /// Creates a new `CredPropsAuthenticationExtensionsClientOutputs`. - /// - /// - Parameters: - /// - rk: - public init(rk: Swift.Bool) { - self.rk = rk - } - public enum CodingKeys: String, CodingKey { - case rk - } - } - /// - Remark: Generated from `#/components/schemas/CredentialType`. - @frozen public enum CredentialType: String, Codable, Hashable, Sendable, CaseIterable { - case CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR = "CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR" - case CREDENTIAL_TYPE_API_KEY_P256 = "CREDENTIAL_TYPE_API_KEY_P256" - case CREDENTIAL_TYPE_RECOVER_USER_KEY_P256 = "CREDENTIAL_TYPE_RECOVER_USER_KEY_P256" - case CREDENTIAL_TYPE_API_KEY_SECP256K1 = "CREDENTIAL_TYPE_API_KEY_SECP256K1" - case CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256 = "CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256" - case CREDENTIAL_TYPE_API_KEY_ED25519 = "CREDENTIAL_TYPE_API_KEY_ED25519" - case CREDENTIAL_TYPE_OTP_AUTH_KEY_P256 = "CREDENTIAL_TYPE_OTP_AUTH_KEY_P256" - case CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256 = - "CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256" - case CREDENTIAL_TYPE_OAUTH_KEY_P256 = "CREDENTIAL_TYPE_OAUTH_KEY_P256" - case CREDENTIAL_TYPE_LOGIN = "CREDENTIAL_TYPE_LOGIN" - } - /// - Remark: Generated from `#/components/schemas/Curve`. - @frozen public enum Curve: String, Codable, Hashable, Sendable, CaseIterable { - case CURVE_SECP256K1 = "CURVE_SECP256K1" - case CURVE_ED25519 = "CURVE_ED25519" - } - /// - Remark: Generated from `#/components/schemas/DeleteApiKeysIntent`. - public struct DeleteApiKeysIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/DeleteApiKeysIntent/userId`. - public var userId: Swift.String - /// A list of API Key IDs. - /// - /// - Remark: Generated from `#/components/schemas/DeleteApiKeysIntent/apiKeyIds`. - public var apiKeyIds: [Swift.String] - /// Creates a new `DeleteApiKeysIntent`. - /// - /// - Parameters: - /// - userId: Unique identifier for a given User. - /// - apiKeyIds: A list of API Key IDs. - public init( - userId: Swift.String, - apiKeyIds: [Swift.String] - ) { - self.userId = userId - self.apiKeyIds = apiKeyIds - } - public enum CodingKeys: String, CodingKey { - case userId - case apiKeyIds - } - } - /// - Remark: Generated from `#/components/schemas/DeleteApiKeysRequest`. - public struct DeleteApiKeysRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/DeleteApiKeysRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_DELETE_API_KEYS = "ACTIVITY_TYPE_DELETE_API_KEYS" - } - /// - Remark: Generated from `#/components/schemas/DeleteApiKeysRequest/type`. - public var _type: Components.Schemas.DeleteApiKeysRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/DeleteApiKeysRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeleteApiKeysRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/DeleteApiKeysRequest/parameters`. - public var parameters: Components.Schemas.DeleteApiKeysIntent - /// Creates a new `DeleteApiKeysRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.DeleteApiKeysRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.DeleteApiKeysIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/DeleteApiKeysResult`. - public struct DeleteApiKeysResult: Codable, Hashable, Sendable { - /// A list of API Key IDs. - /// - /// - Remark: Generated from `#/components/schemas/DeleteApiKeysResult/apiKeyIds`. - public var apiKeyIds: [Swift.String] - /// Creates a new `DeleteApiKeysResult`. - /// - /// - Parameters: - /// - apiKeyIds: A list of API Key IDs. - public init(apiKeyIds: [Swift.String]) { - self.apiKeyIds = apiKeyIds - } - public enum CodingKeys: String, CodingKey { - case apiKeyIds - } - } - /// - Remark: Generated from `#/components/schemas/DeleteAuthenticatorsIntent`. - public struct DeleteAuthenticatorsIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/DeleteAuthenticatorsIntent/userId`. - public var userId: Swift.String - /// A list of Authenticator IDs. - /// - /// - Remark: Generated from `#/components/schemas/DeleteAuthenticatorsIntent/authenticatorIds`. - public var authenticatorIds: [Swift.String] - /// Creates a new `DeleteAuthenticatorsIntent`. - /// - /// - Parameters: - /// - userId: Unique identifier for a given User. - /// - authenticatorIds: A list of Authenticator IDs. - public init( - userId: Swift.String, - authenticatorIds: [Swift.String] - ) { - self.userId = userId - self.authenticatorIds = authenticatorIds - } - public enum CodingKeys: String, CodingKey { - case userId - case authenticatorIds - } - } - /// - Remark: Generated from `#/components/schemas/DeleteAuthenticatorsRequest`. - public struct DeleteAuthenticatorsRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/DeleteAuthenticatorsRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_DELETE_AUTHENTICATORS = "ACTIVITY_TYPE_DELETE_AUTHENTICATORS" - } - /// - Remark: Generated from `#/components/schemas/DeleteAuthenticatorsRequest/type`. - public var _type: Components.Schemas.DeleteAuthenticatorsRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/DeleteAuthenticatorsRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeleteAuthenticatorsRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/DeleteAuthenticatorsRequest/parameters`. - public var parameters: Components.Schemas.DeleteAuthenticatorsIntent - /// Creates a new `DeleteAuthenticatorsRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.DeleteAuthenticatorsRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.DeleteAuthenticatorsIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/DeleteAuthenticatorsResult`. - public struct DeleteAuthenticatorsResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Authenticator. - /// - /// - Remark: Generated from `#/components/schemas/DeleteAuthenticatorsResult/authenticatorIds`. - public var authenticatorIds: [Swift.String] - /// Creates a new `DeleteAuthenticatorsResult`. - /// - /// - Parameters: - /// - authenticatorIds: Unique identifier for a given Authenticator. - public init(authenticatorIds: [Swift.String]) { - self.authenticatorIds = authenticatorIds - } - public enum CodingKeys: String, CodingKey { - case authenticatorIds - } - } - /// - Remark: Generated from `#/components/schemas/DeleteInvitationIntent`. - public struct DeleteInvitationIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Invitation object. - /// - /// - Remark: Generated from `#/components/schemas/DeleteInvitationIntent/invitationId`. - public var invitationId: Swift.String - /// Creates a new `DeleteInvitationIntent`. - /// - /// - Parameters: - /// - invitationId: Unique identifier for a given Invitation object. - public init(invitationId: Swift.String) { - self.invitationId = invitationId - } - public enum CodingKeys: String, CodingKey { - case invitationId - } - } - /// - Remark: Generated from `#/components/schemas/DeleteInvitationRequest`. - public struct DeleteInvitationRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/DeleteInvitationRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_DELETE_INVITATION = "ACTIVITY_TYPE_DELETE_INVITATION" - } - /// - Remark: Generated from `#/components/schemas/DeleteInvitationRequest/type`. - public var _type: Components.Schemas.DeleteInvitationRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/DeleteInvitationRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeleteInvitationRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/DeleteInvitationRequest/parameters`. - public var parameters: Components.Schemas.DeleteInvitationIntent - /// Creates a new `DeleteInvitationRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.DeleteInvitationRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.DeleteInvitationIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/DeleteInvitationResult`. - public struct DeleteInvitationResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Invitation. - /// - /// - Remark: Generated from `#/components/schemas/DeleteInvitationResult/invitationId`. - public var invitationId: Swift.String - /// Creates a new `DeleteInvitationResult`. - /// - /// - Parameters: - /// - invitationId: Unique identifier for a given Invitation. - public init(invitationId: Swift.String) { - self.invitationId = invitationId - } - public enum CodingKeys: String, CodingKey { - case invitationId - } - } - /// - Remark: Generated from `#/components/schemas/DeleteOauthProvidersIntent`. - public struct DeleteOauthProvidersIntent: Codable, Hashable, Sendable { - /// The ID of the User to remove an Oauth provider from - /// - /// - Remark: Generated from `#/components/schemas/DeleteOauthProvidersIntent/userId`. - public var userId: Swift.String - /// Unique identifier for a given Provider. - /// - /// - Remark: Generated from `#/components/schemas/DeleteOauthProvidersIntent/providerIds`. - public var providerIds: [Swift.String] - /// Creates a new `DeleteOauthProvidersIntent`. - /// - /// - Parameters: - /// - userId: The ID of the User to remove an Oauth provider from - /// - providerIds: Unique identifier for a given Provider. - public init( - userId: Swift.String, - providerIds: [Swift.String] - ) { - self.userId = userId - self.providerIds = providerIds - } - public enum CodingKeys: String, CodingKey { - case userId - case providerIds - } - } - /// - Remark: Generated from `#/components/schemas/DeleteOauthProvidersRequest`. - public struct DeleteOauthProvidersRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/DeleteOauthProvidersRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS = "ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS" - } - /// - Remark: Generated from `#/components/schemas/DeleteOauthProvidersRequest/type`. - public var _type: Components.Schemas.DeleteOauthProvidersRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/DeleteOauthProvidersRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeleteOauthProvidersRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/DeleteOauthProvidersRequest/parameters`. - public var parameters: Components.Schemas.DeleteOauthProvidersIntent - /// Creates a new `DeleteOauthProvidersRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.DeleteOauthProvidersRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.DeleteOauthProvidersIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/DeleteOauthProvidersResult`. - public struct DeleteOauthProvidersResult: Codable, Hashable, Sendable { - /// A list of unique identifiers for Oauth Providers - /// - /// - Remark: Generated from `#/components/schemas/DeleteOauthProvidersResult/providerIds`. - public var providerIds: [Swift.String] - /// Creates a new `DeleteOauthProvidersResult`. - /// - /// - Parameters: - /// - providerIds: A list of unique identifiers for Oauth Providers - public init(providerIds: [Swift.String]) { - self.providerIds = providerIds - } - public enum CodingKeys: String, CodingKey { - case providerIds - } - } - /// - Remark: Generated from `#/components/schemas/DeleteOrganizationIntent`. - public struct DeleteOrganizationIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeleteOrganizationIntent/organizationId`. - public var organizationId: Swift.String - /// Creates a new `DeleteOrganizationIntent`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - public init(organizationId: Swift.String) { - self.organizationId = organizationId - } - public enum CodingKeys: String, CodingKey { - case organizationId - } - } - /// - Remark: Generated from `#/components/schemas/DeleteOrganizationResult`. - public struct DeleteOrganizationResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeleteOrganizationResult/organizationId`. - public var organizationId: Swift.String - /// Creates a new `DeleteOrganizationResult`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - public init(organizationId: Swift.String) { - self.organizationId = organizationId - } - public enum CodingKeys: String, CodingKey { - case organizationId - } - } - /// - Remark: Generated from `#/components/schemas/DeletePaymentMethodIntent`. - public struct DeletePaymentMethodIntent: Codable, Hashable, Sendable { - /// The payment method that the customer wants to remove. - /// - /// - Remark: Generated from `#/components/schemas/DeletePaymentMethodIntent/paymentMethodId`. - public var paymentMethodId: Swift.String? - /// Creates a new `DeletePaymentMethodIntent`. - /// - /// - Parameters: - /// - paymentMethodId: The payment method that the customer wants to remove. - public init(paymentMethodId: Swift.String? = nil) { - self.paymentMethodId = paymentMethodId - } - public enum CodingKeys: String, CodingKey { - case paymentMethodId - } - } - /// - Remark: Generated from `#/components/schemas/DeletePaymentMethodResult`. - public struct DeletePaymentMethodResult: Codable, Hashable, Sendable { - /// The payment method that was removed. - /// - /// - Remark: Generated from `#/components/schemas/DeletePaymentMethodResult/paymentMethodId`. - public var paymentMethodId: Swift.String - /// Creates a new `DeletePaymentMethodResult`. - /// - /// - Parameters: - /// - paymentMethodId: The payment method that was removed. - public init(paymentMethodId: Swift.String) { - self.paymentMethodId = paymentMethodId - } - public enum CodingKeys: String, CodingKey { - case paymentMethodId - } - } - /// - Remark: Generated from `#/components/schemas/DeletePolicyIntent`. - public struct DeletePolicyIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Policy. - /// - /// - Remark: Generated from `#/components/schemas/DeletePolicyIntent/policyId`. - public var policyId: Swift.String - /// Creates a new `DeletePolicyIntent`. - /// - /// - Parameters: - /// - policyId: Unique identifier for a given Policy. - public init(policyId: Swift.String) { - self.policyId = policyId - } - public enum CodingKeys: String, CodingKey { - case policyId - } - } - /// - Remark: Generated from `#/components/schemas/DeletePolicyRequest`. - public struct DeletePolicyRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/DeletePolicyRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_DELETE_POLICY = "ACTIVITY_TYPE_DELETE_POLICY" - } - /// - Remark: Generated from `#/components/schemas/DeletePolicyRequest/type`. - public var _type: Components.Schemas.DeletePolicyRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/DeletePolicyRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeletePolicyRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/DeletePolicyRequest/parameters`. - public var parameters: Components.Schemas.DeletePolicyIntent - /// Creates a new `DeletePolicyRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.DeletePolicyRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.DeletePolicyIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/DeletePolicyResult`. - public struct DeletePolicyResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Policy. - /// - /// - Remark: Generated from `#/components/schemas/DeletePolicyResult/policyId`. - public var policyId: Swift.String - /// Creates a new `DeletePolicyResult`. - /// - /// - Parameters: - /// - policyId: Unique identifier for a given Policy. - public init(policyId: Swift.String) { - self.policyId = policyId - } - public enum CodingKeys: String, CodingKey { - case policyId - } - } - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeyTagsIntent`. - public struct DeletePrivateKeyTagsIntent: Codable, Hashable, Sendable { - /// A list of Private Key Tag IDs. - /// - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeyTagsIntent/privateKeyTagIds`. - public var privateKeyTagIds: [Swift.String] - /// Creates a new `DeletePrivateKeyTagsIntent`. - /// - /// - Parameters: - /// - privateKeyTagIds: A list of Private Key Tag IDs. - public init(privateKeyTagIds: [Swift.String]) { - self.privateKeyTagIds = privateKeyTagIds - } - public enum CodingKeys: String, CodingKey { - case privateKeyTagIds - } - } - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeyTagsRequest`. - public struct DeletePrivateKeyTagsRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeyTagsRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS = "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS" - } - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeyTagsRequest/type`. - public var _type: Components.Schemas.DeletePrivateKeyTagsRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeyTagsRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeyTagsRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeyTagsRequest/parameters`. - public var parameters: Components.Schemas.DeletePrivateKeyTagsIntent - /// Creates a new `DeletePrivateKeyTagsRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.DeletePrivateKeyTagsRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.DeletePrivateKeyTagsIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeyTagsResult`. - public struct DeletePrivateKeyTagsResult: Codable, Hashable, Sendable { - /// A list of Private Key Tag IDs. - /// - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeyTagsResult/privateKeyTagIds`. - public var privateKeyTagIds: [Swift.String] - /// A list of Private Key IDs. - /// - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeyTagsResult/privateKeyIds`. - public var privateKeyIds: [Swift.String] - /// Creates a new `DeletePrivateKeyTagsResult`. - /// - /// - Parameters: - /// - privateKeyTagIds: A list of Private Key Tag IDs. - /// - privateKeyIds: A list of Private Key IDs. - public init( - privateKeyTagIds: [Swift.String], - privateKeyIds: [Swift.String] - ) { - self.privateKeyTagIds = privateKeyTagIds - self.privateKeyIds = privateKeyIds - } - public enum CodingKeys: String, CodingKey { - case privateKeyTagIds - case privateKeyIds - } - } - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeysIntent`. - public struct DeletePrivateKeysIntent: Codable, Hashable, Sendable { - /// List of unique identifiers for private keys within an organization - /// - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeysIntent/privateKeyIds`. - public var privateKeyIds: [Swift.String] - /// Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored. - /// - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeysIntent/deleteWithoutExport`. - public var deleteWithoutExport: Swift.Bool? - /// Creates a new `DeletePrivateKeysIntent`. - /// - /// - Parameters: - /// - privateKeyIds: List of unique identifiers for private keys within an organization - /// - deleteWithoutExport: Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored. - public init( - privateKeyIds: [Swift.String], - deleteWithoutExport: Swift.Bool? = nil - ) { - self.privateKeyIds = privateKeyIds - self.deleteWithoutExport = deleteWithoutExport - } - public enum CodingKeys: String, CodingKey { - case privateKeyIds - case deleteWithoutExport - } - } - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeysRequest`. - public struct DeletePrivateKeysRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeysRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_DELETE_PRIVATE_KEYS = "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS" - } - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeysRequest/type`. - public var _type: Components.Schemas.DeletePrivateKeysRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeysRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeysRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeysRequest/parameters`. - public var parameters: Components.Schemas.DeletePrivateKeysIntent - /// Creates a new `DeletePrivateKeysRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.DeletePrivateKeysRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.DeletePrivateKeysIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeysResult`. - public struct DeletePrivateKeysResult: Codable, Hashable, Sendable { - /// A list of private key unique identifiers that were removed - /// - /// - Remark: Generated from `#/components/schemas/DeletePrivateKeysResult/privateKeyIds`. - public var privateKeyIds: [Swift.String] - /// Creates a new `DeletePrivateKeysResult`. - /// - /// - Parameters: - /// - privateKeyIds: A list of private key unique identifiers that were removed - public init(privateKeyIds: [Swift.String]) { - self.privateKeyIds = privateKeyIds - } - public enum CodingKeys: String, CodingKey { - case privateKeyIds - } - } - /// - Remark: Generated from `#/components/schemas/DeleteSubOrganizationIntent`. - public struct DeleteSubOrganizationIntent: Codable, Hashable, Sendable { - /// Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false. - /// - /// - Remark: Generated from `#/components/schemas/DeleteSubOrganizationIntent/deleteWithoutExport`. - public var deleteWithoutExport: Swift.Bool? - /// Creates a new `DeleteSubOrganizationIntent`. - /// - /// - Parameters: - /// - deleteWithoutExport: Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false. - public init(deleteWithoutExport: Swift.Bool? = nil) { - self.deleteWithoutExport = deleteWithoutExport - } - public enum CodingKeys: String, CodingKey { - case deleteWithoutExport - } - } - /// - Remark: Generated from `#/components/schemas/DeleteSubOrganizationRequest`. - public struct DeleteSubOrganizationRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/DeleteSubOrganizationRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION = "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION" - } - /// - Remark: Generated from `#/components/schemas/DeleteSubOrganizationRequest/type`. - public var _type: Components.Schemas.DeleteSubOrganizationRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/DeleteSubOrganizationRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeleteSubOrganizationRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/DeleteSubOrganizationRequest/parameters`. - public var parameters: Components.Schemas.DeleteSubOrganizationIntent - /// Creates a new `DeleteSubOrganizationRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.DeleteSubOrganizationRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.DeleteSubOrganizationIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/DeleteSubOrganizationResult`. - public struct DeleteSubOrganizationResult: Codable, Hashable, Sendable { - /// Unique identifier of the sub organization that was removed - /// - /// - Remark: Generated from `#/components/schemas/DeleteSubOrganizationResult/subOrganizationUuid`. - public var subOrganizationUuid: Swift.String - /// Creates a new `DeleteSubOrganizationResult`. - /// - /// - Parameters: - /// - subOrganizationUuid: Unique identifier of the sub organization that was removed - public init(subOrganizationUuid: Swift.String) { - self.subOrganizationUuid = subOrganizationUuid - } - public enum CodingKeys: String, CodingKey { - case subOrganizationUuid - } - } - /// - Remark: Generated from `#/components/schemas/DeleteUserTagsIntent`. - public struct DeleteUserTagsIntent: Codable, Hashable, Sendable { - /// A list of User Tag IDs. - /// - /// - Remark: Generated from `#/components/schemas/DeleteUserTagsIntent/userTagIds`. - public var userTagIds: [Swift.String] - /// Creates a new `DeleteUserTagsIntent`. - /// - /// - Parameters: - /// - userTagIds: A list of User Tag IDs. - public init(userTagIds: [Swift.String]) { - self.userTagIds = userTagIds - } - public enum CodingKeys: String, CodingKey { - case userTagIds - } - } - /// - Remark: Generated from `#/components/schemas/DeleteUserTagsRequest`. - public struct DeleteUserTagsRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/DeleteUserTagsRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_DELETE_USER_TAGS = "ACTIVITY_TYPE_DELETE_USER_TAGS" - } - /// - Remark: Generated from `#/components/schemas/DeleteUserTagsRequest/type`. - public var _type: Components.Schemas.DeleteUserTagsRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/DeleteUserTagsRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeleteUserTagsRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/DeleteUserTagsRequest/parameters`. - public var parameters: Components.Schemas.DeleteUserTagsIntent - /// Creates a new `DeleteUserTagsRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.DeleteUserTagsRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.DeleteUserTagsIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/DeleteUserTagsResult`. - public struct DeleteUserTagsResult: Codable, Hashable, Sendable { - /// A list of User Tag IDs. - /// - /// - Remark: Generated from `#/components/schemas/DeleteUserTagsResult/userTagIds`. - public var userTagIds: [Swift.String] - /// A list of User IDs. - /// - /// - Remark: Generated from `#/components/schemas/DeleteUserTagsResult/userIds`. - public var userIds: [Swift.String] - /// Creates a new `DeleteUserTagsResult`. - /// - /// - Parameters: - /// - userTagIds: A list of User Tag IDs. - /// - userIds: A list of User IDs. - public init( - userTagIds: [Swift.String], - userIds: [Swift.String] - ) { - self.userTagIds = userTagIds - self.userIds = userIds - } - public enum CodingKeys: String, CodingKey { - case userTagIds - case userIds - } - } - /// - Remark: Generated from `#/components/schemas/DeleteUsersIntent`. - public struct DeleteUsersIntent: Codable, Hashable, Sendable { - /// A list of User IDs. - /// - /// - Remark: Generated from `#/components/schemas/DeleteUsersIntent/userIds`. - public var userIds: [Swift.String] - /// Creates a new `DeleteUsersIntent`. - /// - /// - Parameters: - /// - userIds: A list of User IDs. - public init(userIds: [Swift.String]) { - self.userIds = userIds - } - public enum CodingKeys: String, CodingKey { - case userIds - } - } - /// - Remark: Generated from `#/components/schemas/DeleteUsersRequest`. - public struct DeleteUsersRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/DeleteUsersRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_DELETE_USERS = "ACTIVITY_TYPE_DELETE_USERS" - } - /// - Remark: Generated from `#/components/schemas/DeleteUsersRequest/type`. - public var _type: Components.Schemas.DeleteUsersRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/DeleteUsersRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeleteUsersRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/DeleteUsersRequest/parameters`. - public var parameters: Components.Schemas.DeleteUsersIntent - /// Creates a new `DeleteUsersRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.DeleteUsersRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.DeleteUsersIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/DeleteUsersResult`. - public struct DeleteUsersResult: Codable, Hashable, Sendable { - /// A list of User IDs. - /// - /// - Remark: Generated from `#/components/schemas/DeleteUsersResult/userIds`. - public var userIds: [Swift.String] - /// Creates a new `DeleteUsersResult`. - /// - /// - Parameters: - /// - userIds: A list of User IDs. - public init(userIds: [Swift.String]) { - self.userIds = userIds - } - public enum CodingKeys: String, CodingKey { - case userIds - } - } - /// - Remark: Generated from `#/components/schemas/DeleteWalletsIntent`. - public struct DeleteWalletsIntent: Codable, Hashable, Sendable { - /// List of unique identifiers for wallets within an organization - /// - /// - Remark: Generated from `#/components/schemas/DeleteWalletsIntent/walletIds`. - public var walletIds: [Swift.String] - /// Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored. - /// - /// - Remark: Generated from `#/components/schemas/DeleteWalletsIntent/deleteWithoutExport`. - public var deleteWithoutExport: Swift.Bool? - /// Creates a new `DeleteWalletsIntent`. - /// - /// - Parameters: - /// - walletIds: List of unique identifiers for wallets within an organization - /// - deleteWithoutExport: Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored. - public init( - walletIds: [Swift.String], - deleteWithoutExport: Swift.Bool? = nil - ) { - self.walletIds = walletIds - self.deleteWithoutExport = deleteWithoutExport - } - public enum CodingKeys: String, CodingKey { - case walletIds - case deleteWithoutExport - } - } - /// - Remark: Generated from `#/components/schemas/DeleteWalletsRequest`. - public struct DeleteWalletsRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/DeleteWalletsRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_DELETE_WALLETS = "ACTIVITY_TYPE_DELETE_WALLETS" - } - /// - Remark: Generated from `#/components/schemas/DeleteWalletsRequest/type`. - public var _type: Components.Schemas.DeleteWalletsRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/DeleteWalletsRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/DeleteWalletsRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/DeleteWalletsRequest/parameters`. - public var parameters: Components.Schemas.DeleteWalletsIntent - /// Creates a new `DeleteWalletsRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.DeleteWalletsRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.DeleteWalletsIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/DeleteWalletsResult`. - public struct DeleteWalletsResult: Codable, Hashable, Sendable { - /// A list of wallet unique identifiers that were removed - /// - /// - Remark: Generated from `#/components/schemas/DeleteWalletsResult/walletIds`. - public var walletIds: [Swift.String] - /// Creates a new `DeleteWalletsResult`. - /// - /// - Parameters: - /// - walletIds: A list of wallet unique identifiers that were removed - public init(walletIds: [Swift.String]) { - self.walletIds = walletIds - } - public enum CodingKeys: String, CodingKey { - case walletIds - } - } - /// - Remark: Generated from `#/components/schemas/DisablePrivateKeyIntent`. - public struct DisablePrivateKeyIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Private Key. - /// - /// - Remark: Generated from `#/components/schemas/DisablePrivateKeyIntent/privateKeyId`. - public var privateKeyId: Swift.String - /// Creates a new `DisablePrivateKeyIntent`. - /// - /// - Parameters: - /// - privateKeyId: Unique identifier for a given Private Key. - public init(privateKeyId: Swift.String) { - self.privateKeyId = privateKeyId - } - public enum CodingKeys: String, CodingKey { - case privateKeyId - } - } - /// - Remark: Generated from `#/components/schemas/DisablePrivateKeyResult`. - public struct DisablePrivateKeyResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Private Key. - /// - /// - Remark: Generated from `#/components/schemas/DisablePrivateKeyResult/privateKeyId`. - public var privateKeyId: Swift.String - /// Creates a new `DisablePrivateKeyResult`. - /// - /// - Parameters: - /// - privateKeyId: Unique identifier for a given Private Key. - public init(privateKeyId: Swift.String) { - self.privateKeyId = privateKeyId - } - public enum CodingKeys: String, CodingKey { - case privateKeyId - } - } - /// - Remark: Generated from `#/components/schemas/Effect`. - @frozen public enum Effect: String, Codable, Hashable, Sendable, CaseIterable { - case EFFECT_ALLOW = "EFFECT_ALLOW" - case EFFECT_DENY = "EFFECT_DENY" - } - /// - Remark: Generated from `#/components/schemas/EmailAuthIntent`. - public struct EmailAuthIntent: Codable, Hashable, Sendable { - /// Email of the authenticating user. - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntent/email`. - public var email: Swift.String - /// Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted. - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntent/targetPublicKey`. - public var targetPublicKey: Swift.String - /// Optional human-readable name for an API Key. If none provided, default to Email Auth - - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntent/apiKeyName`. - public var apiKeyName: Swift.String? - /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntent/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// - Remark: Generated from `#/components/schemas/EmailAuthIntent/emailCustomization`. - public var emailCustomization: Components.Schemas.EmailCustomizationParams? - /// Invalidate all other previously generated Email Auth API keys - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntent/invalidateExisting`. - public var invalidateExisting: Swift.Bool? - /// Optional custom email address from which to send the email - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntent/sendFromEmailAddress`. - public var sendFromEmailAddress: Swift.String? - /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntent/sendFromEmailSenderName`. - public var sendFromEmailSenderName: Swift.String? - /// Optional custom email address to use as reply-to - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntent/replyToEmailAddress`. - public var replyToEmailAddress: Swift.String? - /// Creates a new `EmailAuthIntent`. - /// - /// - Parameters: - /// - email: Email of the authenticating user. - /// - targetPublicKey: Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted. - /// - apiKeyName: Optional human-readable name for an API Key. If none provided, default to Email Auth - - /// - expirationSeconds: Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - /// - emailCustomization: - /// - invalidateExisting: Invalidate all other previously generated Email Auth API keys - /// - sendFromEmailAddress: Optional custom email address from which to send the email - /// - sendFromEmailSenderName: Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' - /// - replyToEmailAddress: Optional custom email address to use as reply-to - public init( - email: Swift.String, - targetPublicKey: Swift.String, - apiKeyName: Swift.String? = nil, - expirationSeconds: Swift.String? = nil, - emailCustomization: Components.Schemas.EmailCustomizationParams? = nil, - invalidateExisting: Swift.Bool? = nil, - sendFromEmailAddress: Swift.String? = nil, - sendFromEmailSenderName: Swift.String? = nil, - replyToEmailAddress: Swift.String? = nil - ) { - self.email = email - self.targetPublicKey = targetPublicKey - self.apiKeyName = apiKeyName - self.expirationSeconds = expirationSeconds - self.emailCustomization = emailCustomization - self.invalidateExisting = invalidateExisting - self.sendFromEmailAddress = sendFromEmailAddress - self.sendFromEmailSenderName = sendFromEmailSenderName - self.replyToEmailAddress = replyToEmailAddress - } - public enum CodingKeys: String, CodingKey { - case email - case targetPublicKey - case apiKeyName - case expirationSeconds - case emailCustomization - case invalidateExisting - case sendFromEmailAddress - case sendFromEmailSenderName - case replyToEmailAddress - } - } - /// - Remark: Generated from `#/components/schemas/EmailAuthIntentV2`. - public struct EmailAuthIntentV2: Codable, Hashable, Sendable { - /// Email of the authenticating user. - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntentV2/email`. - public var email: Swift.String - /// Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted. - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntentV2/targetPublicKey`. - public var targetPublicKey: Swift.String - /// Optional human-readable name for an API Key. If none provided, default to Email Auth - - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntentV2/apiKeyName`. - public var apiKeyName: Swift.String? - /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntentV2/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// - Remark: Generated from `#/components/schemas/EmailAuthIntentV2/emailCustomization`. - public var emailCustomization: Components.Schemas.EmailCustomizationParams? - /// Invalidate all other previously generated Email Auth API keys - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntentV2/invalidateExisting`. - public var invalidateExisting: Swift.Bool? - /// Optional custom email address from which to send the email - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntentV2/sendFromEmailAddress`. - public var sendFromEmailAddress: Swift.String? - /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntentV2/sendFromEmailSenderName`. - public var sendFromEmailSenderName: Swift.String? - /// Optional custom email address to use as reply-to - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthIntentV2/replyToEmailAddress`. - public var replyToEmailAddress: Swift.String? - /// Creates a new `EmailAuthIntentV2`. - /// - /// - Parameters: - /// - email: Email of the authenticating user. - /// - targetPublicKey: Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted. - /// - apiKeyName: Optional human-readable name for an API Key. If none provided, default to Email Auth - - /// - expirationSeconds: Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - /// - emailCustomization: - /// - invalidateExisting: Invalidate all other previously generated Email Auth API keys - /// - sendFromEmailAddress: Optional custom email address from which to send the email - /// - sendFromEmailSenderName: Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' - /// - replyToEmailAddress: Optional custom email address to use as reply-to - public init( - email: Swift.String, - targetPublicKey: Swift.String, - apiKeyName: Swift.String? = nil, - expirationSeconds: Swift.String? = nil, - emailCustomization: Components.Schemas.EmailCustomizationParams? = nil, - invalidateExisting: Swift.Bool? = nil, - sendFromEmailAddress: Swift.String? = nil, - sendFromEmailSenderName: Swift.String? = nil, - replyToEmailAddress: Swift.String? = nil - ) { - self.email = email - self.targetPublicKey = targetPublicKey - self.apiKeyName = apiKeyName - self.expirationSeconds = expirationSeconds - self.emailCustomization = emailCustomization - self.invalidateExisting = invalidateExisting - self.sendFromEmailAddress = sendFromEmailAddress - self.sendFromEmailSenderName = sendFromEmailSenderName - self.replyToEmailAddress = replyToEmailAddress - } - public enum CodingKeys: String, CodingKey { - case email - case targetPublicKey - case apiKeyName - case expirationSeconds - case emailCustomization - case invalidateExisting - case sendFromEmailAddress - case sendFromEmailSenderName - case replyToEmailAddress - } - } - /// - Remark: Generated from `#/components/schemas/EmailAuthRequest`. - public struct EmailAuthRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/EmailAuthRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_EMAIL_AUTH_V2 = "ACTIVITY_TYPE_EMAIL_AUTH_V2" - } - /// - Remark: Generated from `#/components/schemas/EmailAuthRequest/type`. - public var _type: Components.Schemas.EmailAuthRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/EmailAuthRequest/parameters`. - public var parameters: Components.Schemas.EmailAuthIntentV2 - /// Creates a new `EmailAuthRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.EmailAuthRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.EmailAuthIntentV2 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/EmailAuthResult`. - public struct EmailAuthResult: Codable, Hashable, Sendable { - /// Unique identifier for the authenticating User. - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthResult/userId`. - public var userId: Swift.String - /// Unique identifier for the created API key. - /// - /// - Remark: Generated from `#/components/schemas/EmailAuthResult/apiKeyId`. - public var apiKeyId: Swift.String - /// Creates a new `EmailAuthResult`. - /// - /// - Parameters: - /// - userId: Unique identifier for the authenticating User. - /// - apiKeyId: Unique identifier for the created API key. - public init( - userId: Swift.String, - apiKeyId: Swift.String - ) { - self.userId = userId - self.apiKeyId = apiKeyId - } - public enum CodingKeys: String, CodingKey { - case userId - case apiKeyId - } - } - /// - Remark: Generated from `#/components/schemas/EmailCustomizationParams`. - public struct EmailCustomizationParams: Codable, Hashable, Sendable { - /// The name of the application. - /// - /// - Remark: Generated from `#/components/schemas/EmailCustomizationParams/appName`. - public var appName: Swift.String? - /// A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px. - /// - /// - Remark: Generated from `#/components/schemas/EmailCustomizationParams/logoUrl`. - public var logoUrl: Swift.String? - /// A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`. - /// - /// - Remark: Generated from `#/components/schemas/EmailCustomizationParams/magicLinkTemplate`. - public var magicLinkTemplate: Swift.String? - /// JSON object containing key/value pairs to be used with custom templates. - /// - /// - Remark: Generated from `#/components/schemas/EmailCustomizationParams/templateVariables`. - public var templateVariables: Swift.String? - /// Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template. - /// - /// - Remark: Generated from `#/components/schemas/EmailCustomizationParams/templateId`. - public var templateId: Swift.String? - /// Creates a new `EmailCustomizationParams`. - /// - /// - Parameters: - /// - appName: The name of the application. - /// - logoUrl: A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px. - /// - magicLinkTemplate: A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`. - /// - templateVariables: JSON object containing key/value pairs to be used with custom templates. - /// - templateId: Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template. - public init( - appName: Swift.String? = nil, - logoUrl: Swift.String? = nil, - magicLinkTemplate: Swift.String? = nil, - templateVariables: Swift.String? = nil, - templateId: Swift.String? = nil - ) { - self.appName = appName - self.logoUrl = logoUrl - self.magicLinkTemplate = magicLinkTemplate - self.templateVariables = templateVariables - self.templateId = templateId - } - public enum CodingKeys: String, CodingKey { - case appName - case logoUrl - case magicLinkTemplate - case templateVariables - case templateId - } - } - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyIntent`. - public struct ExportPrivateKeyIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Private Key. - /// - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyIntent/privateKeyId`. - public var privateKeyId: Swift.String - /// Client-side public key generated by the user, to which the export bundle will be encrypted. - /// - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyIntent/targetPublicKey`. - public var targetPublicKey: Swift.String - /// Creates a new `ExportPrivateKeyIntent`. - /// - /// - Parameters: - /// - privateKeyId: Unique identifier for a given Private Key. - /// - targetPublicKey: Client-side public key generated by the user, to which the export bundle will be encrypted. - public init( - privateKeyId: Swift.String, - targetPublicKey: Swift.String - ) { - self.privateKeyId = privateKeyId - self.targetPublicKey = targetPublicKey - } - public enum CodingKeys: String, CodingKey { - case privateKeyId - case targetPublicKey - } - } - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyRequest`. - public struct ExportPrivateKeyRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_EXPORT_PRIVATE_KEY = "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY" - } - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyRequest/type`. - public var _type: Components.Schemas.ExportPrivateKeyRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyRequest/parameters`. - public var parameters: Components.Schemas.ExportPrivateKeyIntent - /// Creates a new `ExportPrivateKeyRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.ExportPrivateKeyRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.ExportPrivateKeyIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyResult`. - public struct ExportPrivateKeyResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Private Key. - /// - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyResult/privateKeyId`. - public var privateKeyId: Swift.String - /// Export bundle containing a private key encrypted to the client's target public key. - /// - /// - Remark: Generated from `#/components/schemas/ExportPrivateKeyResult/exportBundle`. - public var exportBundle: Swift.String - /// Creates a new `ExportPrivateKeyResult`. - /// - /// - Parameters: - /// - privateKeyId: Unique identifier for a given Private Key. - /// - exportBundle: Export bundle containing a private key encrypted to the client's target public key. - public init( - privateKeyId: Swift.String, - exportBundle: Swift.String - ) { - self.privateKeyId = privateKeyId - self.exportBundle = exportBundle - } - public enum CodingKeys: String, CodingKey { - case privateKeyId - case exportBundle - } - } - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountIntent`. - public struct ExportWalletAccountIntent: Codable, Hashable, Sendable { - /// Address to identify Wallet Account. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountIntent/address`. - public var address: Swift.String - /// Client-side public key generated by the user, to which the export bundle will be encrypted. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountIntent/targetPublicKey`. - public var targetPublicKey: Swift.String - /// Creates a new `ExportWalletAccountIntent`. - /// - /// - Parameters: - /// - address: Address to identify Wallet Account. - /// - targetPublicKey: Client-side public key generated by the user, to which the export bundle will be encrypted. - public init( - address: Swift.String, - targetPublicKey: Swift.String - ) { - self.address = address - self.targetPublicKey = targetPublicKey - } - public enum CodingKeys: String, CodingKey { - case address - case targetPublicKey - } - } - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountRequest`. - public struct ExportWalletAccountRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT = "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT" - } - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountRequest/type`. - public var _type: Components.Schemas.ExportWalletAccountRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountRequest/parameters`. - public var parameters: Components.Schemas.ExportWalletAccountIntent - /// Creates a new `ExportWalletAccountRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.ExportWalletAccountRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.ExportWalletAccountIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountResult`. - public struct ExportWalletAccountResult: Codable, Hashable, Sendable { - /// Address to identify Wallet Account. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountResult/address`. - public var address: Swift.String - /// Export bundle containing a private key encrypted by the client's target public key. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletAccountResult/exportBundle`. - public var exportBundle: Swift.String - /// Creates a new `ExportWalletAccountResult`. - /// - /// - Parameters: - /// - address: Address to identify Wallet Account. - /// - exportBundle: Export bundle containing a private key encrypted by the client's target public key. - public init( - address: Swift.String, - exportBundle: Swift.String - ) { - self.address = address - self.exportBundle = exportBundle - } - public enum CodingKeys: String, CodingKey { - case address - case exportBundle - } - } - /// - Remark: Generated from `#/components/schemas/ExportWalletIntent`. - public struct ExportWalletIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Wallet. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletIntent/walletId`. - public var walletId: Swift.String - /// Client-side public key generated by the user, to which the export bundle will be encrypted. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletIntent/targetPublicKey`. - public var targetPublicKey: Swift.String - /// - Remark: Generated from `#/components/schemas/ExportWalletIntent/language`. - public var language: Components.Schemas.MnemonicLanguage? - /// Creates a new `ExportWalletIntent`. - /// - /// - Parameters: - /// - walletId: Unique identifier for a given Wallet. - /// - targetPublicKey: Client-side public key generated by the user, to which the export bundle will be encrypted. - /// - language: - public init( - walletId: Swift.String, - targetPublicKey: Swift.String, - language: Components.Schemas.MnemonicLanguage? = nil - ) { - self.walletId = walletId - self.targetPublicKey = targetPublicKey - self.language = language - } - public enum CodingKeys: String, CodingKey { - case walletId - case targetPublicKey - case language - } - } - /// - Remark: Generated from `#/components/schemas/ExportWalletRequest`. - public struct ExportWalletRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ExportWalletRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_EXPORT_WALLET = "ACTIVITY_TYPE_EXPORT_WALLET" - } - /// - Remark: Generated from `#/components/schemas/ExportWalletRequest/type`. - public var _type: Components.Schemas.ExportWalletRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/ExportWalletRequest/parameters`. - public var parameters: Components.Schemas.ExportWalletIntent - /// Creates a new `ExportWalletRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.ExportWalletRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.ExportWalletIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/ExportWalletResult`. - public struct ExportWalletResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Wallet. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletResult/walletId`. - public var walletId: Swift.String - /// Export bundle containing a wallet mnemonic + optional newline passphrase encrypted by the client's target public key. - /// - /// - Remark: Generated from `#/components/schemas/ExportWalletResult/exportBundle`. - public var exportBundle: Swift.String - /// Creates a new `ExportWalletResult`. - /// - /// - Parameters: - /// - walletId: Unique identifier for a given Wallet. - /// - exportBundle: Export bundle containing a wallet mnemonic + optional newline passphrase encrypted by the client's target public key. - public init( - walletId: Swift.String, - exportBundle: Swift.String - ) { - self.walletId = walletId - self.exportBundle = exportBundle - } - public enum CodingKeys: String, CodingKey { - case walletId - case exportBundle - } - } - /// - Remark: Generated from `#/components/schemas/Feature`. - public struct Feature: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Feature/name`. - public var name: Components.Schemas.FeatureName? - /// - Remark: Generated from `#/components/schemas/Feature/value`. - public var value: Swift.String? - /// Creates a new `Feature`. - /// - /// - Parameters: - /// - name: - /// - value: - public init( - name: Components.Schemas.FeatureName? = nil, - value: Swift.String? = nil - ) { - self.name = name - self.value = value - } - public enum CodingKeys: String, CodingKey { - case name - case value - } - } - /// - Remark: Generated from `#/components/schemas/FeatureName`. - @frozen public enum FeatureName: String, Codable, Hashable, Sendable, CaseIterable { - case FEATURE_NAME_ROOT_USER_EMAIL_RECOVERY = "FEATURE_NAME_ROOT_USER_EMAIL_RECOVERY" - case FEATURE_NAME_WEBAUTHN_ORIGINS = "FEATURE_NAME_WEBAUTHN_ORIGINS" - case FEATURE_NAME_EMAIL_AUTH = "FEATURE_NAME_EMAIL_AUTH" - case FEATURE_NAME_EMAIL_RECOVERY = "FEATURE_NAME_EMAIL_RECOVERY" - case FEATURE_NAME_WEBHOOK = "FEATURE_NAME_WEBHOOK" - case FEATURE_NAME_SMS_AUTH = "FEATURE_NAME_SMS_AUTH" - case FEATURE_NAME_OTP_EMAIL_AUTH = "FEATURE_NAME_OTP_EMAIL_AUTH" - } - /// - Remark: Generated from `#/components/schemas/GetActivitiesRequest`. - public struct GetActivitiesRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetActivitiesRequest/organizationId`. - public var organizationId: Swift.String - /// Array of Activity Statuses filtering which Activities will be listed in the response. - /// - /// - Remark: Generated from `#/components/schemas/GetActivitiesRequest/filterByStatus`. - public var filterByStatus: [Components.Schemas.ActivityStatus]? - /// - Remark: Generated from `#/components/schemas/GetActivitiesRequest/paginationOptions`. - public var paginationOptions: Components.Schemas.Pagination? - /// Array of Activity Types filtering which Activities will be listed in the response. - /// - /// - Remark: Generated from `#/components/schemas/GetActivitiesRequest/filterByType`. - public var filterByType: [Components.Schemas.ActivityType]? - /// Creates a new `GetActivitiesRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - filterByStatus: Array of Activity Statuses filtering which Activities will be listed in the response. - /// - paginationOptions: - /// - filterByType: Array of Activity Types filtering which Activities will be listed in the response. - public init( - organizationId: Swift.String, - filterByStatus: [Components.Schemas.ActivityStatus]? = nil, - paginationOptions: Components.Schemas.Pagination? = nil, - filterByType: [Components.Schemas.ActivityType]? = nil - ) { - self.organizationId = organizationId - self.filterByStatus = filterByStatus - self.paginationOptions = paginationOptions - self.filterByType = filterByType - } - public enum CodingKeys: String, CodingKey { - case organizationId - case filterByStatus - case paginationOptions - case filterByType - } - } - /// - Remark: Generated from `#/components/schemas/GetActivitiesResponse`. - public struct GetActivitiesResponse: Codable, Hashable, Sendable { - /// A list of Activities. - /// - /// - Remark: Generated from `#/components/schemas/GetActivitiesResponse/activities`. - public var activities: [Components.Schemas.Activity] - /// Creates a new `GetActivitiesResponse`. - /// - /// - Parameters: - /// - activities: A list of Activities. - public init(activities: [Components.Schemas.Activity]) { - self.activities = activities - } - public enum CodingKeys: String, CodingKey { - case activities - } - } - /// - Remark: Generated from `#/components/schemas/GetActivityRequest`. - public struct GetActivityRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetActivityRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given Activity object. - /// - /// - Remark: Generated from `#/components/schemas/GetActivityRequest/activityId`. - public var activityId: Swift.String - /// Creates a new `GetActivityRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - activityId: Unique identifier for a given Activity object. - public init( - organizationId: Swift.String, - activityId: Swift.String - ) { - self.organizationId = organizationId - self.activityId = activityId - } - public enum CodingKeys: String, CodingKey { - case organizationId - case activityId - } - } - /// - Remark: Generated from `#/components/schemas/GetApiKeyRequest`. - public struct GetApiKeyRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetApiKeyRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given API key. - /// - /// - Remark: Generated from `#/components/schemas/GetApiKeyRequest/apiKeyId`. - public var apiKeyId: Swift.String - /// Creates a new `GetApiKeyRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - apiKeyId: Unique identifier for a given API key. - public init( - organizationId: Swift.String, - apiKeyId: Swift.String - ) { - self.organizationId = organizationId - self.apiKeyId = apiKeyId - } - public enum CodingKeys: String, CodingKey { - case organizationId - case apiKeyId - } - } - /// - Remark: Generated from `#/components/schemas/GetApiKeyResponse`. - public struct GetApiKeyResponse: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/GetApiKeyResponse/apiKey`. - public var apiKey: Components.Schemas.ApiKey - /// Creates a new `GetApiKeyResponse`. - /// - /// - Parameters: - /// - apiKey: - public init(apiKey: Components.Schemas.ApiKey) { - self.apiKey = apiKey - } - public enum CodingKeys: String, CodingKey { - case apiKey - } - } - /// - Remark: Generated from `#/components/schemas/GetApiKeysRequest`. - public struct GetApiKeysRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetApiKeysRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/GetApiKeysRequest/userId`. - public var userId: Swift.String? - /// Creates a new `GetApiKeysRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - userId: Unique identifier for a given User. - public init( - organizationId: Swift.String, - userId: Swift.String? = nil - ) { - self.organizationId = organizationId - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case organizationId - case userId - } - } - /// - Remark: Generated from `#/components/schemas/GetApiKeysResponse`. - public struct GetApiKeysResponse: Codable, Hashable, Sendable { - /// A list of API keys. - /// - /// - Remark: Generated from `#/components/schemas/GetApiKeysResponse/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKey] - /// Creates a new `GetApiKeysResponse`. - /// - /// - Parameters: - /// - apiKeys: A list of API keys. - public init(apiKeys: [Components.Schemas.ApiKey]) { - self.apiKeys = apiKeys - } - public enum CodingKeys: String, CodingKey { - case apiKeys - } - } - /// - Remark: Generated from `#/components/schemas/GetAuthenticatorRequest`. - public struct GetAuthenticatorRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetAuthenticatorRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given Authenticator. - /// - /// - Remark: Generated from `#/components/schemas/GetAuthenticatorRequest/authenticatorId`. - public var authenticatorId: Swift.String - /// Creates a new `GetAuthenticatorRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - authenticatorId: Unique identifier for a given Authenticator. - public init( - organizationId: Swift.String, - authenticatorId: Swift.String - ) { - self.organizationId = organizationId - self.authenticatorId = authenticatorId - } - public enum CodingKeys: String, CodingKey { - case organizationId - case authenticatorId - } - } - /// - Remark: Generated from `#/components/schemas/GetAuthenticatorResponse`. - public struct GetAuthenticatorResponse: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/GetAuthenticatorResponse/authenticator`. - public var authenticator: Components.Schemas.Authenticator - /// Creates a new `GetAuthenticatorResponse`. - /// - /// - Parameters: - /// - authenticator: - public init(authenticator: Components.Schemas.Authenticator) { - self.authenticator = authenticator - } - public enum CodingKeys: String, CodingKey { - case authenticator - } - } - /// - Remark: Generated from `#/components/schemas/GetAuthenticatorsRequest`. - public struct GetAuthenticatorsRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetAuthenticatorsRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/GetAuthenticatorsRequest/userId`. - public var userId: Swift.String - /// Creates a new `GetAuthenticatorsRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - userId: Unique identifier for a given User. - public init( - organizationId: Swift.String, - userId: Swift.String - ) { - self.organizationId = organizationId - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case organizationId - case userId - } - } - /// - Remark: Generated from `#/components/schemas/GetAuthenticatorsResponse`. - public struct GetAuthenticatorsResponse: Codable, Hashable, Sendable { - /// A list of authenticators. - /// - /// - Remark: Generated from `#/components/schemas/GetAuthenticatorsResponse/authenticators`. - public var authenticators: [Components.Schemas.Authenticator] - /// Creates a new `GetAuthenticatorsResponse`. - /// - /// - Parameters: - /// - authenticators: A list of authenticators. - public init(authenticators: [Components.Schemas.Authenticator]) { - self.authenticators = authenticators - } - public enum CodingKeys: String, CodingKey { - case authenticators - } - } - /// - Remark: Generated from `#/components/schemas/GetOauthProvidersRequest`. - public struct GetOauthProvidersRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetOauthProvidersRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/GetOauthProvidersRequest/userId`. - public var userId: Swift.String? - /// Creates a new `GetOauthProvidersRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - userId: Unique identifier for a given User. - public init( - organizationId: Swift.String, - userId: Swift.String? = nil - ) { - self.organizationId = organizationId - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case organizationId - case userId - } - } - /// - Remark: Generated from `#/components/schemas/GetOauthProvidersResponse`. - public struct GetOauthProvidersResponse: Codable, Hashable, Sendable { - /// A list of Oauth Providers - /// - /// - Remark: Generated from `#/components/schemas/GetOauthProvidersResponse/oauthProviders`. - public var oauthProviders: [Components.Schemas.OauthProvider] - /// Creates a new `GetOauthProvidersResponse`. - /// - /// - Parameters: - /// - oauthProviders: A list of Oauth Providers - public init(oauthProviders: [Components.Schemas.OauthProvider]) { - self.oauthProviders = oauthProviders - } - public enum CodingKeys: String, CodingKey { - case oauthProviders - } - } - /// - Remark: Generated from `#/components/schemas/GetOrganizationConfigsRequest`. - public struct GetOrganizationConfigsRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetOrganizationConfigsRequest/organizationId`. - public var organizationId: Swift.String - /// Creates a new `GetOrganizationConfigsRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - public init(organizationId: Swift.String) { - self.organizationId = organizationId - } - public enum CodingKeys: String, CodingKey { - case organizationId - } - } - /// - Remark: Generated from `#/components/schemas/GetOrganizationConfigsResponse`. - public struct GetOrganizationConfigsResponse: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/GetOrganizationConfigsResponse/configs`. - public var configs: Components.Schemas.Config - /// Creates a new `GetOrganizationConfigsResponse`. - /// - /// - Parameters: - /// - configs: - public init(configs: Components.Schemas.Config) { - self.configs = configs - } - public enum CodingKeys: String, CodingKey { - case configs - } - } - /// - Remark: Generated from `#/components/schemas/GetPoliciesRequest`. - public struct GetPoliciesRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetPoliciesRequest/organizationId`. - public var organizationId: Swift.String - /// Creates a new `GetPoliciesRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - public init(organizationId: Swift.String) { - self.organizationId = organizationId - } - public enum CodingKeys: String, CodingKey { - case organizationId - } - } - /// - Remark: Generated from `#/components/schemas/GetPoliciesResponse`. - public struct GetPoliciesResponse: Codable, Hashable, Sendable { - /// A list of Policies. - /// - /// - Remark: Generated from `#/components/schemas/GetPoliciesResponse/policies`. - public var policies: [Components.Schemas.Policy] - /// Creates a new `GetPoliciesResponse`. - /// - /// - Parameters: - /// - policies: A list of Policies. - public init(policies: [Components.Schemas.Policy]) { - self.policies = policies - } - public enum CodingKeys: String, CodingKey { - case policies - } - } - /// - Remark: Generated from `#/components/schemas/GetPolicyRequest`. - public struct GetPolicyRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetPolicyRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given Policy. - /// - /// - Remark: Generated from `#/components/schemas/GetPolicyRequest/policyId`. - public var policyId: Swift.String - /// Creates a new `GetPolicyRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - policyId: Unique identifier for a given Policy. - public init( - organizationId: Swift.String, - policyId: Swift.String - ) { - self.organizationId = organizationId - self.policyId = policyId - } - public enum CodingKeys: String, CodingKey { - case organizationId - case policyId - } - } - /// - Remark: Generated from `#/components/schemas/GetPolicyResponse`. - public struct GetPolicyResponse: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/GetPolicyResponse/policy`. - public var policy: Components.Schemas.Policy - /// Creates a new `GetPolicyResponse`. - /// - /// - Parameters: - /// - policy: - public init(policy: Components.Schemas.Policy) { - self.policy = policy - } - public enum CodingKeys: String, CodingKey { - case policy - } - } - /// - Remark: Generated from `#/components/schemas/GetPrivateKeyRequest`. - public struct GetPrivateKeyRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetPrivateKeyRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given Private Key. - /// - /// - Remark: Generated from `#/components/schemas/GetPrivateKeyRequest/privateKeyId`. - public var privateKeyId: Swift.String - /// Creates a new `GetPrivateKeyRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - privateKeyId: Unique identifier for a given Private Key. - public init( - organizationId: Swift.String, - privateKeyId: Swift.String - ) { - self.organizationId = organizationId - self.privateKeyId = privateKeyId - } - public enum CodingKeys: String, CodingKey { - case organizationId - case privateKeyId - } - } - /// - Remark: Generated from `#/components/schemas/GetPrivateKeyResponse`. - public struct GetPrivateKeyResponse: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/GetPrivateKeyResponse/privateKey`. - public var privateKey: Components.Schemas.PrivateKey - /// Creates a new `GetPrivateKeyResponse`. - /// - /// - Parameters: - /// - privateKey: - public init(privateKey: Components.Schemas.PrivateKey) { - self.privateKey = privateKey - } - public enum CodingKeys: String, CodingKey { - case privateKey - } - } - /// - Remark: Generated from `#/components/schemas/GetPrivateKeysRequest`. - public struct GetPrivateKeysRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetPrivateKeysRequest/organizationId`. - public var organizationId: Swift.String - /// Creates a new `GetPrivateKeysRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - public init(organizationId: Swift.String) { - self.organizationId = organizationId - } - public enum CodingKeys: String, CodingKey { - case organizationId - } - } - /// - Remark: Generated from `#/components/schemas/GetPrivateKeysResponse`. - public struct GetPrivateKeysResponse: Codable, Hashable, Sendable { - /// A list of Private Keys. - /// - /// - Remark: Generated from `#/components/schemas/GetPrivateKeysResponse/privateKeys`. - public var privateKeys: [Components.Schemas.PrivateKey] - /// Creates a new `GetPrivateKeysResponse`. - /// - /// - Parameters: - /// - privateKeys: A list of Private Keys. - public init(privateKeys: [Components.Schemas.PrivateKey]) { - self.privateKeys = privateKeys - } - public enum CodingKeys: String, CodingKey { - case privateKeys - } - } - /// - Remark: Generated from `#/components/schemas/GetSubOrgIdsRequest`. - public struct GetSubOrgIdsRequest: Codable, Hashable, Sendable { - /// Unique identifier for the parent Organization. This is used to find sub-organizations within it. - /// - /// - Remark: Generated from `#/components/schemas/GetSubOrgIdsRequest/organizationId`. - public var organizationId: Swift.String - /// Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY' - /// - /// - Remark: Generated from `#/components/schemas/GetSubOrgIdsRequest/filterType`. - public var filterType: Swift.String? - /// The value of the filter to apply for the specified type. For example, a specific email or name string. - /// - /// - Remark: Generated from `#/components/schemas/GetSubOrgIdsRequest/filterValue`. - public var filterValue: Swift.String? - /// - Remark: Generated from `#/components/schemas/GetSubOrgIdsRequest/paginationOptions`. - public var paginationOptions: Components.Schemas.Pagination? - /// Creates a new `GetSubOrgIdsRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for the parent Organization. This is used to find sub-organizations within it. - /// - filterType: Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY' - /// - filterValue: The value of the filter to apply for the specified type. For example, a specific email or name string. - /// - paginationOptions: - public init( - organizationId: Swift.String, - filterType: Swift.String? = nil, - filterValue: Swift.String? = nil, - paginationOptions: Components.Schemas.Pagination? = nil - ) { - self.organizationId = organizationId - self.filterType = filterType - self.filterValue = filterValue - self.paginationOptions = paginationOptions - } - public enum CodingKeys: String, CodingKey { - case organizationId - case filterType - case filterValue - case paginationOptions - } - } - /// - Remark: Generated from `#/components/schemas/GetSubOrgIdsResponse`. - public struct GetSubOrgIdsResponse: Codable, Hashable, Sendable { - /// List of unique identifiers for the matching sub-organizations. - /// - /// - Remark: Generated from `#/components/schemas/GetSubOrgIdsResponse/organizationIds`. - public var organizationIds: [Swift.String] - /// Creates a new `GetSubOrgIdsResponse`. - /// - /// - Parameters: - /// - organizationIds: List of unique identifiers for the matching sub-organizations. - public init(organizationIds: [Swift.String]) { - self.organizationIds = organizationIds - } - public enum CodingKeys: String, CodingKey { - case organizationIds - } - } - /// - Remark: Generated from `#/components/schemas/GetUserRequest`. - public struct GetUserRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetUserRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/GetUserRequest/userId`. - public var userId: Swift.String - /// Creates a new `GetUserRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - userId: Unique identifier for a given User. - public init( - organizationId: Swift.String, - userId: Swift.String - ) { - self.organizationId = organizationId - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case organizationId - case userId - } - } - /// - Remark: Generated from `#/components/schemas/GetUserResponse`. - public struct GetUserResponse: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/GetUserResponse/user`. - public var user: Components.Schemas.User - /// Creates a new `GetUserResponse`. - /// - /// - Parameters: - /// - user: - public init(user: Components.Schemas.User) { - self.user = user - } - public enum CodingKeys: String, CodingKey { - case user - } - } - /// - Remark: Generated from `#/components/schemas/GetUsersRequest`. - public struct GetUsersRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetUsersRequest/organizationId`. - public var organizationId: Swift.String - /// Creates a new `GetUsersRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - public init(organizationId: Swift.String) { - self.organizationId = organizationId - } - public enum CodingKeys: String, CodingKey { - case organizationId - } - } - /// - Remark: Generated from `#/components/schemas/GetUsersResponse`. - public struct GetUsersResponse: Codable, Hashable, Sendable { - /// A list of Users. - /// - /// - Remark: Generated from `#/components/schemas/GetUsersResponse/users`. - public var users: [Components.Schemas.User] - /// Creates a new `GetUsersResponse`. - /// - /// - Parameters: - /// - users: A list of Users. - public init(users: [Components.Schemas.User]) { - self.users = users - } - public enum CodingKeys: String, CodingKey { - case users - } - } - /// - Remark: Generated from `#/components/schemas/GetVerifiedSubOrgIdsRequest`. - public struct GetVerifiedSubOrgIdsRequest: Codable, Hashable, Sendable { - /// Unique identifier for the parent Organization. This is used to find sub-organizations within it. - /// - /// - Remark: Generated from `#/components/schemas/GetVerifiedSubOrgIdsRequest/organizationId`. - public var organizationId: Swift.String - /// Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER' - /// - /// - Remark: Generated from `#/components/schemas/GetVerifiedSubOrgIdsRequest/filterType`. - public var filterType: Swift.String? - /// The value of the filter to apply for the specified type. For example, a specific email or phone number string. - /// - /// - Remark: Generated from `#/components/schemas/GetVerifiedSubOrgIdsRequest/filterValue`. - public var filterValue: Swift.String? - /// - Remark: Generated from `#/components/schemas/GetVerifiedSubOrgIdsRequest/paginationOptions`. - public var paginationOptions: Components.Schemas.Pagination? - /// Creates a new `GetVerifiedSubOrgIdsRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for the parent Organization. This is used to find sub-organizations within it. - /// - filterType: Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER' - /// - filterValue: The value of the filter to apply for the specified type. For example, a specific email or phone number string. - /// - paginationOptions: - public init( - organizationId: Swift.String, - filterType: Swift.String? = nil, - filterValue: Swift.String? = nil, - paginationOptions: Components.Schemas.Pagination? = nil - ) { - self.organizationId = organizationId - self.filterType = filterType - self.filterValue = filterValue - self.paginationOptions = paginationOptions - } - public enum CodingKeys: String, CodingKey { - case organizationId - case filterType - case filterValue - case paginationOptions - } - } - /// - Remark: Generated from `#/components/schemas/GetVerifiedSubOrgIdsResponse`. - public struct GetVerifiedSubOrgIdsResponse: Codable, Hashable, Sendable { - /// List of unique identifiers for the matching sub-organizations. - /// - /// - Remark: Generated from `#/components/schemas/GetVerifiedSubOrgIdsResponse/organizationIds`. - public var organizationIds: [Swift.String] - /// Creates a new `GetVerifiedSubOrgIdsResponse`. - /// - /// - Parameters: - /// - organizationIds: List of unique identifiers for the matching sub-organizations. - public init(organizationIds: [Swift.String]) { - self.organizationIds = organizationIds - } - public enum CodingKeys: String, CodingKey { - case organizationIds - } - } - /// - Remark: Generated from `#/components/schemas/GetWalletAccountRequest`. - public struct GetWalletAccountRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetWalletAccountRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given Wallet. - /// - /// - Remark: Generated from `#/components/schemas/GetWalletAccountRequest/walletId`. - public var walletId: Swift.String - /// Address corresponding to a Wallet Account. - /// - /// - Remark: Generated from `#/components/schemas/GetWalletAccountRequest/address`. - public var address: Swift.String? - /// Path corresponding to a Wallet Account. - /// - /// - Remark: Generated from `#/components/schemas/GetWalletAccountRequest/path`. - public var path: Swift.String? - /// Creates a new `GetWalletAccountRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - walletId: Unique identifier for a given Wallet. - /// - address: Address corresponding to a Wallet Account. - /// - path: Path corresponding to a Wallet Account. - public init( - organizationId: Swift.String, - walletId: Swift.String, - address: Swift.String? = nil, - path: Swift.String? = nil - ) { - self.organizationId = organizationId - self.walletId = walletId - self.address = address - self.path = path - } - public enum CodingKeys: String, CodingKey { - case organizationId - case walletId - case address - case path - } - } - /// - Remark: Generated from `#/components/schemas/GetWalletAccountResponse`. - public struct GetWalletAccountResponse: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/GetWalletAccountResponse/account`. - public var account: Components.Schemas.WalletAccount - /// Creates a new `GetWalletAccountResponse`. - /// - /// - Parameters: - /// - account: - public init(account: Components.Schemas.WalletAccount) { - self.account = account - } - public enum CodingKeys: String, CodingKey { - case account - } - } - /// - Remark: Generated from `#/components/schemas/GetWalletAccountsRequest`. - public struct GetWalletAccountsRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetWalletAccountsRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given Wallet. - /// - /// - Remark: Generated from `#/components/schemas/GetWalletAccountsRequest/walletId`. - public var walletId: Swift.String - /// - Remark: Generated from `#/components/schemas/GetWalletAccountsRequest/paginationOptions`. - public var paginationOptions: Components.Schemas.Pagination? - /// Creates a new `GetWalletAccountsRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - walletId: Unique identifier for a given Wallet. - /// - paginationOptions: - public init( - organizationId: Swift.String, - walletId: Swift.String, - paginationOptions: Components.Schemas.Pagination? = nil - ) { - self.organizationId = organizationId - self.walletId = walletId - self.paginationOptions = paginationOptions - } - public enum CodingKeys: String, CodingKey { - case organizationId - case walletId - case paginationOptions - } - } - /// - Remark: Generated from `#/components/schemas/GetWalletAccountsResponse`. - public struct GetWalletAccountsResponse: Codable, Hashable, Sendable { - /// A list of Accounts generated from a Wallet that share a common seed. - /// - /// - Remark: Generated from `#/components/schemas/GetWalletAccountsResponse/accounts`. - public var accounts: [Components.Schemas.WalletAccount] - /// Creates a new `GetWalletAccountsResponse`. - /// - /// - Parameters: - /// - accounts: A list of Accounts generated from a Wallet that share a common seed. - public init(accounts: [Components.Schemas.WalletAccount]) { - self.accounts = accounts - } - public enum CodingKeys: String, CodingKey { - case accounts - } - } - /// - Remark: Generated from `#/components/schemas/GetWalletRequest`. - public struct GetWalletRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetWalletRequest/organizationId`. - public var organizationId: Swift.String - /// Unique identifier for a given Wallet. - /// - /// - Remark: Generated from `#/components/schemas/GetWalletRequest/walletId`. - public var walletId: Swift.String - /// Creates a new `GetWalletRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - walletId: Unique identifier for a given Wallet. - public init( - organizationId: Swift.String, - walletId: Swift.String - ) { - self.organizationId = organizationId - self.walletId = walletId - } - public enum CodingKeys: String, CodingKey { - case organizationId - case walletId - } - } - /// - Remark: Generated from `#/components/schemas/GetWalletResponse`. - public struct GetWalletResponse: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/GetWalletResponse/wallet`. - public var wallet: Components.Schemas.Wallet - /// Creates a new `GetWalletResponse`. - /// - /// - Parameters: - /// - wallet: - public init(wallet: Components.Schemas.Wallet) { - self.wallet = wallet - } - public enum CodingKeys: String, CodingKey { - case wallet - } - } - /// - Remark: Generated from `#/components/schemas/GetWalletsRequest`. - public struct GetWalletsRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetWalletsRequest/organizationId`. - public var organizationId: Swift.String - /// Creates a new `GetWalletsRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - public init(organizationId: Swift.String) { - self.organizationId = organizationId - } - public enum CodingKeys: String, CodingKey { - case organizationId - } - } - /// - Remark: Generated from `#/components/schemas/GetWalletsResponse`. - public struct GetWalletsResponse: Codable, Hashable, Sendable { - /// A list of Wallets. - /// - /// - Remark: Generated from `#/components/schemas/GetWalletsResponse/wallets`. - public var wallets: [Components.Schemas.Wallet] - /// Creates a new `GetWalletsResponse`. - /// - /// - Parameters: - /// - wallets: A list of Wallets. - public init(wallets: [Components.Schemas.Wallet]) { - self.wallets = wallets - } - public enum CodingKeys: String, CodingKey { - case wallets - } - } - /// - Remark: Generated from `#/components/schemas/GetWhoamiRequest`. - public struct GetWhoamiRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. If the request is being made by a WebAuthN user and their Sub-Organization ID is unknown, this can be the Parent Organization ID; using the Sub-Organization ID when possible is preferred due to performance reasons. - /// - /// - Remark: Generated from `#/components/schemas/GetWhoamiRequest/organizationId`. - public var organizationId: Swift.String - /// Creates a new `GetWhoamiRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. If the request is being made by a WebAuthN user and their Sub-Organization ID is unknown, this can be the Parent Organization ID; using the Sub-Organization ID when possible is preferred due to performance reasons. - public init(organizationId: Swift.String) { - self.organizationId = organizationId - } - public enum CodingKeys: String, CodingKey { - case organizationId - } - } - /// - Remark: Generated from `#/components/schemas/GetWhoamiResponse`. - public struct GetWhoamiResponse: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetWhoamiResponse/organizationId`. - public var organizationId: Swift.String - /// Human-readable name for an Organization. - /// - /// - Remark: Generated from `#/components/schemas/GetWhoamiResponse/organizationName`. - public var organizationName: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/GetWhoamiResponse/userId`. - public var userId: Swift.String - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/GetWhoamiResponse/username`. - public var username: Swift.String - /// Creates a new `GetWhoamiResponse`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - /// - organizationName: Human-readable name for an Organization. - /// - userId: Unique identifier for a given User. - /// - username: Human-readable name for a User. - public init( - organizationId: Swift.String, - organizationName: Swift.String, - userId: Swift.String, - username: Swift.String - ) { - self.organizationId = organizationId - self.organizationName = organizationName - self.userId = userId - self.username = username - } - public enum CodingKeys: String, CodingKey { - case organizationId - case organizationName - case userId - case username - } - } - /// - Remark: Generated from `#/components/schemas/HashFunction`. - @frozen public enum HashFunction: String, Codable, Hashable, Sendable, CaseIterable { - case HASH_FUNCTION_NO_OP = "HASH_FUNCTION_NO_OP" - case HASH_FUNCTION_SHA256 = "HASH_FUNCTION_SHA256" - case HASH_FUNCTION_KECCAK256 = "HASH_FUNCTION_KECCAK256" - case HASH_FUNCTION_NOT_APPLICABLE = "HASH_FUNCTION_NOT_APPLICABLE" - } - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyIntent`. - public struct ImportPrivateKeyIntent: Codable, Hashable, Sendable { - /// The ID of the User importing a Private Key. - /// - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyIntent/userId`. - public var userId: Swift.String - /// Human-readable name for a Private Key. - /// - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyIntent/privateKeyName`. - public var privateKeyName: Swift.String - /// Bundle containing a raw private key encrypted to the enclave's target public key. - /// - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyIntent/encryptedBundle`. - public var encryptedBundle: Swift.String - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyIntent/curve`. - public var curve: Components.Schemas.Curve - /// Cryptocurrency-specific formats for a derived address (e.g., Ethereum). - /// - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyIntent/addressFormats`. - public var addressFormats: [Components.Schemas.AddressFormat] - /// Creates a new `ImportPrivateKeyIntent`. - /// - /// - Parameters: - /// - userId: The ID of the User importing a Private Key. - /// - privateKeyName: Human-readable name for a Private Key. - /// - encryptedBundle: Bundle containing a raw private key encrypted to the enclave's target public key. - /// - curve: - /// - addressFormats: Cryptocurrency-specific formats for a derived address (e.g., Ethereum). - public init( - userId: Swift.String, - privateKeyName: Swift.String, - encryptedBundle: Swift.String, - curve: Components.Schemas.Curve, - addressFormats: [Components.Schemas.AddressFormat] - ) { - self.userId = userId - self.privateKeyName = privateKeyName - self.encryptedBundle = encryptedBundle - self.curve = curve - self.addressFormats = addressFormats - } - public enum CodingKeys: String, CodingKey { - case userId - case privateKeyName - case encryptedBundle - case curve - case addressFormats - } - } - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyRequest`. - public struct ImportPrivateKeyRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_IMPORT_PRIVATE_KEY = "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY" - } - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyRequest/type`. - public var _type: Components.Schemas.ImportPrivateKeyRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyRequest/parameters`. - public var parameters: Components.Schemas.ImportPrivateKeyIntent - /// Creates a new `ImportPrivateKeyRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.ImportPrivateKeyRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.ImportPrivateKeyIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyResult`. - public struct ImportPrivateKeyResult: Codable, Hashable, Sendable { - /// Unique identifier for a Private Key. - /// - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyResult/privateKeyId`. - public var privateKeyId: Swift.String - /// A list of addresses. - /// - /// - Remark: Generated from `#/components/schemas/ImportPrivateKeyResult/addresses`. - public var addresses: [Components.Schemas.activity_period_v1_period_Address] - /// Creates a new `ImportPrivateKeyResult`. - /// - /// - Parameters: - /// - privateKeyId: Unique identifier for a Private Key. - /// - addresses: A list of addresses. - public init( - privateKeyId: Swift.String, - addresses: [Components.Schemas.activity_period_v1_period_Address] - ) { - self.privateKeyId = privateKeyId - self.addresses = addresses - } - public enum CodingKeys: String, CodingKey { - case privateKeyId - case addresses - } - } - /// - Remark: Generated from `#/components/schemas/ImportWalletIntent`. - public struct ImportWalletIntent: Codable, Hashable, Sendable { - /// The ID of the User importing a Wallet. - /// - /// - Remark: Generated from `#/components/schemas/ImportWalletIntent/userId`. - public var userId: Swift.String - /// Human-readable name for a Wallet. - /// - /// - Remark: Generated from `#/components/schemas/ImportWalletIntent/walletName`. - public var walletName: Swift.String - /// Bundle containing a wallet mnemonic encrypted to the enclave's target public key. - /// - /// - Remark: Generated from `#/components/schemas/ImportWalletIntent/encryptedBundle`. - public var encryptedBundle: Swift.String - /// A list of wallet Accounts. - /// - /// - Remark: Generated from `#/components/schemas/ImportWalletIntent/accounts`. - public var accounts: [Components.Schemas.WalletAccountParams] - /// Creates a new `ImportWalletIntent`. - /// - /// - Parameters: - /// - userId: The ID of the User importing a Wallet. - /// - walletName: Human-readable name for a Wallet. - /// - encryptedBundle: Bundle containing a wallet mnemonic encrypted to the enclave's target public key. - /// - accounts: A list of wallet Accounts. - public init( - userId: Swift.String, - walletName: Swift.String, - encryptedBundle: Swift.String, - accounts: [Components.Schemas.WalletAccountParams] - ) { - self.userId = userId - self.walletName = walletName - self.encryptedBundle = encryptedBundle - self.accounts = accounts - } - public enum CodingKeys: String, CodingKey { - case userId - case walletName - case encryptedBundle - case accounts - } - } - /// - Remark: Generated from `#/components/schemas/ImportWalletRequest`. - public struct ImportWalletRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ImportWalletRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_IMPORT_WALLET = "ACTIVITY_TYPE_IMPORT_WALLET" - } - /// - Remark: Generated from `#/components/schemas/ImportWalletRequest/type`. - public var _type: Components.Schemas.ImportWalletRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/ImportWalletRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/ImportWalletRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/ImportWalletRequest/parameters`. - public var parameters: Components.Schemas.ImportWalletIntent - /// Creates a new `ImportWalletRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.ImportWalletRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.ImportWalletIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/ImportWalletResult`. - public struct ImportWalletResult: Codable, Hashable, Sendable { - /// Unique identifier for a Wallet. - /// - /// - Remark: Generated from `#/components/schemas/ImportWalletResult/walletId`. - public var walletId: Swift.String - /// A list of account addresses. - /// - /// - Remark: Generated from `#/components/schemas/ImportWalletResult/addresses`. - public var addresses: [Swift.String] - /// Creates a new `ImportWalletResult`. - /// - /// - Parameters: - /// - walletId: Unique identifier for a Wallet. - /// - addresses: A list of account addresses. - public init( - walletId: Swift.String, - addresses: [Swift.String] - ) { - self.walletId = walletId - self.addresses = addresses - } - public enum CodingKeys: String, CodingKey { - case walletId - case addresses - } - } - /// - Remark: Generated from `#/components/schemas/InitImportPrivateKeyIntent`. - public struct InitImportPrivateKeyIntent: Codable, Hashable, Sendable { - /// The ID of the User importing a Private Key. - /// - /// - Remark: Generated from `#/components/schemas/InitImportPrivateKeyIntent/userId`. - public var userId: Swift.String - /// Creates a new `InitImportPrivateKeyIntent`. - /// - /// - Parameters: - /// - userId: The ID of the User importing a Private Key. - public init(userId: Swift.String) { - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case userId - } - } - /// - Remark: Generated from `#/components/schemas/InitImportPrivateKeyRequest`. - public struct InitImportPrivateKeyRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/InitImportPrivateKeyRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY = "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY" - } - /// - Remark: Generated from `#/components/schemas/InitImportPrivateKeyRequest/type`. - public var _type: Components.Schemas.InitImportPrivateKeyRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/InitImportPrivateKeyRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/InitImportPrivateKeyRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/InitImportPrivateKeyRequest/parameters`. - public var parameters: Components.Schemas.InitImportPrivateKeyIntent - /// Creates a new `InitImportPrivateKeyRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.InitImportPrivateKeyRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.InitImportPrivateKeyIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/InitImportPrivateKeyResult`. - public struct InitImportPrivateKeyResult: Codable, Hashable, Sendable { - /// Import bundle containing a public key and signature to use for importing client data. - /// - /// - Remark: Generated from `#/components/schemas/InitImportPrivateKeyResult/importBundle`. - public var importBundle: Swift.String - /// Creates a new `InitImportPrivateKeyResult`. - /// - /// - Parameters: - /// - importBundle: Import bundle containing a public key and signature to use for importing client data. - public init(importBundle: Swift.String) { - self.importBundle = importBundle - } - public enum CodingKeys: String, CodingKey { - case importBundle - } - } - /// - Remark: Generated from `#/components/schemas/InitImportWalletIntent`. - public struct InitImportWalletIntent: Codable, Hashable, Sendable { - /// The ID of the User importing a Wallet. - /// - /// - Remark: Generated from `#/components/schemas/InitImportWalletIntent/userId`. - public var userId: Swift.String - /// Creates a new `InitImportWalletIntent`. - /// - /// - Parameters: - /// - userId: The ID of the User importing a Wallet. - public init(userId: Swift.String) { - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case userId - } - } - /// - Remark: Generated from `#/components/schemas/InitImportWalletRequest`. - public struct InitImportWalletRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/InitImportWalletRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_INIT_IMPORT_WALLET = "ACTIVITY_TYPE_INIT_IMPORT_WALLET" - } - /// - Remark: Generated from `#/components/schemas/InitImportWalletRequest/type`. - public var _type: Components.Schemas.InitImportWalletRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/InitImportWalletRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/InitImportWalletRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/InitImportWalletRequest/parameters`. - public var parameters: Components.Schemas.InitImportWalletIntent - /// Creates a new `InitImportWalletRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.InitImportWalletRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.InitImportWalletIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/InitImportWalletResult`. - public struct InitImportWalletResult: Codable, Hashable, Sendable { - /// Import bundle containing a public key and signature to use for importing client data. - /// - /// - Remark: Generated from `#/components/schemas/InitImportWalletResult/importBundle`. - public var importBundle: Swift.String - /// Creates a new `InitImportWalletResult`. - /// - /// - Parameters: - /// - importBundle: Import bundle containing a public key and signature to use for importing client data. - public init(importBundle: Swift.String) { - self.importBundle = importBundle - } - public enum CodingKeys: String, CodingKey { - case importBundle - } - } - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntent`. - public struct InitOtpAuthIntent: Codable, Hashable, Sendable { - /// Enum to specifiy whether to send OTP via SMS or email - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntent/otpType`. - public var otpType: Swift.String - /// Email or phone number to send the OTP code to - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntent/contact`. - public var contact: Swift.String - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntent/emailCustomization`. - public var emailCustomization: Components.Schemas.EmailCustomizationParams? - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntent/smsCustomization`. - public var smsCustomization: Components.Schemas.SmsCustomizationParams? - /// Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntent/userIdentifier`. - public var userIdentifier: Swift.String? - /// Optional custom email address from which to send the OTP email - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntent/sendFromEmailAddress`. - public var sendFromEmailAddress: Swift.String? - /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntent/sendFromEmailSenderName`. - public var sendFromEmailSenderName: Swift.String? - /// Optional custom email address to use as reply-to - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntent/replyToEmailAddress`. - public var replyToEmailAddress: Swift.String? - /// Creates a new `InitOtpAuthIntent`. - /// - /// - Parameters: - /// - otpType: Enum to specifiy whether to send OTP via SMS or email - /// - contact: Email or phone number to send the OTP code to - /// - emailCustomization: - /// - smsCustomization: - /// - userIdentifier: Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. - /// - sendFromEmailAddress: Optional custom email address from which to send the OTP email - /// - sendFromEmailSenderName: Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' - /// - replyToEmailAddress: Optional custom email address to use as reply-to - public init( - otpType: Swift.String, - contact: Swift.String, - emailCustomization: Components.Schemas.EmailCustomizationParams? = nil, - smsCustomization: Components.Schemas.SmsCustomizationParams? = nil, - userIdentifier: Swift.String? = nil, - sendFromEmailAddress: Swift.String? = nil, - sendFromEmailSenderName: Swift.String? = nil, - replyToEmailAddress: Swift.String? = nil - ) { - self.otpType = otpType - self.contact = contact - self.emailCustomization = emailCustomization - self.smsCustomization = smsCustomization - self.userIdentifier = userIdentifier - self.sendFromEmailAddress = sendFromEmailAddress - self.sendFromEmailSenderName = sendFromEmailSenderName - self.replyToEmailAddress = replyToEmailAddress - } - public enum CodingKeys: String, CodingKey { - case otpType - case contact - case emailCustomization - case smsCustomization - case userIdentifier - case sendFromEmailAddress - case sendFromEmailSenderName - case replyToEmailAddress - } - } - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntentV2`. - public struct InitOtpAuthIntentV2: Codable, Hashable, Sendable { - /// Enum to specifiy whether to send OTP via SMS or email - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntentV2/otpType`. - public var otpType: Swift.String - /// Email or phone number to send the OTP code to - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntentV2/contact`. - public var contact: Swift.String - /// Optional length of the OTP code. Default = 9 - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntentV2/otpLength`. - public var otpLength: Swift.Int32? - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntentV2/emailCustomization`. - public var emailCustomization: Components.Schemas.EmailCustomizationParams? - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntentV2/smsCustomization`. - public var smsCustomization: Components.Schemas.SmsCustomizationParams? - /// Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntentV2/userIdentifier`. - public var userIdentifier: Swift.String? - /// Optional custom email address from which to send the OTP email - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntentV2/sendFromEmailAddress`. - public var sendFromEmailAddress: Swift.String? - /// Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntentV2/alphanumeric`. - public var alphanumeric: Swift.Bool? - /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntentV2/sendFromEmailSenderName`. - public var sendFromEmailSenderName: Swift.String? - /// Optional custom email address to use as reply-to - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthIntentV2/replyToEmailAddress`. - public var replyToEmailAddress: Swift.String? - /// Creates a new `InitOtpAuthIntentV2`. - /// - /// - Parameters: - /// - otpType: Enum to specifiy whether to send OTP via SMS or email - /// - contact: Email or phone number to send the OTP code to - /// - otpLength: Optional length of the OTP code. Default = 9 - /// - emailCustomization: - /// - smsCustomization: - /// - userIdentifier: Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. - /// - sendFromEmailAddress: Optional custom email address from which to send the OTP email - /// - alphanumeric: Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true - /// - sendFromEmailSenderName: Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' - /// - replyToEmailAddress: Optional custom email address to use as reply-to - public init( - otpType: Swift.String, - contact: Swift.String, - otpLength: Swift.Int32? = nil, - emailCustomization: Components.Schemas.EmailCustomizationParams? = nil, - smsCustomization: Components.Schemas.SmsCustomizationParams? = nil, - userIdentifier: Swift.String? = nil, - sendFromEmailAddress: Swift.String? = nil, - alphanumeric: Swift.Bool? = nil, - sendFromEmailSenderName: Swift.String? = nil, - replyToEmailAddress: Swift.String? = nil - ) { - self.otpType = otpType - self.contact = contact - self.otpLength = otpLength - self.emailCustomization = emailCustomization - self.smsCustomization = smsCustomization - self.userIdentifier = userIdentifier - self.sendFromEmailAddress = sendFromEmailAddress - self.alphanumeric = alphanumeric - self.sendFromEmailSenderName = sendFromEmailSenderName - self.replyToEmailAddress = replyToEmailAddress - } - public enum CodingKeys: String, CodingKey { - case otpType - case contact - case otpLength - case emailCustomization - case smsCustomization - case userIdentifier - case sendFromEmailAddress - case alphanumeric - case sendFromEmailSenderName - case replyToEmailAddress - } - } - /// - Remark: Generated from `#/components/schemas/InitOtpAuthRequest`. - public struct InitOtpAuthRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/InitOtpAuthRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_INIT_OTP_AUTH_V2 = "ACTIVITY_TYPE_INIT_OTP_AUTH_V2" - } - /// - Remark: Generated from `#/components/schemas/InitOtpAuthRequest/type`. - public var _type: Components.Schemas.InitOtpAuthRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/InitOtpAuthRequest/parameters`. - public var parameters: Components.Schemas.InitOtpAuthIntentV2 - /// Creates a new `InitOtpAuthRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.InitOtpAuthRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.InitOtpAuthIntentV2 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/InitOtpAuthResult`. - public struct InitOtpAuthResult: Codable, Hashable, Sendable { - /// Unique identifier for an OTP authentication - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthResult/otpId`. - public var otpId: Swift.String - /// Creates a new `InitOtpAuthResult`. - /// - /// - Parameters: - /// - otpId: Unique identifier for an OTP authentication - public init(otpId: Swift.String) { - self.otpId = otpId - } - public enum CodingKeys: String, CodingKey { - case otpId - } - } - /// - Remark: Generated from `#/components/schemas/InitOtpAuthResultV2`. - public struct InitOtpAuthResultV2: Codable, Hashable, Sendable { - /// Unique identifier for an OTP authentication - /// - /// - Remark: Generated from `#/components/schemas/InitOtpAuthResultV2/otpId`. - public var otpId: Swift.String - /// Creates a new `InitOtpAuthResultV2`. - /// - /// - Parameters: - /// - otpId: Unique identifier for an OTP authentication - public init(otpId: Swift.String) { - self.otpId = otpId - } - public enum CodingKeys: String, CodingKey { - case otpId - } - } - /// - Remark: Generated from `#/components/schemas/InitOtpIntent`. - public struct InitOtpIntent: Codable, Hashable, Sendable { - /// Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL - /// - /// - Remark: Generated from `#/components/schemas/InitOtpIntent/otpType`. - public var otpType: Swift.String - /// Email or phone number to send the OTP code to - /// - /// - Remark: Generated from `#/components/schemas/InitOtpIntent/contact`. - public var contact: Swift.String - /// Optional length of the OTP code. Default = 9 - /// - /// - Remark: Generated from `#/components/schemas/InitOtpIntent/otpLength`. - public var otpLength: Swift.Int32? - /// - Remark: Generated from `#/components/schemas/InitOtpIntent/emailCustomization`. - public var emailCustomization: Components.Schemas.EmailCustomizationParams? - /// - Remark: Generated from `#/components/schemas/InitOtpIntent/smsCustomization`. - public var smsCustomization: Components.Schemas.SmsCustomizationParams? - /// Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. - /// - /// - Remark: Generated from `#/components/schemas/InitOtpIntent/userIdentifier`. - public var userIdentifier: Swift.String? - /// Optional custom email address from which to send the OTP email - /// - /// - Remark: Generated from `#/components/schemas/InitOtpIntent/sendFromEmailAddress`. - public var sendFromEmailAddress: Swift.String? - /// Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true - /// - /// - Remark: Generated from `#/components/schemas/InitOtpIntent/alphanumeric`. - public var alphanumeric: Swift.Bool? - /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' - /// - /// - Remark: Generated from `#/components/schemas/InitOtpIntent/sendFromEmailSenderName`. - public var sendFromEmailSenderName: Swift.String? - /// Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes) - /// - /// - Remark: Generated from `#/components/schemas/InitOtpIntent/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Optional custom email address to use as reply-to - /// - /// - Remark: Generated from `#/components/schemas/InitOtpIntent/replyToEmailAddress`. - public var replyToEmailAddress: Swift.String? - /// Creates a new `InitOtpIntent`. - /// - /// - Parameters: - /// - otpType: Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL - /// - contact: Email or phone number to send the OTP code to - /// - otpLength: Optional length of the OTP code. Default = 9 - /// - emailCustomization: - /// - smsCustomization: - /// - userIdentifier: Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. - /// - sendFromEmailAddress: Optional custom email address from which to send the OTP email - /// - alphanumeric: Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true - /// - sendFromEmailSenderName: Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' - /// - expirationSeconds: Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes) - /// - replyToEmailAddress: Optional custom email address to use as reply-to - public init( - otpType: Swift.String, - contact: Swift.String, - otpLength: Swift.Int32? = nil, - emailCustomization: Components.Schemas.EmailCustomizationParams? = nil, - smsCustomization: Components.Schemas.SmsCustomizationParams? = nil, - userIdentifier: Swift.String? = nil, - sendFromEmailAddress: Swift.String? = nil, - alphanumeric: Swift.Bool? = nil, - sendFromEmailSenderName: Swift.String? = nil, - expirationSeconds: Swift.String? = nil, - replyToEmailAddress: Swift.String? = nil - ) { - self.otpType = otpType - self.contact = contact - self.otpLength = otpLength - self.emailCustomization = emailCustomization - self.smsCustomization = smsCustomization - self.userIdentifier = userIdentifier - self.sendFromEmailAddress = sendFromEmailAddress - self.alphanumeric = alphanumeric - self.sendFromEmailSenderName = sendFromEmailSenderName - self.expirationSeconds = expirationSeconds - self.replyToEmailAddress = replyToEmailAddress - } - public enum CodingKeys: String, CodingKey { - case otpType - case contact - case otpLength - case emailCustomization - case smsCustomization - case userIdentifier - case sendFromEmailAddress - case alphanumeric - case sendFromEmailSenderName - case expirationSeconds - case replyToEmailAddress - } - } - /// - Remark: Generated from `#/components/schemas/InitOtpRequest`. - public struct InitOtpRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/InitOtpRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_INIT_OTP = "ACTIVITY_TYPE_INIT_OTP" - } - /// - Remark: Generated from `#/components/schemas/InitOtpRequest/type`. - public var _type: Components.Schemas.InitOtpRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/InitOtpRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/InitOtpRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/InitOtpRequest/parameters`. - public var parameters: Components.Schemas.InitOtpIntent - /// Creates a new `InitOtpRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.InitOtpRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.InitOtpIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/InitOtpResult`. - public struct InitOtpResult: Codable, Hashable, Sendable { - /// Unique identifier for an OTP authentication - /// - /// - Remark: Generated from `#/components/schemas/InitOtpResult/otpId`. - public var otpId: Swift.String - /// Creates a new `InitOtpResult`. - /// - /// - Parameters: - /// - otpId: Unique identifier for an OTP authentication - public init(otpId: Swift.String) { - self.otpId = otpId - } - public enum CodingKeys: String, CodingKey { - case otpId - } - } - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryIntent`. - public struct InitUserEmailRecoveryIntent: Codable, Hashable, Sendable { - /// Email of the user starting recovery - /// - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryIntent/email`. - public var email: Swift.String - /// Client-side public key generated by the user, to which the recovery bundle will be encrypted. - /// - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryIntent/targetPublicKey`. - public var targetPublicKey: Swift.String - /// Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used. - /// - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryIntent/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryIntent/emailCustomization`. - public var emailCustomization: Components.Schemas.EmailCustomizationParams? - /// Creates a new `InitUserEmailRecoveryIntent`. - /// - /// - Parameters: - /// - email: Email of the user starting recovery - /// - targetPublicKey: Client-side public key generated by the user, to which the recovery bundle will be encrypted. - /// - expirationSeconds: Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used. - /// - emailCustomization: - public init( - email: Swift.String, - targetPublicKey: Swift.String, - expirationSeconds: Swift.String? = nil, - emailCustomization: Components.Schemas.EmailCustomizationParams? = nil - ) { - self.email = email - self.targetPublicKey = targetPublicKey - self.expirationSeconds = expirationSeconds - self.emailCustomization = emailCustomization - } - public enum CodingKeys: String, CodingKey { - case email - case targetPublicKey - case expirationSeconds - case emailCustomization - } - } - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryRequest`. - public struct InitUserEmailRecoveryRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY = "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY" - } - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryRequest/type`. - public var _type: Components.Schemas.InitUserEmailRecoveryRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryRequest/parameters`. - public var parameters: Components.Schemas.InitUserEmailRecoveryIntent - /// Creates a new `InitUserEmailRecoveryRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.InitUserEmailRecoveryRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.InitUserEmailRecoveryIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryResult`. - public struct InitUserEmailRecoveryResult: Codable, Hashable, Sendable { - /// Unique identifier for the user being recovered. - /// - /// - Remark: Generated from `#/components/schemas/InitUserEmailRecoveryResult/userId`. - public var userId: Swift.String - /// Creates a new `InitUserEmailRecoveryResult`. - /// - /// - Parameters: - /// - userId: Unique identifier for the user being recovered. - public init(userId: Swift.String) { - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case userId - } - } - /// - Remark: Generated from `#/components/schemas/Intent`. - public struct Intent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Intent/createOrganizationIntent`. - public var createOrganizationIntent: Components.Schemas.CreateOrganizationIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createAuthenticatorsIntent`. - public var createAuthenticatorsIntent: Components.Schemas.CreateAuthenticatorsIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createUsersIntent`. - public var createUsersIntent: Components.Schemas.CreateUsersIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createPrivateKeysIntent`. - public var createPrivateKeysIntent: Components.Schemas.CreatePrivateKeysIntent? - /// - Remark: Generated from `#/components/schemas/Intent/signRawPayloadIntent`. - public var signRawPayloadIntent: Components.Schemas.SignRawPayloadIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createInvitationsIntent`. - public var createInvitationsIntent: Components.Schemas.CreateInvitationsIntent? - /// - Remark: Generated from `#/components/schemas/Intent/acceptInvitationIntent`. - public var acceptInvitationIntent: Components.Schemas.AcceptInvitationIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createPolicyIntent`. - public var createPolicyIntent: Components.Schemas.CreatePolicyIntent? - /// - Remark: Generated from `#/components/schemas/Intent/disablePrivateKeyIntent`. - public var disablePrivateKeyIntent: Components.Schemas.DisablePrivateKeyIntent? - /// - Remark: Generated from `#/components/schemas/Intent/deleteUsersIntent`. - public var deleteUsersIntent: Components.Schemas.DeleteUsersIntent? - /// - Remark: Generated from `#/components/schemas/Intent/deleteAuthenticatorsIntent`. - public var deleteAuthenticatorsIntent: Components.Schemas.DeleteAuthenticatorsIntent? - /// - Remark: Generated from `#/components/schemas/Intent/deleteInvitationIntent`. - public var deleteInvitationIntent: Components.Schemas.DeleteInvitationIntent? - /// - Remark: Generated from `#/components/schemas/Intent/deleteOrganizationIntent`. - public var deleteOrganizationIntent: Components.Schemas.DeleteOrganizationIntent? - /// - Remark: Generated from `#/components/schemas/Intent/deletePolicyIntent`. - public var deletePolicyIntent: Components.Schemas.DeletePolicyIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createUserTagIntent`. - public var createUserTagIntent: Components.Schemas.CreateUserTagIntent? - /// - Remark: Generated from `#/components/schemas/Intent/deleteUserTagsIntent`. - public var deleteUserTagsIntent: Components.Schemas.DeleteUserTagsIntent? - /// - Remark: Generated from `#/components/schemas/Intent/signTransactionIntent`. - public var signTransactionIntent: Components.Schemas.SignTransactionIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createApiKeysIntent`. - public var createApiKeysIntent: Components.Schemas.CreateApiKeysIntent? - /// - Remark: Generated from `#/components/schemas/Intent/deleteApiKeysIntent`. - public var deleteApiKeysIntent: Components.Schemas.DeleteApiKeysIntent? - /// - Remark: Generated from `#/components/schemas/Intent/approveActivityIntent`. - public var approveActivityIntent: Components.Schemas.ApproveActivityIntent? - /// - Remark: Generated from `#/components/schemas/Intent/rejectActivityIntent`. - public var rejectActivityIntent: Components.Schemas.RejectActivityIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createPrivateKeyTagIntent`. - public var createPrivateKeyTagIntent: Components.Schemas.CreatePrivateKeyTagIntent? - /// - Remark: Generated from `#/components/schemas/Intent/deletePrivateKeyTagsIntent`. - public var deletePrivateKeyTagsIntent: Components.Schemas.DeletePrivateKeyTagsIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createPolicyIntentV2`. - public var createPolicyIntentV2: Components.Schemas.CreatePolicyIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/setPaymentMethodIntent`. - public var setPaymentMethodIntent: Components.Schemas.SetPaymentMethodIntent? - /// - Remark: Generated from `#/components/schemas/Intent/activateBillingTierIntent`. - public var activateBillingTierIntent: Components.Schemas.ActivateBillingTierIntent? - /// - Remark: Generated from `#/components/schemas/Intent/deletePaymentMethodIntent`. - public var deletePaymentMethodIntent: Components.Schemas.DeletePaymentMethodIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createPolicyIntentV3`. - public var createPolicyIntentV3: Components.Schemas.CreatePolicyIntentV3? - /// - Remark: Generated from `#/components/schemas/Intent/createApiOnlyUsersIntent`. - public var createApiOnlyUsersIntent: Components.Schemas.CreateApiOnlyUsersIntent? - /// - Remark: Generated from `#/components/schemas/Intent/updateRootQuorumIntent`. - public var updateRootQuorumIntent: Components.Schemas.UpdateRootQuorumIntent? - /// - Remark: Generated from `#/components/schemas/Intent/updateUserTagIntent`. - public var updateUserTagIntent: Components.Schemas.UpdateUserTagIntent? - /// - Remark: Generated from `#/components/schemas/Intent/updatePrivateKeyTagIntent`. - public var updatePrivateKeyTagIntent: Components.Schemas.UpdatePrivateKeyTagIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createAuthenticatorsIntentV2`. - public var createAuthenticatorsIntentV2: Components.Schemas.CreateAuthenticatorsIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/acceptInvitationIntentV2`. - public var acceptInvitationIntentV2: Components.Schemas.AcceptInvitationIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/createOrganizationIntentV2`. - public var createOrganizationIntentV2: Components.Schemas.CreateOrganizationIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/createUsersIntentV2`. - public var createUsersIntentV2: Components.Schemas.CreateUsersIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/createSubOrganizationIntent`. - public var createSubOrganizationIntent: Components.Schemas.CreateSubOrganizationIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createSubOrganizationIntentV2`. - public var createSubOrganizationIntentV2: Components.Schemas.CreateSubOrganizationIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/updateAllowedOriginsIntent`. - public var updateAllowedOriginsIntent: Components.Schemas.UpdateAllowedOriginsIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createPrivateKeysIntentV2`. - public var createPrivateKeysIntentV2: Components.Schemas.CreatePrivateKeysIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/updateUserIntent`. - public var updateUserIntent: Components.Schemas.UpdateUserIntent? - /// - Remark: Generated from `#/components/schemas/Intent/updatePolicyIntent`. - public var updatePolicyIntent: Components.Schemas.UpdatePolicyIntent? - /// - Remark: Generated from `#/components/schemas/Intent/setPaymentMethodIntentV2`. - public var setPaymentMethodIntentV2: Components.Schemas.SetPaymentMethodIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/createSubOrganizationIntentV3`. - public var createSubOrganizationIntentV3: Components.Schemas.CreateSubOrganizationIntentV3? - /// - Remark: Generated from `#/components/schemas/Intent/createWalletIntent`. - public var createWalletIntent: Components.Schemas.CreateWalletIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createWalletAccountsIntent`. - public var createWalletAccountsIntent: Components.Schemas.CreateWalletAccountsIntent? - /// - Remark: Generated from `#/components/schemas/Intent/initUserEmailRecoveryIntent`. - public var initUserEmailRecoveryIntent: Components.Schemas.InitUserEmailRecoveryIntent? - /// - Remark: Generated from `#/components/schemas/Intent/recoverUserIntent`. - public var recoverUserIntent: Components.Schemas.RecoverUserIntent? - /// - Remark: Generated from `#/components/schemas/Intent/setOrganizationFeatureIntent`. - public var setOrganizationFeatureIntent: Components.Schemas.SetOrganizationFeatureIntent? - /// - Remark: Generated from `#/components/schemas/Intent/removeOrganizationFeatureIntent`. - public var removeOrganizationFeatureIntent: - Components.Schemas.RemoveOrganizationFeatureIntent? - /// - Remark: Generated from `#/components/schemas/Intent/signRawPayloadIntentV2`. - public var signRawPayloadIntentV2: Components.Schemas.SignRawPayloadIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/signTransactionIntentV2`. - public var signTransactionIntentV2: Components.Schemas.SignTransactionIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/exportPrivateKeyIntent`. - public var exportPrivateKeyIntent: Components.Schemas.ExportPrivateKeyIntent? - /// - Remark: Generated from `#/components/schemas/Intent/exportWalletIntent`. - public var exportWalletIntent: Components.Schemas.ExportWalletIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createSubOrganizationIntentV4`. - public var createSubOrganizationIntentV4: Components.Schemas.CreateSubOrganizationIntentV4? - /// - Remark: Generated from `#/components/schemas/Intent/emailAuthIntent`. - public var emailAuthIntent: Components.Schemas.EmailAuthIntent? - /// - Remark: Generated from `#/components/schemas/Intent/exportWalletAccountIntent`. - public var exportWalletAccountIntent: Components.Schemas.ExportWalletAccountIntent? - /// - Remark: Generated from `#/components/schemas/Intent/initImportWalletIntent`. - public var initImportWalletIntent: Components.Schemas.InitImportWalletIntent? - /// - Remark: Generated from `#/components/schemas/Intent/importWalletIntent`. - public var importWalletIntent: Components.Schemas.ImportWalletIntent? - /// - Remark: Generated from `#/components/schemas/Intent/initImportPrivateKeyIntent`. - public var initImportPrivateKeyIntent: Components.Schemas.InitImportPrivateKeyIntent? - /// - Remark: Generated from `#/components/schemas/Intent/importPrivateKeyIntent`. - public var importPrivateKeyIntent: Components.Schemas.ImportPrivateKeyIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createPoliciesIntent`. - public var createPoliciesIntent: Components.Schemas.CreatePoliciesIntent? - /// - Remark: Generated from `#/components/schemas/Intent/signRawPayloadsIntent`. - public var signRawPayloadsIntent: Components.Schemas.SignRawPayloadsIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createReadOnlySessionIntent`. - public var createReadOnlySessionIntent: Components.Schemas.CreateReadOnlySessionIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createOauthProvidersIntent`. - public var createOauthProvidersIntent: Components.Schemas.CreateOauthProvidersIntent? - /// - Remark: Generated from `#/components/schemas/Intent/deleteOauthProvidersIntent`. - public var deleteOauthProvidersIntent: Components.Schemas.DeleteOauthProvidersIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createSubOrganizationIntentV5`. - public var createSubOrganizationIntentV5: Components.Schemas.CreateSubOrganizationIntentV5? - /// - Remark: Generated from `#/components/schemas/Intent/oauthIntent`. - public var oauthIntent: Components.Schemas.OauthIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createApiKeysIntentV2`. - public var createApiKeysIntentV2: Components.Schemas.CreateApiKeysIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/createReadWriteSessionIntent`. - public var createReadWriteSessionIntent: Components.Schemas.CreateReadWriteSessionIntent? - /// - Remark: Generated from `#/components/schemas/Intent/emailAuthIntentV2`. - public var emailAuthIntentV2: Components.Schemas.EmailAuthIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/createSubOrganizationIntentV6`. - public var createSubOrganizationIntentV6: Components.Schemas.CreateSubOrganizationIntentV6? - /// - Remark: Generated from `#/components/schemas/Intent/deletePrivateKeysIntent`. - public var deletePrivateKeysIntent: Components.Schemas.DeletePrivateKeysIntent? - /// - Remark: Generated from `#/components/schemas/Intent/deleteWalletsIntent`. - public var deleteWalletsIntent: Components.Schemas.DeleteWalletsIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createReadWriteSessionIntentV2`. - public var createReadWriteSessionIntentV2: Components.Schemas.CreateReadWriteSessionIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/deleteSubOrganizationIntent`. - public var deleteSubOrganizationIntent: Components.Schemas.DeleteSubOrganizationIntent? - /// - Remark: Generated from `#/components/schemas/Intent/initOtpAuthIntent`. - public var initOtpAuthIntent: Components.Schemas.InitOtpAuthIntent? - /// - Remark: Generated from `#/components/schemas/Intent/otpAuthIntent`. - public var otpAuthIntent: Components.Schemas.OtpAuthIntent? - /// - Remark: Generated from `#/components/schemas/Intent/createSubOrganizationIntentV7`. - public var createSubOrganizationIntentV7: Components.Schemas.CreateSubOrganizationIntentV7? - /// - Remark: Generated from `#/components/schemas/Intent/updateWalletIntent`. - public var updateWalletIntent: Components.Schemas.UpdateWalletIntent? - /// - Remark: Generated from `#/components/schemas/Intent/updatePolicyIntentV2`. - public var updatePolicyIntentV2: Components.Schemas.UpdatePolicyIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/createUsersIntentV3`. - public var createUsersIntentV3: Components.Schemas.CreateUsersIntentV3? - /// - Remark: Generated from `#/components/schemas/Intent/initOtpAuthIntentV2`. - public var initOtpAuthIntentV2: Components.Schemas.InitOtpAuthIntentV2? - /// - Remark: Generated from `#/components/schemas/Intent/initOtpIntent`. - public var initOtpIntent: Components.Schemas.InitOtpIntent? - /// - Remark: Generated from `#/components/schemas/Intent/verifyOtpIntent`. - public var verifyOtpIntent: Components.Schemas.VerifyOtpIntent? - /// - Remark: Generated from `#/components/schemas/Intent/otpLoginIntent`. - public var otpLoginIntent: Components.Schemas.OtpLoginIntent? - /// - Remark: Generated from `#/components/schemas/Intent/stampLoginIntent`. - public var stampLoginIntent: Components.Schemas.StampLoginIntent? - /// - Remark: Generated from `#/components/schemas/Intent/oauthLoginIntent`. - public var oauthLoginIntent: Components.Schemas.OauthLoginIntent? - /// - Remark: Generated from `#/components/schemas/Intent/updateUserNameIntent`. - public var updateUserNameIntent: Components.Schemas.UpdateUserNameIntent? - /// - Remark: Generated from `#/components/schemas/Intent/updateUserEmailIntent`. - public var updateUserEmailIntent: Components.Schemas.UpdateUserEmailIntent? - /// - Remark: Generated from `#/components/schemas/Intent/updateUserPhoneNumberIntent`. - public var updateUserPhoneNumberIntent: Components.Schemas.UpdateUserPhoneNumberIntent? - /// Creates a new `Intent`. - /// - /// - Parameters: - /// - createOrganizationIntent: - /// - createAuthenticatorsIntent: - /// - createUsersIntent: - /// - createPrivateKeysIntent: - /// - signRawPayloadIntent: - /// - createInvitationsIntent: - /// - acceptInvitationIntent: - /// - createPolicyIntent: - /// - disablePrivateKeyIntent: - /// - deleteUsersIntent: - /// - deleteAuthenticatorsIntent: - /// - deleteInvitationIntent: - /// - deleteOrganizationIntent: - /// - deletePolicyIntent: - /// - createUserTagIntent: - /// - deleteUserTagsIntent: - /// - signTransactionIntent: - /// - createApiKeysIntent: - /// - deleteApiKeysIntent: - /// - approveActivityIntent: - /// - rejectActivityIntent: - /// - createPrivateKeyTagIntent: - /// - deletePrivateKeyTagsIntent: - /// - createPolicyIntentV2: - /// - setPaymentMethodIntent: - /// - activateBillingTierIntent: - /// - deletePaymentMethodIntent: - /// - createPolicyIntentV3: - /// - createApiOnlyUsersIntent: - /// - updateRootQuorumIntent: - /// - updateUserTagIntent: - /// - updatePrivateKeyTagIntent: - /// - createAuthenticatorsIntentV2: - /// - acceptInvitationIntentV2: - /// - createOrganizationIntentV2: - /// - createUsersIntentV2: - /// - createSubOrganizationIntent: - /// - createSubOrganizationIntentV2: - /// - updateAllowedOriginsIntent: - /// - createPrivateKeysIntentV2: - /// - updateUserIntent: - /// - updatePolicyIntent: - /// - setPaymentMethodIntentV2: - /// - createSubOrganizationIntentV3: - /// - createWalletIntent: - /// - createWalletAccountsIntent: - /// - initUserEmailRecoveryIntent: - /// - recoverUserIntent: - /// - setOrganizationFeatureIntent: - /// - removeOrganizationFeatureIntent: - /// - signRawPayloadIntentV2: - /// - signTransactionIntentV2: - /// - exportPrivateKeyIntent: - /// - exportWalletIntent: - /// - createSubOrganizationIntentV4: - /// - emailAuthIntent: - /// - exportWalletAccountIntent: - /// - initImportWalletIntent: - /// - importWalletIntent: - /// - initImportPrivateKeyIntent: - /// - importPrivateKeyIntent: - /// - createPoliciesIntent: - /// - signRawPayloadsIntent: - /// - createReadOnlySessionIntent: - /// - createOauthProvidersIntent: - /// - deleteOauthProvidersIntent: - /// - createSubOrganizationIntentV5: - /// - oauthIntent: - /// - createApiKeysIntentV2: - /// - createReadWriteSessionIntent: - /// - emailAuthIntentV2: - /// - createSubOrganizationIntentV6: - /// - deletePrivateKeysIntent: - /// - deleteWalletsIntent: - /// - createReadWriteSessionIntentV2: - /// - deleteSubOrganizationIntent: - /// - initOtpAuthIntent: - /// - otpAuthIntent: - /// - createSubOrganizationIntentV7: - /// - updateWalletIntent: - /// - updatePolicyIntentV2: - /// - createUsersIntentV3: - /// - initOtpAuthIntentV2: - /// - initOtpIntent: - /// - verifyOtpIntent: - /// - otpLoginIntent: - /// - stampLoginIntent: - /// - oauthLoginIntent: - /// - updateUserNameIntent: - /// - updateUserEmailIntent: - /// - updateUserPhoneNumberIntent: - public init( - createOrganizationIntent: Components.Schemas.CreateOrganizationIntent? = nil, - createAuthenticatorsIntent: Components.Schemas.CreateAuthenticatorsIntent? = nil, - createUsersIntent: Components.Schemas.CreateUsersIntent? = nil, - createPrivateKeysIntent: Components.Schemas.CreatePrivateKeysIntent? = nil, - signRawPayloadIntent: Components.Schemas.SignRawPayloadIntent? = nil, - createInvitationsIntent: Components.Schemas.CreateInvitationsIntent? = nil, - acceptInvitationIntent: Components.Schemas.AcceptInvitationIntent? = nil, - createPolicyIntent: Components.Schemas.CreatePolicyIntent? = nil, - disablePrivateKeyIntent: Components.Schemas.DisablePrivateKeyIntent? = nil, - deleteUsersIntent: Components.Schemas.DeleteUsersIntent? = nil, - deleteAuthenticatorsIntent: Components.Schemas.DeleteAuthenticatorsIntent? = nil, - deleteInvitationIntent: Components.Schemas.DeleteInvitationIntent? = nil, - deleteOrganizationIntent: Components.Schemas.DeleteOrganizationIntent? = nil, - deletePolicyIntent: Components.Schemas.DeletePolicyIntent? = nil, - createUserTagIntent: Components.Schemas.CreateUserTagIntent? = nil, - deleteUserTagsIntent: Components.Schemas.DeleteUserTagsIntent? = nil, - signTransactionIntent: Components.Schemas.SignTransactionIntent? = nil, - createApiKeysIntent: Components.Schemas.CreateApiKeysIntent? = nil, - deleteApiKeysIntent: Components.Schemas.DeleteApiKeysIntent? = nil, - approveActivityIntent: Components.Schemas.ApproveActivityIntent? = nil, - rejectActivityIntent: Components.Schemas.RejectActivityIntent? = nil, - createPrivateKeyTagIntent: Components.Schemas.CreatePrivateKeyTagIntent? = nil, - deletePrivateKeyTagsIntent: Components.Schemas.DeletePrivateKeyTagsIntent? = nil, - createPolicyIntentV2: Components.Schemas.CreatePolicyIntentV2? = nil, - setPaymentMethodIntent: Components.Schemas.SetPaymentMethodIntent? = nil, - activateBillingTierIntent: Components.Schemas.ActivateBillingTierIntent? = nil, - deletePaymentMethodIntent: Components.Schemas.DeletePaymentMethodIntent? = nil, - createPolicyIntentV3: Components.Schemas.CreatePolicyIntentV3? = nil, - createApiOnlyUsersIntent: Components.Schemas.CreateApiOnlyUsersIntent? = nil, - updateRootQuorumIntent: Components.Schemas.UpdateRootQuorumIntent? = nil, - updateUserTagIntent: Components.Schemas.UpdateUserTagIntent? = nil, - updatePrivateKeyTagIntent: Components.Schemas.UpdatePrivateKeyTagIntent? = nil, - createAuthenticatorsIntentV2: Components.Schemas.CreateAuthenticatorsIntentV2? = nil, - acceptInvitationIntentV2: Components.Schemas.AcceptInvitationIntentV2? = nil, - createOrganizationIntentV2: Components.Schemas.CreateOrganizationIntentV2? = nil, - createUsersIntentV2: Components.Schemas.CreateUsersIntentV2? = nil, - createSubOrganizationIntent: Components.Schemas.CreateSubOrganizationIntent? = nil, - createSubOrganizationIntentV2: Components.Schemas.CreateSubOrganizationIntentV2? = nil, - updateAllowedOriginsIntent: Components.Schemas.UpdateAllowedOriginsIntent? = nil, - createPrivateKeysIntentV2: Components.Schemas.CreatePrivateKeysIntentV2? = nil, - updateUserIntent: Components.Schemas.UpdateUserIntent? = nil, - updatePolicyIntent: Components.Schemas.UpdatePolicyIntent? = nil, - setPaymentMethodIntentV2: Components.Schemas.SetPaymentMethodIntentV2? = nil, - createSubOrganizationIntentV3: Components.Schemas.CreateSubOrganizationIntentV3? = nil, - createWalletIntent: Components.Schemas.CreateWalletIntent? = nil, - createWalletAccountsIntent: Components.Schemas.CreateWalletAccountsIntent? = nil, - initUserEmailRecoveryIntent: Components.Schemas.InitUserEmailRecoveryIntent? = nil, - recoverUserIntent: Components.Schemas.RecoverUserIntent? = nil, - setOrganizationFeatureIntent: Components.Schemas.SetOrganizationFeatureIntent? = nil, - removeOrganizationFeatureIntent: Components.Schemas.RemoveOrganizationFeatureIntent? = nil, - signRawPayloadIntentV2: Components.Schemas.SignRawPayloadIntentV2? = nil, - signTransactionIntentV2: Components.Schemas.SignTransactionIntentV2? = nil, - exportPrivateKeyIntent: Components.Schemas.ExportPrivateKeyIntent? = nil, - exportWalletIntent: Components.Schemas.ExportWalletIntent? = nil, - createSubOrganizationIntentV4: Components.Schemas.CreateSubOrganizationIntentV4? = nil, - emailAuthIntent: Components.Schemas.EmailAuthIntent? = nil, - exportWalletAccountIntent: Components.Schemas.ExportWalletAccountIntent? = nil, - initImportWalletIntent: Components.Schemas.InitImportWalletIntent? = nil, - importWalletIntent: Components.Schemas.ImportWalletIntent? = nil, - initImportPrivateKeyIntent: Components.Schemas.InitImportPrivateKeyIntent? = nil, - importPrivateKeyIntent: Components.Schemas.ImportPrivateKeyIntent? = nil, - createPoliciesIntent: Components.Schemas.CreatePoliciesIntent? = nil, - signRawPayloadsIntent: Components.Schemas.SignRawPayloadsIntent? = nil, - createReadOnlySessionIntent: Components.Schemas.CreateReadOnlySessionIntent? = nil, - createOauthProvidersIntent: Components.Schemas.CreateOauthProvidersIntent? = nil, - deleteOauthProvidersIntent: Components.Schemas.DeleteOauthProvidersIntent? = nil, - createSubOrganizationIntentV5: Components.Schemas.CreateSubOrganizationIntentV5? = nil, - oauthIntent: Components.Schemas.OauthIntent? = nil, - createApiKeysIntentV2: Components.Schemas.CreateApiKeysIntentV2? = nil, - createReadWriteSessionIntent: Components.Schemas.CreateReadWriteSessionIntent? = nil, - emailAuthIntentV2: Components.Schemas.EmailAuthIntentV2? = nil, - createSubOrganizationIntentV6: Components.Schemas.CreateSubOrganizationIntentV6? = nil, - deletePrivateKeysIntent: Components.Schemas.DeletePrivateKeysIntent? = nil, - deleteWalletsIntent: Components.Schemas.DeleteWalletsIntent? = nil, - createReadWriteSessionIntentV2: Components.Schemas.CreateReadWriteSessionIntentV2? = nil, - deleteSubOrganizationIntent: Components.Schemas.DeleteSubOrganizationIntent? = nil, - initOtpAuthIntent: Components.Schemas.InitOtpAuthIntent? = nil, - otpAuthIntent: Components.Schemas.OtpAuthIntent? = nil, - createSubOrganizationIntentV7: Components.Schemas.CreateSubOrganizationIntentV7? = nil, - updateWalletIntent: Components.Schemas.UpdateWalletIntent? = nil, - updatePolicyIntentV2: Components.Schemas.UpdatePolicyIntentV2? = nil, - createUsersIntentV3: Components.Schemas.CreateUsersIntentV3? = nil, - initOtpAuthIntentV2: Components.Schemas.InitOtpAuthIntentV2? = nil, - initOtpIntent: Components.Schemas.InitOtpIntent? = nil, - verifyOtpIntent: Components.Schemas.VerifyOtpIntent? = nil, - otpLoginIntent: Components.Schemas.OtpLoginIntent? = nil, - stampLoginIntent: Components.Schemas.StampLoginIntent? = nil, - oauthLoginIntent: Components.Schemas.OauthLoginIntent? = nil, - updateUserNameIntent: Components.Schemas.UpdateUserNameIntent? = nil, - updateUserEmailIntent: Components.Schemas.UpdateUserEmailIntent? = nil, - updateUserPhoneNumberIntent: Components.Schemas.UpdateUserPhoneNumberIntent? = nil - ) { - self.createOrganizationIntent = createOrganizationIntent - self.createAuthenticatorsIntent = createAuthenticatorsIntent - self.createUsersIntent = createUsersIntent - self.createPrivateKeysIntent = createPrivateKeysIntent - self.signRawPayloadIntent = signRawPayloadIntent - self.createInvitationsIntent = createInvitationsIntent - self.acceptInvitationIntent = acceptInvitationIntent - self.createPolicyIntent = createPolicyIntent - self.disablePrivateKeyIntent = disablePrivateKeyIntent - self.deleteUsersIntent = deleteUsersIntent - self.deleteAuthenticatorsIntent = deleteAuthenticatorsIntent - self.deleteInvitationIntent = deleteInvitationIntent - self.deleteOrganizationIntent = deleteOrganizationIntent - self.deletePolicyIntent = deletePolicyIntent - self.createUserTagIntent = createUserTagIntent - self.deleteUserTagsIntent = deleteUserTagsIntent - self.signTransactionIntent = signTransactionIntent - self.createApiKeysIntent = createApiKeysIntent - self.deleteApiKeysIntent = deleteApiKeysIntent - self.approveActivityIntent = approveActivityIntent - self.rejectActivityIntent = rejectActivityIntent - self.createPrivateKeyTagIntent = createPrivateKeyTagIntent - self.deletePrivateKeyTagsIntent = deletePrivateKeyTagsIntent - self.createPolicyIntentV2 = createPolicyIntentV2 - self.setPaymentMethodIntent = setPaymentMethodIntent - self.activateBillingTierIntent = activateBillingTierIntent - self.deletePaymentMethodIntent = deletePaymentMethodIntent - self.createPolicyIntentV3 = createPolicyIntentV3 - self.createApiOnlyUsersIntent = createApiOnlyUsersIntent - self.updateRootQuorumIntent = updateRootQuorumIntent - self.updateUserTagIntent = updateUserTagIntent - self.updatePrivateKeyTagIntent = updatePrivateKeyTagIntent - self.createAuthenticatorsIntentV2 = createAuthenticatorsIntentV2 - self.acceptInvitationIntentV2 = acceptInvitationIntentV2 - self.createOrganizationIntentV2 = createOrganizationIntentV2 - self.createUsersIntentV2 = createUsersIntentV2 - self.createSubOrganizationIntent = createSubOrganizationIntent - self.createSubOrganizationIntentV2 = createSubOrganizationIntentV2 - self.updateAllowedOriginsIntent = updateAllowedOriginsIntent - self.createPrivateKeysIntentV2 = createPrivateKeysIntentV2 - self.updateUserIntent = updateUserIntent - self.updatePolicyIntent = updatePolicyIntent - self.setPaymentMethodIntentV2 = setPaymentMethodIntentV2 - self.createSubOrganizationIntentV3 = createSubOrganizationIntentV3 - self.createWalletIntent = createWalletIntent - self.createWalletAccountsIntent = createWalletAccountsIntent - self.initUserEmailRecoveryIntent = initUserEmailRecoveryIntent - self.recoverUserIntent = recoverUserIntent - self.setOrganizationFeatureIntent = setOrganizationFeatureIntent - self.removeOrganizationFeatureIntent = removeOrganizationFeatureIntent - self.signRawPayloadIntentV2 = signRawPayloadIntentV2 - self.signTransactionIntentV2 = signTransactionIntentV2 - self.exportPrivateKeyIntent = exportPrivateKeyIntent - self.exportWalletIntent = exportWalletIntent - self.createSubOrganizationIntentV4 = createSubOrganizationIntentV4 - self.emailAuthIntent = emailAuthIntent - self.exportWalletAccountIntent = exportWalletAccountIntent - self.initImportWalletIntent = initImportWalletIntent - self.importWalletIntent = importWalletIntent - self.initImportPrivateKeyIntent = initImportPrivateKeyIntent - self.importPrivateKeyIntent = importPrivateKeyIntent - self.createPoliciesIntent = createPoliciesIntent - self.signRawPayloadsIntent = signRawPayloadsIntent - self.createReadOnlySessionIntent = createReadOnlySessionIntent - self.createOauthProvidersIntent = createOauthProvidersIntent - self.deleteOauthProvidersIntent = deleteOauthProvidersIntent - self.createSubOrganizationIntentV5 = createSubOrganizationIntentV5 - self.oauthIntent = oauthIntent - self.createApiKeysIntentV2 = createApiKeysIntentV2 - self.createReadWriteSessionIntent = createReadWriteSessionIntent - self.emailAuthIntentV2 = emailAuthIntentV2 - self.createSubOrganizationIntentV6 = createSubOrganizationIntentV6 - self.deletePrivateKeysIntent = deletePrivateKeysIntent - self.deleteWalletsIntent = deleteWalletsIntent - self.createReadWriteSessionIntentV2 = createReadWriteSessionIntentV2 - self.deleteSubOrganizationIntent = deleteSubOrganizationIntent - self.initOtpAuthIntent = initOtpAuthIntent - self.otpAuthIntent = otpAuthIntent - self.createSubOrganizationIntentV7 = createSubOrganizationIntentV7 - self.updateWalletIntent = updateWalletIntent - self.updatePolicyIntentV2 = updatePolicyIntentV2 - self.createUsersIntentV3 = createUsersIntentV3 - self.initOtpAuthIntentV2 = initOtpAuthIntentV2 - self.initOtpIntent = initOtpIntent - self.verifyOtpIntent = verifyOtpIntent - self.otpLoginIntent = otpLoginIntent - self.stampLoginIntent = stampLoginIntent - self.oauthLoginIntent = oauthLoginIntent - self.updateUserNameIntent = updateUserNameIntent - self.updateUserEmailIntent = updateUserEmailIntent - self.updateUserPhoneNumberIntent = updateUserPhoneNumberIntent - } - public enum CodingKeys: String, CodingKey { - case createOrganizationIntent - case createAuthenticatorsIntent - case createUsersIntent - case createPrivateKeysIntent - case signRawPayloadIntent - case createInvitationsIntent - case acceptInvitationIntent - case createPolicyIntent - case disablePrivateKeyIntent - case deleteUsersIntent - case deleteAuthenticatorsIntent - case deleteInvitationIntent - case deleteOrganizationIntent - case deletePolicyIntent - case createUserTagIntent - case deleteUserTagsIntent - case signTransactionIntent - case createApiKeysIntent - case deleteApiKeysIntent - case approveActivityIntent - case rejectActivityIntent - case createPrivateKeyTagIntent - case deletePrivateKeyTagsIntent - case createPolicyIntentV2 - case setPaymentMethodIntent - case activateBillingTierIntent - case deletePaymentMethodIntent - case createPolicyIntentV3 - case createApiOnlyUsersIntent - case updateRootQuorumIntent - case updateUserTagIntent - case updatePrivateKeyTagIntent - case createAuthenticatorsIntentV2 - case acceptInvitationIntentV2 - case createOrganizationIntentV2 - case createUsersIntentV2 - case createSubOrganizationIntent - case createSubOrganizationIntentV2 - case updateAllowedOriginsIntent - case createPrivateKeysIntentV2 - case updateUserIntent - case updatePolicyIntent - case setPaymentMethodIntentV2 - case createSubOrganizationIntentV3 - case createWalletIntent - case createWalletAccountsIntent - case initUserEmailRecoveryIntent - case recoverUserIntent - case setOrganizationFeatureIntent - case removeOrganizationFeatureIntent - case signRawPayloadIntentV2 - case signTransactionIntentV2 - case exportPrivateKeyIntent - case exportWalletIntent - case createSubOrganizationIntentV4 - case emailAuthIntent - case exportWalletAccountIntent - case initImportWalletIntent - case importWalletIntent - case initImportPrivateKeyIntent - case importPrivateKeyIntent - case createPoliciesIntent - case signRawPayloadsIntent - case createReadOnlySessionIntent - case createOauthProvidersIntent - case deleteOauthProvidersIntent - case createSubOrganizationIntentV5 - case oauthIntent - case createApiKeysIntentV2 - case createReadWriteSessionIntent - case emailAuthIntentV2 - case createSubOrganizationIntentV6 - case deletePrivateKeysIntent - case deleteWalletsIntent - case createReadWriteSessionIntentV2 - case deleteSubOrganizationIntent - case initOtpAuthIntent - case otpAuthIntent - case createSubOrganizationIntentV7 - case updateWalletIntent - case updatePolicyIntentV2 - case createUsersIntentV3 - case initOtpAuthIntentV2 - case initOtpIntent - case verifyOtpIntent - case otpLoginIntent - case stampLoginIntent - case oauthLoginIntent - case updateUserNameIntent - case updateUserEmailIntent - case updateUserPhoneNumberIntent - } - } - /// - Remark: Generated from `#/components/schemas/InvitationParams`. - public struct InvitationParams: Codable, Hashable, Sendable { - /// The name of the intended Invitation recipient. - /// - /// - Remark: Generated from `#/components/schemas/InvitationParams/receiverUserName`. - public var receiverUserName: Swift.String - /// The email address of the intended Invitation recipient. - /// - /// - Remark: Generated from `#/components/schemas/InvitationParams/receiverUserEmail`. - public var receiverUserEmail: Swift.String - /// A list of tags assigned to the Invitation recipient. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/InvitationParams/receiverUserTags`. - public var receiverUserTags: [Swift.String] - /// - Remark: Generated from `#/components/schemas/InvitationParams/accessType`. - public var accessType: Components.Schemas.AccessType - /// Unique identifier for the Sender of an Invitation. - /// - /// - Remark: Generated from `#/components/schemas/InvitationParams/senderUserId`. - public var senderUserId: Swift.String - /// Creates a new `InvitationParams`. - /// - /// - Parameters: - /// - receiverUserName: The name of the intended Invitation recipient. - /// - receiverUserEmail: The email address of the intended Invitation recipient. - /// - receiverUserTags: A list of tags assigned to the Invitation recipient. This field, if not needed, should be an empty array in your request body. - /// - accessType: - /// - senderUserId: Unique identifier for the Sender of an Invitation. - public init( - receiverUserName: Swift.String, - receiverUserEmail: Swift.String, - receiverUserTags: [Swift.String], - accessType: Components.Schemas.AccessType, - senderUserId: Swift.String - ) { - self.receiverUserName = receiverUserName - self.receiverUserEmail = receiverUserEmail - self.receiverUserTags = receiverUserTags - self.accessType = accessType - self.senderUserId = senderUserId - } - public enum CodingKeys: String, CodingKey { - case receiverUserName - case receiverUserEmail - case receiverUserTags - case accessType - case senderUserId - } - } - /// - Remark: Generated from `#/components/schemas/ListPrivateKeyTagsRequest`. - public struct ListPrivateKeyTagsRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/ListPrivateKeyTagsRequest/organizationId`. - public var organizationId: Swift.String - /// Creates a new `ListPrivateKeyTagsRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - public init(organizationId: Swift.String) { - self.organizationId = organizationId - } - public enum CodingKeys: String, CodingKey { - case organizationId - } - } - /// - Remark: Generated from `#/components/schemas/ListPrivateKeyTagsResponse`. - public struct ListPrivateKeyTagsResponse: Codable, Hashable, Sendable { - /// A list of Private Key Tags - /// - /// - Remark: Generated from `#/components/schemas/ListPrivateKeyTagsResponse/privateKeyTags`. - public var privateKeyTags: [Components.Schemas.v1_period_Tag] - /// Creates a new `ListPrivateKeyTagsResponse`. - /// - /// - Parameters: - /// - privateKeyTags: A list of Private Key Tags - public init(privateKeyTags: [Components.Schemas.v1_period_Tag]) { - self.privateKeyTags = privateKeyTags - } - public enum CodingKeys: String, CodingKey { - case privateKeyTags - } - } - /// - Remark: Generated from `#/components/schemas/ListUserTagsRequest`. - public struct ListUserTagsRequest: Codable, Hashable, Sendable { - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/ListUserTagsRequest/organizationId`. - public var organizationId: Swift.String - /// Creates a new `ListUserTagsRequest`. - /// - /// - Parameters: - /// - organizationId: Unique identifier for a given Organization. - public init(organizationId: Swift.String) { - self.organizationId = organizationId - } - public enum CodingKeys: String, CodingKey { - case organizationId - } - } - /// - Remark: Generated from `#/components/schemas/ListUserTagsResponse`. - public struct ListUserTagsResponse: Codable, Hashable, Sendable { - /// A list of User Tags - /// - /// - Remark: Generated from `#/components/schemas/ListUserTagsResponse/userTags`. - public var userTags: [Components.Schemas.v1_period_Tag] - /// Creates a new `ListUserTagsResponse`. - /// - /// - Parameters: - /// - userTags: A list of User Tags - public init(userTags: [Components.Schemas.v1_period_Tag]) { - self.userTags = userTags - } - public enum CodingKeys: String, CodingKey { - case userTags - } - } - /// - Remark: Generated from `#/components/schemas/MnemonicLanguage`. - @frozen public enum MnemonicLanguage: String, Codable, Hashable, Sendable, CaseIterable { - case MNEMONIC_LANGUAGE_ENGLISH = "MNEMONIC_LANGUAGE_ENGLISH" - case MNEMONIC_LANGUAGE_SIMPLIFIED_CHINESE = "MNEMONIC_LANGUAGE_SIMPLIFIED_CHINESE" - case MNEMONIC_LANGUAGE_TRADITIONAL_CHINESE = "MNEMONIC_LANGUAGE_TRADITIONAL_CHINESE" - case MNEMONIC_LANGUAGE_CZECH = "MNEMONIC_LANGUAGE_CZECH" - case MNEMONIC_LANGUAGE_FRENCH = "MNEMONIC_LANGUAGE_FRENCH" - case MNEMONIC_LANGUAGE_ITALIAN = "MNEMONIC_LANGUAGE_ITALIAN" - case MNEMONIC_LANGUAGE_JAPANESE = "MNEMONIC_LANGUAGE_JAPANESE" - case MNEMONIC_LANGUAGE_KOREAN = "MNEMONIC_LANGUAGE_KOREAN" - case MNEMONIC_LANGUAGE_SPANISH = "MNEMONIC_LANGUAGE_SPANISH" - } - /// - Remark: Generated from `#/components/schemas/OauthIntent`. - public struct OauthIntent: Codable, Hashable, Sendable { - /// Base64 encoded OIDC token - /// - /// - Remark: Generated from `#/components/schemas/OauthIntent/oidcToken`. - public var oidcToken: Swift.String - /// Client-side public key generated by the user, to which the oauth bundle (credentials) will be encrypted. - /// - /// - Remark: Generated from `#/components/schemas/OauthIntent/targetPublicKey`. - public var targetPublicKey: Swift.String - /// Optional human-readable name for an API Key. If none provided, default to Oauth - - /// - /// - Remark: Generated from `#/components/schemas/OauthIntent/apiKeyName`. - public var apiKeyName: Swift.String? - /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - /// - /// - Remark: Generated from `#/components/schemas/OauthIntent/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Invalidate all other previously generated Oauth API keys - /// - /// - Remark: Generated from `#/components/schemas/OauthIntent/invalidateExisting`. - public var invalidateExisting: Swift.Bool? - /// Creates a new `OauthIntent`. - /// - /// - Parameters: - /// - oidcToken: Base64 encoded OIDC token - /// - targetPublicKey: Client-side public key generated by the user, to which the oauth bundle (credentials) will be encrypted. - /// - apiKeyName: Optional human-readable name for an API Key. If none provided, default to Oauth - - /// - expirationSeconds: Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - /// - invalidateExisting: Invalidate all other previously generated Oauth API keys - public init( - oidcToken: Swift.String, - targetPublicKey: Swift.String, - apiKeyName: Swift.String? = nil, - expirationSeconds: Swift.String? = nil, - invalidateExisting: Swift.Bool? = nil - ) { - self.oidcToken = oidcToken - self.targetPublicKey = targetPublicKey - self.apiKeyName = apiKeyName - self.expirationSeconds = expirationSeconds - self.invalidateExisting = invalidateExisting - } - public enum CodingKeys: String, CodingKey { - case oidcToken - case targetPublicKey - case apiKeyName - case expirationSeconds - case invalidateExisting - } - } - /// - Remark: Generated from `#/components/schemas/OauthLoginIntent`. - public struct OauthLoginIntent: Codable, Hashable, Sendable { - /// Base64 encoded OIDC token - /// - /// - Remark: Generated from `#/components/schemas/OauthLoginIntent/oidcToken`. - public var oidcToken: Swift.String - /// Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request - /// - /// - Remark: Generated from `#/components/schemas/OauthLoginIntent/publicKey`. - public var publicKey: Swift.String - /// Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. - /// - /// - Remark: Generated from `#/components/schemas/OauthLoginIntent/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Invalidate all other previously generated Login API keys - /// - /// - Remark: Generated from `#/components/schemas/OauthLoginIntent/invalidateExisting`. - public var invalidateExisting: Swift.Bool? - /// Creates a new `OauthLoginIntent`. - /// - /// - Parameters: - /// - oidcToken: Base64 encoded OIDC token - /// - publicKey: Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request - /// - expirationSeconds: Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. - /// - invalidateExisting: Invalidate all other previously generated Login API keys - public init( - oidcToken: Swift.String, - publicKey: Swift.String, - expirationSeconds: Swift.String? = nil, - invalidateExisting: Swift.Bool? = nil - ) { - self.oidcToken = oidcToken - self.publicKey = publicKey - self.expirationSeconds = expirationSeconds - self.invalidateExisting = invalidateExisting - } - public enum CodingKeys: String, CodingKey { - case oidcToken - case publicKey - case expirationSeconds - case invalidateExisting - } - } - /// - Remark: Generated from `#/components/schemas/OauthLoginRequest`. - public struct OauthLoginRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/OauthLoginRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_OAUTH_LOGIN = "ACTIVITY_TYPE_OAUTH_LOGIN" - } - /// - Remark: Generated from `#/components/schemas/OauthLoginRequest/type`. - public var _type: Components.Schemas.OauthLoginRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/OauthLoginRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/OauthLoginRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/OauthLoginRequest/parameters`. - public var parameters: Components.Schemas.OauthLoginIntent - /// Creates a new `OauthLoginRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.OauthLoginRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.OauthLoginIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/OauthLoginResult`. - public struct OauthLoginResult: Codable, Hashable, Sendable { - /// Signed JWT containing an expiry, public key, session type, user id, and organization id - /// - /// - Remark: Generated from `#/components/schemas/OauthLoginResult/session`. - public var session: Swift.String - /// Creates a new `OauthLoginResult`. - /// - /// - Parameters: - /// - session: Signed JWT containing an expiry, public key, session type, user id, and organization id - public init(session: Swift.String) { - self.session = session - } - public enum CodingKeys: String, CodingKey { - case session - } - } - /// - Remark: Generated from `#/components/schemas/OauthProvider`. - public struct OauthProvider: Codable, Hashable, Sendable { - /// Unique identifier for an OAuth Provider - /// - /// - Remark: Generated from `#/components/schemas/OauthProvider/providerId`. - public var providerId: Swift.String - /// Human-readable name to identify a Provider. - /// - /// - Remark: Generated from `#/components/schemas/OauthProvider/providerName`. - public var providerName: Swift.String - /// The issuer of the token, typically a URL indicating the authentication server, e.g https://accounts.google.com - /// - /// - Remark: Generated from `#/components/schemas/OauthProvider/issuer`. - public var issuer: Swift.String - /// Expected audience ('aud' attribute of the signed token) which represents the app ID - /// - /// - Remark: Generated from `#/components/schemas/OauthProvider/audience`. - public var audience: Swift.String - /// Expected subject ('sub' attribute of the signed token) which represents the user ID - /// - /// - Remark: Generated from `#/components/schemas/OauthProvider/subject`. - public var subject: Swift.String - /// - Remark: Generated from `#/components/schemas/OauthProvider/createdAt`. - public var createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// - Remark: Generated from `#/components/schemas/OauthProvider/updatedAt`. - public var updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// Creates a new `OauthProvider`. - /// - /// - Parameters: - /// - providerId: Unique identifier for an OAuth Provider - /// - providerName: Human-readable name to identify a Provider. - /// - issuer: The issuer of the token, typically a URL indicating the authentication server, e.g https://accounts.google.com - /// - audience: Expected audience ('aud' attribute of the signed token) which represents the app ID - /// - subject: Expected subject ('sub' attribute of the signed token) which represents the user ID - /// - createdAt: - /// - updatedAt: - public init( - providerId: Swift.String, - providerName: Swift.String, - issuer: Swift.String, - audience: Swift.String, - subject: Swift.String, - createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - ) { - self.providerId = providerId - self.providerName = providerName - self.issuer = issuer - self.audience = audience - self.subject = subject - self.createdAt = createdAt - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case providerId - case providerName - case issuer - case audience - case subject - case createdAt - case updatedAt - } - } - /// - Remark: Generated from `#/components/schemas/OauthProviderParams`. - public struct OauthProviderParams: Codable, Hashable, Sendable { - /// Human-readable name to identify a Provider. - /// - /// - Remark: Generated from `#/components/schemas/OauthProviderParams/providerName`. - public var providerName: Swift.String - /// Base64 encoded OIDC token - /// - /// - Remark: Generated from `#/components/schemas/OauthProviderParams/oidcToken`. - public var oidcToken: Swift.String - /// Creates a new `OauthProviderParams`. - /// - /// - Parameters: - /// - providerName: Human-readable name to identify a Provider. - /// - oidcToken: Base64 encoded OIDC token - public init( - providerName: Swift.String, - oidcToken: Swift.String - ) { - self.providerName = providerName - self.oidcToken = oidcToken - } - public enum CodingKeys: String, CodingKey { - case providerName - case oidcToken - } - } - /// - Remark: Generated from `#/components/schemas/OauthRequest`. - public struct OauthRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/OauthRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_OAUTH = "ACTIVITY_TYPE_OAUTH" - } - /// - Remark: Generated from `#/components/schemas/OauthRequest/type`. - public var _type: Components.Schemas.OauthRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/OauthRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/OauthRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/OauthRequest/parameters`. - public var parameters: Components.Schemas.OauthIntent - /// Creates a new `OauthRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.OauthRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.OauthIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/OauthResult`. - public struct OauthResult: Codable, Hashable, Sendable { - /// Unique identifier for the authenticating User. - /// - /// - Remark: Generated from `#/components/schemas/OauthResult/userId`. - public var userId: Swift.String - /// Unique identifier for the created API key. - /// - /// - Remark: Generated from `#/components/schemas/OauthResult/apiKeyId`. - public var apiKeyId: Swift.String - /// HPKE encrypted credential bundle - /// - /// - Remark: Generated from `#/components/schemas/OauthResult/credentialBundle`. - public var credentialBundle: Swift.String - /// Creates a new `OauthResult`. - /// - /// - Parameters: - /// - userId: Unique identifier for the authenticating User. - /// - apiKeyId: Unique identifier for the created API key. - /// - credentialBundle: HPKE encrypted credential bundle - public init( - userId: Swift.String, - apiKeyId: Swift.String, - credentialBundle: Swift.String - ) { - self.userId = userId - self.apiKeyId = apiKeyId - self.credentialBundle = credentialBundle - } - public enum CodingKeys: String, CodingKey { - case userId - case apiKeyId - case credentialBundle - } - } - /// - Remark: Generated from `#/components/schemas/Operator`. - @frozen public enum Operator: String, Codable, Hashable, Sendable, CaseIterable { - case OPERATOR_EQUAL = "OPERATOR_EQUAL" - case OPERATOR_MORE_THAN = "OPERATOR_MORE_THAN" - case OPERATOR_MORE_THAN_OR_EQUAL = "OPERATOR_MORE_THAN_OR_EQUAL" - case OPERATOR_LESS_THAN = "OPERATOR_LESS_THAN" - case OPERATOR_LESS_THAN_OR_EQUAL = "OPERATOR_LESS_THAN_OR_EQUAL" - case OPERATOR_CONTAINS = "OPERATOR_CONTAINS" - case OPERATOR_NOT_EQUAL = "OPERATOR_NOT_EQUAL" - case OPERATOR_IN = "OPERATOR_IN" - case OPERATOR_NOT_IN = "OPERATOR_NOT_IN" - case OPERATOR_CONTAINS_ONE = "OPERATOR_CONTAINS_ONE" - case OPERATOR_CONTAINS_ALL = "OPERATOR_CONTAINS_ALL" - } - /// - Remark: Generated from `#/components/schemas/OtpAuthIntent`. - public struct OtpAuthIntent: Codable, Hashable, Sendable { - /// ID representing the result of an init OTP activity. - /// - /// - Remark: Generated from `#/components/schemas/OtpAuthIntent/otpId`. - public var otpId: Swift.String - /// OTP sent out to a user's contact (email or SMS) - /// - /// - Remark: Generated from `#/components/schemas/OtpAuthIntent/otpCode`. - public var otpCode: Swift.String - /// Client-side public key generated by the user, to which the OTP bundle (credentials) will be encrypted. - /// - /// - Remark: Generated from `#/components/schemas/OtpAuthIntent/targetPublicKey`. - public var targetPublicKey: Swift.String - /// Optional human-readable name for an API Key. If none provided, default to OTP Auth - - /// - /// - Remark: Generated from `#/components/schemas/OtpAuthIntent/apiKeyName`. - public var apiKeyName: Swift.String? - /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - /// - /// - Remark: Generated from `#/components/schemas/OtpAuthIntent/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Invalidate all other previously generated OTP Auth API keys - /// - /// - Remark: Generated from `#/components/schemas/OtpAuthIntent/invalidateExisting`. - public var invalidateExisting: Swift.Bool? - /// Creates a new `OtpAuthIntent`. - /// - /// - Parameters: - /// - otpId: ID representing the result of an init OTP activity. - /// - otpCode: OTP sent out to a user's contact (email or SMS) - /// - targetPublicKey: Client-side public key generated by the user, to which the OTP bundle (credentials) will be encrypted. - /// - apiKeyName: Optional human-readable name for an API Key. If none provided, default to OTP Auth - - /// - expirationSeconds: Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. - /// - invalidateExisting: Invalidate all other previously generated OTP Auth API keys - public init( - otpId: Swift.String, - otpCode: Swift.String, - targetPublicKey: Swift.String, - apiKeyName: Swift.String? = nil, - expirationSeconds: Swift.String? = nil, - invalidateExisting: Swift.Bool? = nil - ) { - self.otpId = otpId - self.otpCode = otpCode - self.targetPublicKey = targetPublicKey - self.apiKeyName = apiKeyName - self.expirationSeconds = expirationSeconds - self.invalidateExisting = invalidateExisting - } - public enum CodingKeys: String, CodingKey { - case otpId - case otpCode - case targetPublicKey - case apiKeyName - case expirationSeconds - case invalidateExisting - } - } - /// - Remark: Generated from `#/components/schemas/OtpAuthRequest`. - public struct OtpAuthRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/OtpAuthRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_OTP_AUTH = "ACTIVITY_TYPE_OTP_AUTH" - } - /// - Remark: Generated from `#/components/schemas/OtpAuthRequest/type`. - public var _type: Components.Schemas.OtpAuthRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/OtpAuthRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/OtpAuthRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/OtpAuthRequest/parameters`. - public var parameters: Components.Schemas.OtpAuthIntent - /// Creates a new `OtpAuthRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.OtpAuthRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.OtpAuthIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/OtpAuthResult`. - public struct OtpAuthResult: Codable, Hashable, Sendable { - /// Unique identifier for the authenticating User. - /// - /// - Remark: Generated from `#/components/schemas/OtpAuthResult/userId`. - public var userId: Swift.String - /// Unique identifier for the created API key. - /// - /// - Remark: Generated from `#/components/schemas/OtpAuthResult/apiKeyId`. - public var apiKeyId: Swift.String? - /// HPKE encrypted credential bundle - /// - /// - Remark: Generated from `#/components/schemas/OtpAuthResult/credentialBundle`. - public var credentialBundle: Swift.String? - /// Creates a new `OtpAuthResult`. - /// - /// - Parameters: - /// - userId: Unique identifier for the authenticating User. - /// - apiKeyId: Unique identifier for the created API key. - /// - credentialBundle: HPKE encrypted credential bundle - public init( - userId: Swift.String, - apiKeyId: Swift.String? = nil, - credentialBundle: Swift.String? = nil - ) { - self.userId = userId - self.apiKeyId = apiKeyId - self.credentialBundle = credentialBundle - } - public enum CodingKeys: String, CodingKey { - case userId - case apiKeyId - case credentialBundle - } - } - /// - Remark: Generated from `#/components/schemas/OtpLoginIntent`. - public struct OtpLoginIntent: Codable, Hashable, Sendable { - /// Signed JWT containing a unique id, expiry, verification type, contact - /// - /// - Remark: Generated from `#/components/schemas/OtpLoginIntent/verificationToken`. - public var verificationToken: Swift.String - /// Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token - /// - /// - Remark: Generated from `#/components/schemas/OtpLoginIntent/publicKey`. - public var publicKey: Swift.String - /// Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. - /// - /// - Remark: Generated from `#/components/schemas/OtpLoginIntent/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Invalidate all other previously generated Login API keys - /// - /// - Remark: Generated from `#/components/schemas/OtpLoginIntent/invalidateExisting`. - public var invalidateExisting: Swift.Bool? - /// Creates a new `OtpLoginIntent`. - /// - /// - Parameters: - /// - verificationToken: Signed JWT containing a unique id, expiry, verification type, contact - /// - publicKey: Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token - /// - expirationSeconds: Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. - /// - invalidateExisting: Invalidate all other previously generated Login API keys - public init( - verificationToken: Swift.String, - publicKey: Swift.String, - expirationSeconds: Swift.String? = nil, - invalidateExisting: Swift.Bool? = nil - ) { - self.verificationToken = verificationToken - self.publicKey = publicKey - self.expirationSeconds = expirationSeconds - self.invalidateExisting = invalidateExisting - } - public enum CodingKeys: String, CodingKey { - case verificationToken - case publicKey - case expirationSeconds - case invalidateExisting - } - } - /// - Remark: Generated from `#/components/schemas/OtpLoginRequest`. - public struct OtpLoginRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/OtpLoginRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_OTP_LOGIN = "ACTIVITY_TYPE_OTP_LOGIN" - } - /// - Remark: Generated from `#/components/schemas/OtpLoginRequest/type`. - public var _type: Components.Schemas.OtpLoginRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/OtpLoginRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/OtpLoginRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/OtpLoginRequest/parameters`. - public var parameters: Components.Schemas.OtpLoginIntent - /// Creates a new `OtpLoginRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.OtpLoginRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.OtpLoginIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/OtpLoginResult`. - public struct OtpLoginResult: Codable, Hashable, Sendable { - /// Signed JWT containing an expiry, public key, session type, user id, and organization id - /// - /// - Remark: Generated from `#/components/schemas/OtpLoginResult/session`. - public var session: Swift.String - /// Creates a new `OtpLoginResult`. - /// - /// - Parameters: - /// - session: Signed JWT containing an expiry, public key, session type, user id, and organization id - public init(session: Swift.String) { - self.session = session - } - public enum CodingKeys: String, CodingKey { - case session - } - } - /// - Remark: Generated from `#/components/schemas/Pagination`. - public struct Pagination: Codable, Hashable, Sendable { - /// A limit of the number of object to be returned, between 1 and 100. Defaults to 10. - /// - /// - Remark: Generated from `#/components/schemas/Pagination/limit`. - public var limit: Swift.String? - /// A pagination cursor. This is an object ID that enables you to fetch all objects before this ID. - /// - /// - Remark: Generated from `#/components/schemas/Pagination/before`. - public var before: Swift.String? - /// A pagination cursor. This is an object ID that enables you to fetch all objects after this ID. - /// - /// - Remark: Generated from `#/components/schemas/Pagination/after`. - public var after: Swift.String? - /// Creates a new `Pagination`. - /// - /// - Parameters: - /// - limit: A limit of the number of object to be returned, between 1 and 100. Defaults to 10. - /// - before: A pagination cursor. This is an object ID that enables you to fetch all objects before this ID. - /// - after: A pagination cursor. This is an object ID that enables you to fetch all objects after this ID. - public init( - limit: Swift.String? = nil, - before: Swift.String? = nil, - after: Swift.String? = nil - ) { - self.limit = limit - self.before = before - self.after = after - } - public enum CodingKeys: String, CodingKey { - case limit - case before - case after - } - } - /// - Remark: Generated from `#/components/schemas/PathFormat`. - @frozen public enum PathFormat: String, Codable, Hashable, Sendable, CaseIterable { - case PATH_FORMAT_BIP32 = "PATH_FORMAT_BIP32" - } - /// - Remark: Generated from `#/components/schemas/PayloadEncoding`. - @frozen public enum PayloadEncoding: String, Codable, Hashable, Sendable, CaseIterable { - case PAYLOAD_ENCODING_HEXADECIMAL = "PAYLOAD_ENCODING_HEXADECIMAL" - case PAYLOAD_ENCODING_TEXT_UTF8 = "PAYLOAD_ENCODING_TEXT_UTF8" - } - /// - Remark: Generated from `#/components/schemas/Policy`. - public struct Policy: Codable, Hashable, Sendable { - /// Unique identifier for a given Policy. - /// - /// - Remark: Generated from `#/components/schemas/Policy/policyId`. - public var policyId: Swift.String - /// Human-readable name for a Policy. - /// - /// - Remark: Generated from `#/components/schemas/Policy/policyName`. - public var policyName: Swift.String - /// - Remark: Generated from `#/components/schemas/Policy/effect`. - public var effect: Components.Schemas.Effect - /// - Remark: Generated from `#/components/schemas/Policy/createdAt`. - public var createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// - Remark: Generated from `#/components/schemas/Policy/updatedAt`. - public var updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// Human-readable notes added by a User to describe a particular policy. - /// - /// - Remark: Generated from `#/components/schemas/Policy/notes`. - public var notes: Swift.String - /// A consensus expression that evalutes to true or false. - /// - /// - Remark: Generated from `#/components/schemas/Policy/consensus`. - public var consensus: Swift.String? - /// A condition expression that evalutes to true or false. - /// - /// - Remark: Generated from `#/components/schemas/Policy/condition`. - public var condition: Swift.String? - /// Creates a new `Policy`. - /// - /// - Parameters: - /// - policyId: Unique identifier for a given Policy. - /// - policyName: Human-readable name for a Policy. - /// - effect: - /// - createdAt: - /// - updatedAt: - /// - notes: Human-readable notes added by a User to describe a particular policy. - /// - consensus: A consensus expression that evalutes to true or false. - /// - condition: A condition expression that evalutes to true or false. - public init( - policyId: Swift.String, - policyName: Swift.String, - effect: Components.Schemas.Effect, - createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - notes: Swift.String, - consensus: Swift.String? = nil, - condition: Swift.String? = nil - ) { - self.policyId = policyId - self.policyName = policyName - self.effect = effect - self.createdAt = createdAt - self.updatedAt = updatedAt - self.notes = notes - self.consensus = consensus - self.condition = condition - } - public enum CodingKeys: String, CodingKey { - case policyId - case policyName - case effect - case createdAt - case updatedAt - case notes - case consensus - case condition - } - } - /// - Remark: Generated from `#/components/schemas/PrivateKey`. - public struct PrivateKey: Codable, Hashable, Sendable { - /// Unique identifier for a given Private Key. - /// - /// - Remark: Generated from `#/components/schemas/PrivateKey/privateKeyId`. - public var privateKeyId: Swift.String - /// The public component of a cryptographic key pair used to sign messages and transactions. - /// - /// - Remark: Generated from `#/components/schemas/PrivateKey/publicKey`. - public var publicKey: Swift.String - /// Human-readable name for a Private Key. - /// - /// - Remark: Generated from `#/components/schemas/PrivateKey/privateKeyName`. - public var privateKeyName: Swift.String - /// - Remark: Generated from `#/components/schemas/PrivateKey/curve`. - public var curve: Components.Schemas.Curve - /// Derived cryptocurrency addresses for a given Private Key. - /// - /// - Remark: Generated from `#/components/schemas/PrivateKey/addresses`. - public var addresses: [Components.Schemas.data_period_v1_period_Address] - /// A list of Private Key Tag IDs. - /// - /// - Remark: Generated from `#/components/schemas/PrivateKey/privateKeyTags`. - public var privateKeyTags: [Swift.String] - /// - Remark: Generated from `#/components/schemas/PrivateKey/createdAt`. - public var createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// - Remark: Generated from `#/components/schemas/PrivateKey/updatedAt`. - public var updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// True when a given Private Key is exported, false otherwise. - /// - /// - Remark: Generated from `#/components/schemas/PrivateKey/exported`. - public var exported: Swift.Bool - /// True when a given Private Key is imported, false otherwise. - /// - /// - Remark: Generated from `#/components/schemas/PrivateKey/imported`. - public var imported: Swift.Bool - /// Creates a new `PrivateKey`. - /// - /// - Parameters: - /// - privateKeyId: Unique identifier for a given Private Key. - /// - publicKey: The public component of a cryptographic key pair used to sign messages and transactions. - /// - privateKeyName: Human-readable name for a Private Key. - /// - curve: - /// - addresses: Derived cryptocurrency addresses for a given Private Key. - /// - privateKeyTags: A list of Private Key Tag IDs. - /// - createdAt: - /// - updatedAt: - /// - exported: True when a given Private Key is exported, false otherwise. - /// - imported: True when a given Private Key is imported, false otherwise. - public init( - privateKeyId: Swift.String, - publicKey: Swift.String, - privateKeyName: Swift.String, - curve: Components.Schemas.Curve, - addresses: [Components.Schemas.data_period_v1_period_Address], - privateKeyTags: [Swift.String], - createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - exported: Swift.Bool, - imported: Swift.Bool - ) { - self.privateKeyId = privateKeyId - self.publicKey = publicKey - self.privateKeyName = privateKeyName - self.curve = curve - self.addresses = addresses - self.privateKeyTags = privateKeyTags - self.createdAt = createdAt - self.updatedAt = updatedAt - self.exported = exported - self.imported = imported - } - public enum CodingKeys: String, CodingKey { - case privateKeyId - case publicKey - case privateKeyName - case curve - case addresses - case privateKeyTags - case createdAt - case updatedAt - case exported - case imported - } - } - /// - Remark: Generated from `#/components/schemas/PrivateKeyParams`. - public struct PrivateKeyParams: Codable, Hashable, Sendable { - /// Human-readable name for a Private Key. - /// - /// - Remark: Generated from `#/components/schemas/PrivateKeyParams/privateKeyName`. - public var privateKeyName: Swift.String - /// - Remark: Generated from `#/components/schemas/PrivateKeyParams/curve`. - public var curve: Components.Schemas.Curve - /// A list of Private Key Tag IDs. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/PrivateKeyParams/privateKeyTags`. - public var privateKeyTags: [Swift.String] - /// Cryptocurrency-specific formats for a derived address (e.g., Ethereum). - /// - /// - Remark: Generated from `#/components/schemas/PrivateKeyParams/addressFormats`. - public var addressFormats: [Components.Schemas.AddressFormat] - /// Creates a new `PrivateKeyParams`. - /// - /// - Parameters: - /// - privateKeyName: Human-readable name for a Private Key. - /// - curve: - /// - privateKeyTags: A list of Private Key Tag IDs. This field, if not needed, should be an empty array in your request body. - /// - addressFormats: Cryptocurrency-specific formats for a derived address (e.g., Ethereum). - public init( - privateKeyName: Swift.String, - curve: Components.Schemas.Curve, - privateKeyTags: [Swift.String], - addressFormats: [Components.Schemas.AddressFormat] - ) { - self.privateKeyName = privateKeyName - self.curve = curve - self.privateKeyTags = privateKeyTags - self.addressFormats = addressFormats - } - public enum CodingKeys: String, CodingKey { - case privateKeyName - case curve - case privateKeyTags - case addressFormats - } - } - /// - Remark: Generated from `#/components/schemas/PrivateKeyResult`. - public struct PrivateKeyResult: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/PrivateKeyResult/privateKeyId`. - public var privateKeyId: Swift.String? - /// - Remark: Generated from `#/components/schemas/PrivateKeyResult/addresses`. - public var addresses: [Components.Schemas.activity_period_v1_period_Address]? - /// Creates a new `PrivateKeyResult`. - /// - /// - Parameters: - /// - privateKeyId: - /// - addresses: - public init( - privateKeyId: Swift.String? = nil, - addresses: [Components.Schemas.activity_period_v1_period_Address]? = nil - ) { - self.privateKeyId = privateKeyId - self.addresses = addresses - } - public enum CodingKeys: String, CodingKey { - case privateKeyId - case addresses - } - } - /// - Remark: Generated from `#/components/schemas/PublicKeyCredentialWithAttestation`. - public struct PublicKeyCredentialWithAttestation: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/PublicKeyCredentialWithAttestation/id`. - public var id: Swift.String - /// - Remark: Generated from `#/components/schemas/PublicKeyCredentialWithAttestation/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case public_hyphen_key = "public-key" - } - /// - Remark: Generated from `#/components/schemas/PublicKeyCredentialWithAttestation/type`. - public var _type: Components.Schemas.PublicKeyCredentialWithAttestation._typePayload - /// - Remark: Generated from `#/components/schemas/PublicKeyCredentialWithAttestation/rawId`. - public var rawId: Swift.String - /// - Remark: Generated from `#/components/schemas/PublicKeyCredentialWithAttestation/authenticatorAttachment`. - @frozen - public enum authenticatorAttachmentPayload: String, Codable, Hashable, Sendable, CaseIterable - { - case cross_hyphen_platform = "cross-platform" - case platform = "platform" - } - /// - Remark: Generated from `#/components/schemas/PublicKeyCredentialWithAttestation/authenticatorAttachment`. - public var authenticatorAttachment: - Components.Schemas.PublicKeyCredentialWithAttestation.authenticatorAttachmentPayload? - /// - Remark: Generated from `#/components/schemas/PublicKeyCredentialWithAttestation/response`. - public var response: Components.Schemas.AuthenticatorAttestationResponse - /// - Remark: Generated from `#/components/schemas/PublicKeyCredentialWithAttestation/clientExtensionResults`. - public var clientExtensionResults: Components.Schemas.SimpleClientExtensionResults - /// Creates a new `PublicKeyCredentialWithAttestation`. - /// - /// - Parameters: - /// - id: - /// - _type: - /// - rawId: - /// - authenticatorAttachment: - /// - response: - /// - clientExtensionResults: - public init( - id: Swift.String, - _type: Components.Schemas.PublicKeyCredentialWithAttestation._typePayload, - rawId: Swift.String, - authenticatorAttachment: Components.Schemas.PublicKeyCredentialWithAttestation - .authenticatorAttachmentPayload? = nil, - response: Components.Schemas.AuthenticatorAttestationResponse, - clientExtensionResults: Components.Schemas.SimpleClientExtensionResults - ) { - self.id = id - self._type = _type - self.rawId = rawId - self.authenticatorAttachment = authenticatorAttachment - self.response = response - self.clientExtensionResults = clientExtensionResults - } - public enum CodingKeys: String, CodingKey { - case id - case _type = "type" - case rawId - case authenticatorAttachment - case response - case clientExtensionResults - } - } - /// - Remark: Generated from `#/components/schemas/RecoverUserIntent`. - public struct RecoverUserIntent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/RecoverUserIntent/authenticator`. - public var authenticator: Components.Schemas.AuthenticatorParamsV2 - /// Unique identifier for the user performing recovery. - /// - /// - Remark: Generated from `#/components/schemas/RecoverUserIntent/userId`. - public var userId: Swift.String - /// Creates a new `RecoverUserIntent`. - /// - /// - Parameters: - /// - authenticator: - /// - userId: Unique identifier for the user performing recovery. - public init( - authenticator: Components.Schemas.AuthenticatorParamsV2, - userId: Swift.String - ) { - self.authenticator = authenticator - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case authenticator - case userId - } - } - /// - Remark: Generated from `#/components/schemas/RecoverUserRequest`. - public struct RecoverUserRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/RecoverUserRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_RECOVER_USER = "ACTIVITY_TYPE_RECOVER_USER" - } - /// - Remark: Generated from `#/components/schemas/RecoverUserRequest/type`. - public var _type: Components.Schemas.RecoverUserRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/RecoverUserRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/RecoverUserRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/RecoverUserRequest/parameters`. - public var parameters: Components.Schemas.RecoverUserIntent - /// Creates a new `RecoverUserRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.RecoverUserRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.RecoverUserIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/RecoverUserResult`. - public struct RecoverUserResult: Codable, Hashable, Sendable { - /// ID of the authenticator created. - /// - /// - Remark: Generated from `#/components/schemas/RecoverUserResult/authenticatorId`. - public var authenticatorId: [Swift.String] - /// Creates a new `RecoverUserResult`. - /// - /// - Parameters: - /// - authenticatorId: ID of the authenticator created. - public init(authenticatorId: [Swift.String]) { - self.authenticatorId = authenticatorId - } - public enum CodingKeys: String, CodingKey { - case authenticatorId - } - } - /// - Remark: Generated from `#/components/schemas/RejectActivityIntent`. - public struct RejectActivityIntent: Codable, Hashable, Sendable { - /// An artifact verifying a User's action. - /// - /// - Remark: Generated from `#/components/schemas/RejectActivityIntent/fingerprint`. - public var fingerprint: Swift.String - /// Creates a new `RejectActivityIntent`. - /// - /// - Parameters: - /// - fingerprint: An artifact verifying a User's action. - public init(fingerprint: Swift.String) { - self.fingerprint = fingerprint - } - public enum CodingKeys: String, CodingKey { - case fingerprint - } - } - /// - Remark: Generated from `#/components/schemas/RejectActivityRequest`. - public struct RejectActivityRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/RejectActivityRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_REJECT_ACTIVITY = "ACTIVITY_TYPE_REJECT_ACTIVITY" - } - /// - Remark: Generated from `#/components/schemas/RejectActivityRequest/type`. - public var _type: Components.Schemas.RejectActivityRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/RejectActivityRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/RejectActivityRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/RejectActivityRequest/parameters`. - public var parameters: Components.Schemas.RejectActivityIntent - /// Creates a new `RejectActivityRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.RejectActivityRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.RejectActivityIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/RemoveOrganizationFeatureIntent`. - public struct RemoveOrganizationFeatureIntent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/RemoveOrganizationFeatureIntent/name`. - public var name: Components.Schemas.FeatureName - /// Creates a new `RemoveOrganizationFeatureIntent`. - /// - /// - Parameters: - /// - name: - public init(name: Components.Schemas.FeatureName) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } - } - /// - Remark: Generated from `#/components/schemas/RemoveOrganizationFeatureRequest`. - public struct RemoveOrganizationFeatureRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/RemoveOrganizationFeatureRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE = "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE" - } - /// - Remark: Generated from `#/components/schemas/RemoveOrganizationFeatureRequest/type`. - public var _type: Components.Schemas.RemoveOrganizationFeatureRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/RemoveOrganizationFeatureRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/RemoveOrganizationFeatureRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/RemoveOrganizationFeatureRequest/parameters`. - public var parameters: Components.Schemas.RemoveOrganizationFeatureIntent - /// Creates a new `RemoveOrganizationFeatureRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.RemoveOrganizationFeatureRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.RemoveOrganizationFeatureIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/RemoveOrganizationFeatureResult`. - public struct RemoveOrganizationFeatureResult: Codable, Hashable, Sendable { - /// Resulting list of organization features. - /// - /// - Remark: Generated from `#/components/schemas/RemoveOrganizationFeatureResult/features`. - public var features: [Components.Schemas.Feature] - /// Creates a new `RemoveOrganizationFeatureResult`. - /// - /// - Parameters: - /// - features: Resulting list of organization features. - public init(features: [Components.Schemas.Feature]) { - self.features = features - } - public enum CodingKeys: String, CodingKey { - case features - } - } - /// - Remark: Generated from `#/components/schemas/Result`. - public struct Result: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Result/createOrganizationResult`. - public var createOrganizationResult: Components.Schemas.CreateOrganizationResult? - /// - Remark: Generated from `#/components/schemas/Result/createAuthenticatorsResult`. - public var createAuthenticatorsResult: Components.Schemas.CreateAuthenticatorsResult? - /// - Remark: Generated from `#/components/schemas/Result/createUsersResult`. - public var createUsersResult: Components.Schemas.CreateUsersResult? - /// - Remark: Generated from `#/components/schemas/Result/createPrivateKeysResult`. - public var createPrivateKeysResult: Components.Schemas.CreatePrivateKeysResult? - /// - Remark: Generated from `#/components/schemas/Result/createInvitationsResult`. - public var createInvitationsResult: Components.Schemas.CreateInvitationsResult? - /// - Remark: Generated from `#/components/schemas/Result/acceptInvitationResult`. - public var acceptInvitationResult: Components.Schemas.AcceptInvitationResult? - /// - Remark: Generated from `#/components/schemas/Result/signRawPayloadResult`. - public var signRawPayloadResult: Components.Schemas.SignRawPayloadResult? - /// - Remark: Generated from `#/components/schemas/Result/createPolicyResult`. - public var createPolicyResult: Components.Schemas.CreatePolicyResult? - /// - Remark: Generated from `#/components/schemas/Result/disablePrivateKeyResult`. - public var disablePrivateKeyResult: Components.Schemas.DisablePrivateKeyResult? - /// - Remark: Generated from `#/components/schemas/Result/deleteUsersResult`. - public var deleteUsersResult: Components.Schemas.DeleteUsersResult? - /// - Remark: Generated from `#/components/schemas/Result/deleteAuthenticatorsResult`. - public var deleteAuthenticatorsResult: Components.Schemas.DeleteAuthenticatorsResult? - /// - Remark: Generated from `#/components/schemas/Result/deleteInvitationResult`. - public var deleteInvitationResult: Components.Schemas.DeleteInvitationResult? - /// - Remark: Generated from `#/components/schemas/Result/deleteOrganizationResult`. - public var deleteOrganizationResult: Components.Schemas.DeleteOrganizationResult? - /// - Remark: Generated from `#/components/schemas/Result/deletePolicyResult`. - public var deletePolicyResult: Components.Schemas.DeletePolicyResult? - /// - Remark: Generated from `#/components/schemas/Result/createUserTagResult`. - public var createUserTagResult: Components.Schemas.CreateUserTagResult? - /// - Remark: Generated from `#/components/schemas/Result/deleteUserTagsResult`. - public var deleteUserTagsResult: Components.Schemas.DeleteUserTagsResult? - /// - Remark: Generated from `#/components/schemas/Result/signTransactionResult`. - public var signTransactionResult: Components.Schemas.SignTransactionResult? - /// - Remark: Generated from `#/components/schemas/Result/deleteApiKeysResult`. - public var deleteApiKeysResult: Components.Schemas.DeleteApiKeysResult? - /// - Remark: Generated from `#/components/schemas/Result/createApiKeysResult`. - public var createApiKeysResult: Components.Schemas.CreateApiKeysResult? - /// - Remark: Generated from `#/components/schemas/Result/createPrivateKeyTagResult`. - public var createPrivateKeyTagResult: Components.Schemas.CreatePrivateKeyTagResult? - /// - Remark: Generated from `#/components/schemas/Result/deletePrivateKeyTagsResult`. - public var deletePrivateKeyTagsResult: Components.Schemas.DeletePrivateKeyTagsResult? - /// - Remark: Generated from `#/components/schemas/Result/setPaymentMethodResult`. - public var setPaymentMethodResult: Components.Schemas.SetPaymentMethodResult? - /// - Remark: Generated from `#/components/schemas/Result/activateBillingTierResult`. - public var activateBillingTierResult: Components.Schemas.ActivateBillingTierResult? - /// - Remark: Generated from `#/components/schemas/Result/deletePaymentMethodResult`. - public var deletePaymentMethodResult: Components.Schemas.DeletePaymentMethodResult? - /// - Remark: Generated from `#/components/schemas/Result/createApiOnlyUsersResult`. - public var createApiOnlyUsersResult: Components.Schemas.CreateApiOnlyUsersResult? - /// - Remark: Generated from `#/components/schemas/Result/updateRootQuorumResult`. - public var updateRootQuorumResult: Components.Schemas.UpdateRootQuorumResult? - /// - Remark: Generated from `#/components/schemas/Result/updateUserTagResult`. - public var updateUserTagResult: Components.Schemas.UpdateUserTagResult? - /// - Remark: Generated from `#/components/schemas/Result/updatePrivateKeyTagResult`. - public var updatePrivateKeyTagResult: Components.Schemas.UpdatePrivateKeyTagResult? - /// - Remark: Generated from `#/components/schemas/Result/createSubOrganizationResult`. - public var createSubOrganizationResult: Components.Schemas.CreateSubOrganizationResult? - /// - Remark: Generated from `#/components/schemas/Result/updateAllowedOriginsResult`. - public var updateAllowedOriginsResult: Components.Schemas.UpdateAllowedOriginsResult? - /// - Remark: Generated from `#/components/schemas/Result/createPrivateKeysResultV2`. - public var createPrivateKeysResultV2: Components.Schemas.CreatePrivateKeysResultV2? - /// - Remark: Generated from `#/components/schemas/Result/updateUserResult`. - public var updateUserResult: Components.Schemas.UpdateUserResult? - /// - Remark: Generated from `#/components/schemas/Result/updatePolicyResult`. - public var updatePolicyResult: Components.Schemas.UpdatePolicyResult? - /// - Remark: Generated from `#/components/schemas/Result/createSubOrganizationResultV3`. - public var createSubOrganizationResultV3: Components.Schemas.CreateSubOrganizationResultV3? - /// - Remark: Generated from `#/components/schemas/Result/createWalletResult`. - public var createWalletResult: Components.Schemas.CreateWalletResult? - /// - Remark: Generated from `#/components/schemas/Result/createWalletAccountsResult`. - public var createWalletAccountsResult: Components.Schemas.CreateWalletAccountsResult? - /// - Remark: Generated from `#/components/schemas/Result/initUserEmailRecoveryResult`. - public var initUserEmailRecoveryResult: Components.Schemas.InitUserEmailRecoveryResult? - /// - Remark: Generated from `#/components/schemas/Result/recoverUserResult`. - public var recoverUserResult: Components.Schemas.RecoverUserResult? - /// - Remark: Generated from `#/components/schemas/Result/setOrganizationFeatureResult`. - public var setOrganizationFeatureResult: Components.Schemas.SetOrganizationFeatureResult? - /// - Remark: Generated from `#/components/schemas/Result/removeOrganizationFeatureResult`. - public var removeOrganizationFeatureResult: - Components.Schemas.RemoveOrganizationFeatureResult? - /// - Remark: Generated from `#/components/schemas/Result/exportPrivateKeyResult`. - public var exportPrivateKeyResult: Components.Schemas.ExportPrivateKeyResult? - /// - Remark: Generated from `#/components/schemas/Result/exportWalletResult`. - public var exportWalletResult: Components.Schemas.ExportWalletResult? - /// - Remark: Generated from `#/components/schemas/Result/createSubOrganizationResultV4`. - public var createSubOrganizationResultV4: Components.Schemas.CreateSubOrganizationResultV4? - /// - Remark: Generated from `#/components/schemas/Result/emailAuthResult`. - public var emailAuthResult: Components.Schemas.EmailAuthResult? - /// - Remark: Generated from `#/components/schemas/Result/exportWalletAccountResult`. - public var exportWalletAccountResult: Components.Schemas.ExportWalletAccountResult? - /// - Remark: Generated from `#/components/schemas/Result/initImportWalletResult`. - public var initImportWalletResult: Components.Schemas.InitImportWalletResult? - /// - Remark: Generated from `#/components/schemas/Result/importWalletResult`. - public var importWalletResult: Components.Schemas.ImportWalletResult? - /// - Remark: Generated from `#/components/schemas/Result/initImportPrivateKeyResult`. - public var initImportPrivateKeyResult: Components.Schemas.InitImportPrivateKeyResult? - /// - Remark: Generated from `#/components/schemas/Result/importPrivateKeyResult`. - public var importPrivateKeyResult: Components.Schemas.ImportPrivateKeyResult? - /// - Remark: Generated from `#/components/schemas/Result/createPoliciesResult`. - public var createPoliciesResult: Components.Schemas.CreatePoliciesResult? - /// - Remark: Generated from `#/components/schemas/Result/signRawPayloadsResult`. - public var signRawPayloadsResult: Components.Schemas.SignRawPayloadsResult? - /// - Remark: Generated from `#/components/schemas/Result/createReadOnlySessionResult`. - public var createReadOnlySessionResult: Components.Schemas.CreateReadOnlySessionResult? - /// - Remark: Generated from `#/components/schemas/Result/createOauthProvidersResult`. - public var createOauthProvidersResult: Components.Schemas.CreateOauthProvidersResult? - /// - Remark: Generated from `#/components/schemas/Result/deleteOauthProvidersResult`. - public var deleteOauthProvidersResult: Components.Schemas.DeleteOauthProvidersResult? - /// - Remark: Generated from `#/components/schemas/Result/createSubOrganizationResultV5`. - public var createSubOrganizationResultV5: Components.Schemas.CreateSubOrganizationResultV5? - /// - Remark: Generated from `#/components/schemas/Result/oauthResult`. - public var oauthResult: Components.Schemas.OauthResult? - /// - Remark: Generated from `#/components/schemas/Result/createReadWriteSessionResult`. - public var createReadWriteSessionResult: Components.Schemas.CreateReadWriteSessionResult? - /// - Remark: Generated from `#/components/schemas/Result/createSubOrganizationResultV6`. - public var createSubOrganizationResultV6: Components.Schemas.CreateSubOrganizationResultV6? - /// - Remark: Generated from `#/components/schemas/Result/deletePrivateKeysResult`. - public var deletePrivateKeysResult: Components.Schemas.DeletePrivateKeysResult? - /// - Remark: Generated from `#/components/schemas/Result/deleteWalletsResult`. - public var deleteWalletsResult: Components.Schemas.DeleteWalletsResult? - /// - Remark: Generated from `#/components/schemas/Result/createReadWriteSessionResultV2`. - public var createReadWriteSessionResultV2: Components.Schemas.CreateReadWriteSessionResultV2? - /// - Remark: Generated from `#/components/schemas/Result/deleteSubOrganizationResult`. - public var deleteSubOrganizationResult: Components.Schemas.DeleteSubOrganizationResult? - /// - Remark: Generated from `#/components/schemas/Result/initOtpAuthResult`. - public var initOtpAuthResult: Components.Schemas.InitOtpAuthResult? - /// - Remark: Generated from `#/components/schemas/Result/otpAuthResult`. - public var otpAuthResult: Components.Schemas.OtpAuthResult? - /// - Remark: Generated from `#/components/schemas/Result/createSubOrganizationResultV7`. - public var createSubOrganizationResultV7: Components.Schemas.CreateSubOrganizationResultV7? - /// - Remark: Generated from `#/components/schemas/Result/updateWalletResult`. - public var updateWalletResult: Components.Schemas.UpdateWalletResult? - /// - Remark: Generated from `#/components/schemas/Result/updatePolicyResultV2`. - public var updatePolicyResultV2: Components.Schemas.UpdatePolicyResultV2? - /// - Remark: Generated from `#/components/schemas/Result/initOtpAuthResultV2`. - public var initOtpAuthResultV2: Components.Schemas.InitOtpAuthResultV2? - /// - Remark: Generated from `#/components/schemas/Result/initOtpResult`. - public var initOtpResult: Components.Schemas.InitOtpResult? - /// - Remark: Generated from `#/components/schemas/Result/verifyOtpResult`. - public var verifyOtpResult: Components.Schemas.VerifyOtpResult? - /// - Remark: Generated from `#/components/schemas/Result/otpLoginResult`. - public var otpLoginResult: Components.Schemas.OtpLoginResult? - /// - Remark: Generated from `#/components/schemas/Result/stampLoginResult`. - public var stampLoginResult: Components.Schemas.StampLoginResult? - /// - Remark: Generated from `#/components/schemas/Result/oauthLoginResult`. - public var oauthLoginResult: Components.Schemas.OauthLoginResult? - /// - Remark: Generated from `#/components/schemas/Result/updateUserNameResult`. - public var updateUserNameResult: Components.Schemas.UpdateUserNameResult? - /// - Remark: Generated from `#/components/schemas/Result/updateUserEmailResult`. - public var updateUserEmailResult: Components.Schemas.UpdateUserEmailResult? - /// - Remark: Generated from `#/components/schemas/Result/updateUserPhoneNumberResult`. - public var updateUserPhoneNumberResult: Components.Schemas.UpdateUserPhoneNumberResult? - /// Creates a new `Result`. - /// - /// - Parameters: - /// - createOrganizationResult: - /// - createAuthenticatorsResult: - /// - createUsersResult: - /// - createPrivateKeysResult: - /// - createInvitationsResult: - /// - acceptInvitationResult: - /// - signRawPayloadResult: - /// - createPolicyResult: - /// - disablePrivateKeyResult: - /// - deleteUsersResult: - /// - deleteAuthenticatorsResult: - /// - deleteInvitationResult: - /// - deleteOrganizationResult: - /// - deletePolicyResult: - /// - createUserTagResult: - /// - deleteUserTagsResult: - /// - signTransactionResult: - /// - deleteApiKeysResult: - /// - createApiKeysResult: - /// - createPrivateKeyTagResult: - /// - deletePrivateKeyTagsResult: - /// - setPaymentMethodResult: - /// - activateBillingTierResult: - /// - deletePaymentMethodResult: - /// - createApiOnlyUsersResult: - /// - updateRootQuorumResult: - /// - updateUserTagResult: - /// - updatePrivateKeyTagResult: - /// - createSubOrganizationResult: - /// - updateAllowedOriginsResult: - /// - createPrivateKeysResultV2: - /// - updateUserResult: - /// - updatePolicyResult: - /// - createSubOrganizationResultV3: - /// - createWalletResult: - /// - createWalletAccountsResult: - /// - initUserEmailRecoveryResult: - /// - recoverUserResult: - /// - setOrganizationFeatureResult: - /// - removeOrganizationFeatureResult: - /// - exportPrivateKeyResult: - /// - exportWalletResult: - /// - createSubOrganizationResultV4: - /// - emailAuthResult: - /// - exportWalletAccountResult: - /// - initImportWalletResult: - /// - importWalletResult: - /// - initImportPrivateKeyResult: - /// - importPrivateKeyResult: - /// - createPoliciesResult: - /// - signRawPayloadsResult: - /// - createReadOnlySessionResult: - /// - createOauthProvidersResult: - /// - deleteOauthProvidersResult: - /// - createSubOrganizationResultV5: - /// - oauthResult: - /// - createReadWriteSessionResult: - /// - createSubOrganizationResultV6: - /// - deletePrivateKeysResult: - /// - deleteWalletsResult: - /// - createReadWriteSessionResultV2: - /// - deleteSubOrganizationResult: - /// - initOtpAuthResult: - /// - otpAuthResult: - /// - createSubOrganizationResultV7: - /// - updateWalletResult: - /// - updatePolicyResultV2: - /// - initOtpAuthResultV2: - /// - initOtpResult: - /// - verifyOtpResult: - /// - otpLoginResult: - /// - stampLoginResult: - /// - oauthLoginResult: - /// - updateUserNameResult: - /// - updateUserEmailResult: - /// - updateUserPhoneNumberResult: - public init( - createOrganizationResult: Components.Schemas.CreateOrganizationResult? = nil, - createAuthenticatorsResult: Components.Schemas.CreateAuthenticatorsResult? = nil, - createUsersResult: Components.Schemas.CreateUsersResult? = nil, - createPrivateKeysResult: Components.Schemas.CreatePrivateKeysResult? = nil, - createInvitationsResult: Components.Schemas.CreateInvitationsResult? = nil, - acceptInvitationResult: Components.Schemas.AcceptInvitationResult? = nil, - signRawPayloadResult: Components.Schemas.SignRawPayloadResult? = nil, - createPolicyResult: Components.Schemas.CreatePolicyResult? = nil, - disablePrivateKeyResult: Components.Schemas.DisablePrivateKeyResult? = nil, - deleteUsersResult: Components.Schemas.DeleteUsersResult? = nil, - deleteAuthenticatorsResult: Components.Schemas.DeleteAuthenticatorsResult? = nil, - deleteInvitationResult: Components.Schemas.DeleteInvitationResult? = nil, - deleteOrganizationResult: Components.Schemas.DeleteOrganizationResult? = nil, - deletePolicyResult: Components.Schemas.DeletePolicyResult? = nil, - createUserTagResult: Components.Schemas.CreateUserTagResult? = nil, - deleteUserTagsResult: Components.Schemas.DeleteUserTagsResult? = nil, - signTransactionResult: Components.Schemas.SignTransactionResult? = nil, - deleteApiKeysResult: Components.Schemas.DeleteApiKeysResult? = nil, - createApiKeysResult: Components.Schemas.CreateApiKeysResult? = nil, - createPrivateKeyTagResult: Components.Schemas.CreatePrivateKeyTagResult? = nil, - deletePrivateKeyTagsResult: Components.Schemas.DeletePrivateKeyTagsResult? = nil, - setPaymentMethodResult: Components.Schemas.SetPaymentMethodResult? = nil, - activateBillingTierResult: Components.Schemas.ActivateBillingTierResult? = nil, - deletePaymentMethodResult: Components.Schemas.DeletePaymentMethodResult? = nil, - createApiOnlyUsersResult: Components.Schemas.CreateApiOnlyUsersResult? = nil, - updateRootQuorumResult: Components.Schemas.UpdateRootQuorumResult? = nil, - updateUserTagResult: Components.Schemas.UpdateUserTagResult? = nil, - updatePrivateKeyTagResult: Components.Schemas.UpdatePrivateKeyTagResult? = nil, - createSubOrganizationResult: Components.Schemas.CreateSubOrganizationResult? = nil, - updateAllowedOriginsResult: Components.Schemas.UpdateAllowedOriginsResult? = nil, - createPrivateKeysResultV2: Components.Schemas.CreatePrivateKeysResultV2? = nil, - updateUserResult: Components.Schemas.UpdateUserResult? = nil, - updatePolicyResult: Components.Schemas.UpdatePolicyResult? = nil, - createSubOrganizationResultV3: Components.Schemas.CreateSubOrganizationResultV3? = nil, - createWalletResult: Components.Schemas.CreateWalletResult? = nil, - createWalletAccountsResult: Components.Schemas.CreateWalletAccountsResult? = nil, - initUserEmailRecoveryResult: Components.Schemas.InitUserEmailRecoveryResult? = nil, - recoverUserResult: Components.Schemas.RecoverUserResult? = nil, - setOrganizationFeatureResult: Components.Schemas.SetOrganizationFeatureResult? = nil, - removeOrganizationFeatureResult: Components.Schemas.RemoveOrganizationFeatureResult? = nil, - exportPrivateKeyResult: Components.Schemas.ExportPrivateKeyResult? = nil, - exportWalletResult: Components.Schemas.ExportWalletResult? = nil, - createSubOrganizationResultV4: Components.Schemas.CreateSubOrganizationResultV4? = nil, - emailAuthResult: Components.Schemas.EmailAuthResult? = nil, - exportWalletAccountResult: Components.Schemas.ExportWalletAccountResult? = nil, - initImportWalletResult: Components.Schemas.InitImportWalletResult? = nil, - importWalletResult: Components.Schemas.ImportWalletResult? = nil, - initImportPrivateKeyResult: Components.Schemas.InitImportPrivateKeyResult? = nil, - importPrivateKeyResult: Components.Schemas.ImportPrivateKeyResult? = nil, - createPoliciesResult: Components.Schemas.CreatePoliciesResult? = nil, - signRawPayloadsResult: Components.Schemas.SignRawPayloadsResult? = nil, - createReadOnlySessionResult: Components.Schemas.CreateReadOnlySessionResult? = nil, - createOauthProvidersResult: Components.Schemas.CreateOauthProvidersResult? = nil, - deleteOauthProvidersResult: Components.Schemas.DeleteOauthProvidersResult? = nil, - createSubOrganizationResultV5: Components.Schemas.CreateSubOrganizationResultV5? = nil, - oauthResult: Components.Schemas.OauthResult? = nil, - createReadWriteSessionResult: Components.Schemas.CreateReadWriteSessionResult? = nil, - createSubOrganizationResultV6: Components.Schemas.CreateSubOrganizationResultV6? = nil, - deletePrivateKeysResult: Components.Schemas.DeletePrivateKeysResult? = nil, - deleteWalletsResult: Components.Schemas.DeleteWalletsResult? = nil, - createReadWriteSessionResultV2: Components.Schemas.CreateReadWriteSessionResultV2? = nil, - deleteSubOrganizationResult: Components.Schemas.DeleteSubOrganizationResult? = nil, - initOtpAuthResult: Components.Schemas.InitOtpAuthResult? = nil, - otpAuthResult: Components.Schemas.OtpAuthResult? = nil, - createSubOrganizationResultV7: Components.Schemas.CreateSubOrganizationResultV7? = nil, - updateWalletResult: Components.Schemas.UpdateWalletResult? = nil, - updatePolicyResultV2: Components.Schemas.UpdatePolicyResultV2? = nil, - initOtpAuthResultV2: Components.Schemas.InitOtpAuthResultV2? = nil, - initOtpResult: Components.Schemas.InitOtpResult? = nil, - verifyOtpResult: Components.Schemas.VerifyOtpResult? = nil, - otpLoginResult: Components.Schemas.OtpLoginResult? = nil, - stampLoginResult: Components.Schemas.StampLoginResult? = nil, - oauthLoginResult: Components.Schemas.OauthLoginResult? = nil, - updateUserNameResult: Components.Schemas.UpdateUserNameResult? = nil, - updateUserEmailResult: Components.Schemas.UpdateUserEmailResult? = nil, - updateUserPhoneNumberResult: Components.Schemas.UpdateUserPhoneNumberResult? = nil - ) { - self.createOrganizationResult = createOrganizationResult - self.createAuthenticatorsResult = createAuthenticatorsResult - self.createUsersResult = createUsersResult - self.createPrivateKeysResult = createPrivateKeysResult - self.createInvitationsResult = createInvitationsResult - self.acceptInvitationResult = acceptInvitationResult - self.signRawPayloadResult = signRawPayloadResult - self.createPolicyResult = createPolicyResult - self.disablePrivateKeyResult = disablePrivateKeyResult - self.deleteUsersResult = deleteUsersResult - self.deleteAuthenticatorsResult = deleteAuthenticatorsResult - self.deleteInvitationResult = deleteInvitationResult - self.deleteOrganizationResult = deleteOrganizationResult - self.deletePolicyResult = deletePolicyResult - self.createUserTagResult = createUserTagResult - self.deleteUserTagsResult = deleteUserTagsResult - self.signTransactionResult = signTransactionResult - self.deleteApiKeysResult = deleteApiKeysResult - self.createApiKeysResult = createApiKeysResult - self.createPrivateKeyTagResult = createPrivateKeyTagResult - self.deletePrivateKeyTagsResult = deletePrivateKeyTagsResult - self.setPaymentMethodResult = setPaymentMethodResult - self.activateBillingTierResult = activateBillingTierResult - self.deletePaymentMethodResult = deletePaymentMethodResult - self.createApiOnlyUsersResult = createApiOnlyUsersResult - self.updateRootQuorumResult = updateRootQuorumResult - self.updateUserTagResult = updateUserTagResult - self.updatePrivateKeyTagResult = updatePrivateKeyTagResult - self.createSubOrganizationResult = createSubOrganizationResult - self.updateAllowedOriginsResult = updateAllowedOriginsResult - self.createPrivateKeysResultV2 = createPrivateKeysResultV2 - self.updateUserResult = updateUserResult - self.updatePolicyResult = updatePolicyResult - self.createSubOrganizationResultV3 = createSubOrganizationResultV3 - self.createWalletResult = createWalletResult - self.createWalletAccountsResult = createWalletAccountsResult - self.initUserEmailRecoveryResult = initUserEmailRecoveryResult - self.recoverUserResult = recoverUserResult - self.setOrganizationFeatureResult = setOrganizationFeatureResult - self.removeOrganizationFeatureResult = removeOrganizationFeatureResult - self.exportPrivateKeyResult = exportPrivateKeyResult - self.exportWalletResult = exportWalletResult - self.createSubOrganizationResultV4 = createSubOrganizationResultV4 - self.emailAuthResult = emailAuthResult - self.exportWalletAccountResult = exportWalletAccountResult - self.initImportWalletResult = initImportWalletResult - self.importWalletResult = importWalletResult - self.initImportPrivateKeyResult = initImportPrivateKeyResult - self.importPrivateKeyResult = importPrivateKeyResult - self.createPoliciesResult = createPoliciesResult - self.signRawPayloadsResult = signRawPayloadsResult - self.createReadOnlySessionResult = createReadOnlySessionResult - self.createOauthProvidersResult = createOauthProvidersResult - self.deleteOauthProvidersResult = deleteOauthProvidersResult - self.createSubOrganizationResultV5 = createSubOrganizationResultV5 - self.oauthResult = oauthResult - self.createReadWriteSessionResult = createReadWriteSessionResult - self.createSubOrganizationResultV6 = createSubOrganizationResultV6 - self.deletePrivateKeysResult = deletePrivateKeysResult - self.deleteWalletsResult = deleteWalletsResult - self.createReadWriteSessionResultV2 = createReadWriteSessionResultV2 - self.deleteSubOrganizationResult = deleteSubOrganizationResult - self.initOtpAuthResult = initOtpAuthResult - self.otpAuthResult = otpAuthResult - self.createSubOrganizationResultV7 = createSubOrganizationResultV7 - self.updateWalletResult = updateWalletResult - self.updatePolicyResultV2 = updatePolicyResultV2 - self.initOtpAuthResultV2 = initOtpAuthResultV2 - self.initOtpResult = initOtpResult - self.verifyOtpResult = verifyOtpResult - self.otpLoginResult = otpLoginResult - self.stampLoginResult = stampLoginResult - self.oauthLoginResult = oauthLoginResult - self.updateUserNameResult = updateUserNameResult - self.updateUserEmailResult = updateUserEmailResult - self.updateUserPhoneNumberResult = updateUserPhoneNumberResult - } - public enum CodingKeys: String, CodingKey { - case createOrganizationResult - case createAuthenticatorsResult - case createUsersResult - case createPrivateKeysResult - case createInvitationsResult - case acceptInvitationResult - case signRawPayloadResult - case createPolicyResult - case disablePrivateKeyResult - case deleteUsersResult - case deleteAuthenticatorsResult - case deleteInvitationResult - case deleteOrganizationResult - case deletePolicyResult - case createUserTagResult - case deleteUserTagsResult - case signTransactionResult - case deleteApiKeysResult - case createApiKeysResult - case createPrivateKeyTagResult - case deletePrivateKeyTagsResult - case setPaymentMethodResult - case activateBillingTierResult - case deletePaymentMethodResult - case createApiOnlyUsersResult - case updateRootQuorumResult - case updateUserTagResult - case updatePrivateKeyTagResult - case createSubOrganizationResult - case updateAllowedOriginsResult - case createPrivateKeysResultV2 - case updateUserResult - case updatePolicyResult - case createSubOrganizationResultV3 - case createWalletResult - case createWalletAccountsResult - case initUserEmailRecoveryResult - case recoverUserResult - case setOrganizationFeatureResult - case removeOrganizationFeatureResult - case exportPrivateKeyResult - case exportWalletResult - case createSubOrganizationResultV4 - case emailAuthResult - case exportWalletAccountResult - case initImportWalletResult - case importWalletResult - case initImportPrivateKeyResult - case importPrivateKeyResult - case createPoliciesResult - case signRawPayloadsResult - case createReadOnlySessionResult - case createOauthProvidersResult - case deleteOauthProvidersResult - case createSubOrganizationResultV5 - case oauthResult - case createReadWriteSessionResult - case createSubOrganizationResultV6 - case deletePrivateKeysResult - case deleteWalletsResult - case createReadWriteSessionResultV2 - case deleteSubOrganizationResult - case initOtpAuthResult - case otpAuthResult - case createSubOrganizationResultV7 - case updateWalletResult - case updatePolicyResultV2 - case initOtpAuthResultV2 - case initOtpResult - case verifyOtpResult - case otpLoginResult - case stampLoginResult - case oauthLoginResult - case updateUserNameResult - case updateUserEmailResult - case updateUserPhoneNumberResult - } - } - /// - Remark: Generated from `#/components/schemas/RootUserParams`. - public struct RootUserParams: Codable, Hashable, Sendable { - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParams/userName`. - public var userName: Swift.String - /// The user's email address. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParams/userEmail`. - public var userEmail: Swift.String? - /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParams/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKeyParams] - /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParams/authenticators`. - public var authenticators: [Components.Schemas.AuthenticatorParamsV2] - /// Creates a new `RootUserParams`. - /// - /// - Parameters: - /// - userName: Human-readable name for a User. - /// - userEmail: The user's email address. - /// - apiKeys: A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - authenticators: A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - public init( - userName: Swift.String, - userEmail: Swift.String? = nil, - apiKeys: [Components.Schemas.ApiKeyParams], - authenticators: [Components.Schemas.AuthenticatorParamsV2] - ) { - self.userName = userName - self.userEmail = userEmail - self.apiKeys = apiKeys - self.authenticators = authenticators - } - public enum CodingKeys: String, CodingKey { - case userName - case userEmail - case apiKeys - case authenticators - } - } - /// - Remark: Generated from `#/components/schemas/RootUserParamsV2`. - public struct RootUserParamsV2: Codable, Hashable, Sendable { - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV2/userName`. - public var userName: Swift.String - /// The user's email address. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV2/userEmail`. - public var userEmail: Swift.String? - /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV2/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKeyParams] - /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV2/authenticators`. - public var authenticators: [Components.Schemas.AuthenticatorParamsV2] - /// A list of Oauth providers. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV2/oauthProviders`. - public var oauthProviders: [Components.Schemas.OauthProviderParams] - /// Creates a new `RootUserParamsV2`. - /// - /// - Parameters: - /// - userName: Human-readable name for a User. - /// - userEmail: The user's email address. - /// - apiKeys: A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - authenticators: A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - oauthProviders: A list of Oauth providers. This field, if not needed, should be an empty array in your request body. - public init( - userName: Swift.String, - userEmail: Swift.String? = nil, - apiKeys: [Components.Schemas.ApiKeyParams], - authenticators: [Components.Schemas.AuthenticatorParamsV2], - oauthProviders: [Components.Schemas.OauthProviderParams] - ) { - self.userName = userName - self.userEmail = userEmail - self.apiKeys = apiKeys - self.authenticators = authenticators - self.oauthProviders = oauthProviders - } - public enum CodingKeys: String, CodingKey { - case userName - case userEmail - case apiKeys - case authenticators - case oauthProviders - } - } - /// - Remark: Generated from `#/components/schemas/RootUserParamsV3`. - public struct RootUserParamsV3: Codable, Hashable, Sendable { - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV3/userName`. - public var userName: Swift.String - /// The user's email address. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV3/userEmail`. - public var userEmail: Swift.String? - /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV3/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKeyParamsV2] - /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV3/authenticators`. - public var authenticators: [Components.Schemas.AuthenticatorParamsV2] - /// A list of Oauth providers. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV3/oauthProviders`. - public var oauthProviders: [Components.Schemas.OauthProviderParams] - /// Creates a new `RootUserParamsV3`. - /// - /// - Parameters: - /// - userName: Human-readable name for a User. - /// - userEmail: The user's email address. - /// - apiKeys: A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - authenticators: A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - oauthProviders: A list of Oauth providers. This field, if not needed, should be an empty array in your request body. - public init( - userName: Swift.String, - userEmail: Swift.String? = nil, - apiKeys: [Components.Schemas.ApiKeyParamsV2], - authenticators: [Components.Schemas.AuthenticatorParamsV2], - oauthProviders: [Components.Schemas.OauthProviderParams] - ) { - self.userName = userName - self.userEmail = userEmail - self.apiKeys = apiKeys - self.authenticators = authenticators - self.oauthProviders = oauthProviders - } - public enum CodingKeys: String, CodingKey { - case userName - case userEmail - case apiKeys - case authenticators - case oauthProviders - } - } - /// - Remark: Generated from `#/components/schemas/RootUserParamsV4`. - public struct RootUserParamsV4: Codable, Hashable, Sendable { - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV4/userName`. - public var userName: Swift.String - /// The user's email address. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV4/userEmail`. - public var userEmail: Swift.String? - /// The user's phone number in E.164 format e.g. +13214567890 - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV4/userPhoneNumber`. - public var userPhoneNumber: Swift.String? - /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV4/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKeyParamsV2] - /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV4/authenticators`. - public var authenticators: [Components.Schemas.AuthenticatorParamsV2] - /// A list of Oauth providers. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/RootUserParamsV4/oauthProviders`. - public var oauthProviders: [Components.Schemas.OauthProviderParams] - /// Creates a new `RootUserParamsV4`. - /// - /// - Parameters: - /// - userName: Human-readable name for a User. - /// - userEmail: The user's email address. - /// - userPhoneNumber: The user's phone number in E.164 format e.g. +13214567890 - /// - apiKeys: A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - authenticators: A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - oauthProviders: A list of Oauth providers. This field, if not needed, should be an empty array in your request body. - public init( - userName: Swift.String, - userEmail: Swift.String? = nil, - userPhoneNumber: Swift.String? = nil, - apiKeys: [Components.Schemas.ApiKeyParamsV2], - authenticators: [Components.Schemas.AuthenticatorParamsV2], - oauthProviders: [Components.Schemas.OauthProviderParams] - ) { - self.userName = userName - self.userEmail = userEmail - self.userPhoneNumber = userPhoneNumber - self.apiKeys = apiKeys - self.authenticators = authenticators - self.oauthProviders = oauthProviders - } - public enum CodingKeys: String, CodingKey { - case userName - case userEmail - case userPhoneNumber - case apiKeys - case authenticators - case oauthProviders - } - } - /// - Remark: Generated from `#/components/schemas/Selector`. - public struct Selector: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Selector/subject`. - public var subject: Swift.String? - /// - Remark: Generated from `#/components/schemas/Selector/operator`. - public var _operator: Components.Schemas.Operator? - /// - Remark: Generated from `#/components/schemas/Selector/target`. - public var target: Swift.String? - /// Creates a new `Selector`. - /// - /// - Parameters: - /// - subject: - /// - _operator: - /// - target: - public init( - subject: Swift.String? = nil, - _operator: Components.Schemas.Operator? = nil, - target: Swift.String? = nil - ) { - self.subject = subject - self._operator = _operator - self.target = target - } - public enum CodingKeys: String, CodingKey { - case subject - case _operator = "operator" - case target - } - } - /// - Remark: Generated from `#/components/schemas/SelectorV2`. - public struct SelectorV2: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/SelectorV2/subject`. - public var subject: Swift.String? - /// - Remark: Generated from `#/components/schemas/SelectorV2/operator`. - public var _operator: Components.Schemas.Operator? - /// - Remark: Generated from `#/components/schemas/SelectorV2/targets`. - public var targets: [Swift.String]? - /// Creates a new `SelectorV2`. - /// - /// - Parameters: - /// - subject: - /// - _operator: - /// - targets: - public init( - subject: Swift.String? = nil, - _operator: Components.Schemas.Operator? = nil, - targets: [Swift.String]? = nil - ) { - self.subject = subject - self._operator = _operator - self.targets = targets - } - public enum CodingKeys: String, CodingKey { - case subject - case _operator = "operator" - case targets - } - } - /// - Remark: Generated from `#/components/schemas/SetOrganizationFeatureIntent`. - public struct SetOrganizationFeatureIntent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/SetOrganizationFeatureIntent/name`. - public var name: Components.Schemas.FeatureName - /// Optional value for the feature. Will override existing values if feature is already set. - /// - /// - Remark: Generated from `#/components/schemas/SetOrganizationFeatureIntent/value`. - public var value: Swift.String? - /// Creates a new `SetOrganizationFeatureIntent`. - /// - /// - Parameters: - /// - name: - /// - value: Optional value for the feature. Will override existing values if feature is already set. - public init( - name: Components.Schemas.FeatureName, - value: Swift.String? = nil - ) { - self.name = name - self.value = value - } - public enum CodingKeys: String, CodingKey { - case name - case value - } - } - /// - Remark: Generated from `#/components/schemas/SetOrganizationFeatureRequest`. - public struct SetOrganizationFeatureRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/SetOrganizationFeatureRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE = "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE" - } - /// - Remark: Generated from `#/components/schemas/SetOrganizationFeatureRequest/type`. - public var _type: Components.Schemas.SetOrganizationFeatureRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/SetOrganizationFeatureRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/SetOrganizationFeatureRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/SetOrganizationFeatureRequest/parameters`. - public var parameters: Components.Schemas.SetOrganizationFeatureIntent - /// Creates a new `SetOrganizationFeatureRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.SetOrganizationFeatureRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.SetOrganizationFeatureIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/SetOrganizationFeatureResult`. - public struct SetOrganizationFeatureResult: Codable, Hashable, Sendable { - /// Resulting list of organization features. - /// - /// - Remark: Generated from `#/components/schemas/SetOrganizationFeatureResult/features`. - public var features: [Components.Schemas.Feature] - /// Creates a new `SetOrganizationFeatureResult`. - /// - /// - Parameters: - /// - features: Resulting list of organization features. - public init(features: [Components.Schemas.Feature]) { - self.features = features - } - public enum CodingKeys: String, CodingKey { - case features - } - } - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodIntent`. - public struct SetPaymentMethodIntent: Codable, Hashable, Sendable { - /// The account number of the customer's credit card. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodIntent/number`. - public var number: Swift.String - /// The verification digits of the customer's credit card. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodIntent/cvv`. - public var cvv: Swift.String - /// The month that the credit card expires. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodIntent/expiryMonth`. - public var expiryMonth: Swift.String - /// The year that the credit card expires. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodIntent/expiryYear`. - public var expiryYear: Swift.String - /// The email that will receive invoices for the credit card. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodIntent/cardHolderEmail`. - public var cardHolderEmail: Swift.String - /// The name associated with the credit card. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodIntent/cardHolderName`. - public var cardHolderName: Swift.String - /// Creates a new `SetPaymentMethodIntent`. - /// - /// - Parameters: - /// - number: The account number of the customer's credit card. - /// - cvv: The verification digits of the customer's credit card. - /// - expiryMonth: The month that the credit card expires. - /// - expiryYear: The year that the credit card expires. - /// - cardHolderEmail: The email that will receive invoices for the credit card. - /// - cardHolderName: The name associated with the credit card. - public init( - number: Swift.String, - cvv: Swift.String, - expiryMonth: Swift.String, - expiryYear: Swift.String, - cardHolderEmail: Swift.String, - cardHolderName: Swift.String - ) { - self.number = number - self.cvv = cvv - self.expiryMonth = expiryMonth - self.expiryYear = expiryYear - self.cardHolderEmail = cardHolderEmail - self.cardHolderName = cardHolderName - } - public enum CodingKeys: String, CodingKey { - case number - case cvv - case expiryMonth - case expiryYear - case cardHolderEmail - case cardHolderName - } - } - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodIntentV2`. - public struct SetPaymentMethodIntentV2: Codable, Hashable, Sendable { - /// The id of the payment method that was created clientside. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodIntentV2/paymentMethodId`. - public var paymentMethodId: Swift.String - /// The email that will receive invoices for the credit card. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodIntentV2/cardHolderEmail`. - public var cardHolderEmail: Swift.String - /// The name associated with the credit card. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodIntentV2/cardHolderName`. - public var cardHolderName: Swift.String - /// Creates a new `SetPaymentMethodIntentV2`. - /// - /// - Parameters: - /// - paymentMethodId: The id of the payment method that was created clientside. - /// - cardHolderEmail: The email that will receive invoices for the credit card. - /// - cardHolderName: The name associated with the credit card. - public init( - paymentMethodId: Swift.String, - cardHolderEmail: Swift.String, - cardHolderName: Swift.String - ) { - self.paymentMethodId = paymentMethodId - self.cardHolderEmail = cardHolderEmail - self.cardHolderName = cardHolderName - } - public enum CodingKeys: String, CodingKey { - case paymentMethodId - case cardHolderEmail - case cardHolderName - } - } - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodResult`. - public struct SetPaymentMethodResult: Codable, Hashable, Sendable { - /// The last four digits of the credit card added. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodResult/lastFour`. - public var lastFour: Swift.String - /// The name associated with the payment method. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodResult/cardHolderName`. - public var cardHolderName: Swift.String - /// The email address associated with the payment method. - /// - /// - Remark: Generated from `#/components/schemas/SetPaymentMethodResult/cardHolderEmail`. - public var cardHolderEmail: Swift.String - /// Creates a new `SetPaymentMethodResult`. - /// - /// - Parameters: - /// - lastFour: The last four digits of the credit card added. - /// - cardHolderName: The name associated with the payment method. - /// - cardHolderEmail: The email address associated with the payment method. - public init( - lastFour: Swift.String, - cardHolderName: Swift.String, - cardHolderEmail: Swift.String - ) { - self.lastFour = lastFour - self.cardHolderName = cardHolderName - self.cardHolderEmail = cardHolderEmail - } - public enum CodingKeys: String, CodingKey { - case lastFour - case cardHolderName - case cardHolderEmail - } - } - /// - Remark: Generated from `#/components/schemas/SignRawPayloadIntent`. - public struct SignRawPayloadIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Private Key. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadIntent/privateKeyId`. - public var privateKeyId: Swift.String - /// Raw unsigned payload to be signed. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadIntent/payload`. - public var payload: Swift.String - /// - Remark: Generated from `#/components/schemas/SignRawPayloadIntent/encoding`. - public var encoding: Components.Schemas.PayloadEncoding - /// - Remark: Generated from `#/components/schemas/SignRawPayloadIntent/hashFunction`. - public var hashFunction: Components.Schemas.HashFunction - /// Creates a new `SignRawPayloadIntent`. - /// - /// - Parameters: - /// - privateKeyId: Unique identifier for a given Private Key. - /// - payload: Raw unsigned payload to be signed. - /// - encoding: - /// - hashFunction: - public init( - privateKeyId: Swift.String, - payload: Swift.String, - encoding: Components.Schemas.PayloadEncoding, - hashFunction: Components.Schemas.HashFunction - ) { - self.privateKeyId = privateKeyId - self.payload = payload - self.encoding = encoding - self.hashFunction = hashFunction - } - public enum CodingKeys: String, CodingKey { - case privateKeyId - case payload - case encoding - case hashFunction - } - } - /// - Remark: Generated from `#/components/schemas/SignRawPayloadIntentV2`. - public struct SignRawPayloadIntentV2: Codable, Hashable, Sendable { - /// A Wallet account address, Private Key address, or Private Key identifier. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadIntentV2/signWith`. - public var signWith: Swift.String - /// Raw unsigned payload to be signed. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadIntentV2/payload`. - public var payload: Swift.String - /// - Remark: Generated from `#/components/schemas/SignRawPayloadIntentV2/encoding`. - public var encoding: Components.Schemas.PayloadEncoding - /// - Remark: Generated from `#/components/schemas/SignRawPayloadIntentV2/hashFunction`. - public var hashFunction: Components.Schemas.HashFunction - /// Creates a new `SignRawPayloadIntentV2`. - /// - /// - Parameters: - /// - signWith: A Wallet account address, Private Key address, or Private Key identifier. - /// - payload: Raw unsigned payload to be signed. - /// - encoding: - /// - hashFunction: - public init( - signWith: Swift.String, - payload: Swift.String, - encoding: Components.Schemas.PayloadEncoding, - hashFunction: Components.Schemas.HashFunction - ) { - self.signWith = signWith - self.payload = payload - self.encoding = encoding - self.hashFunction = hashFunction - } - public enum CodingKeys: String, CodingKey { - case signWith - case payload - case encoding - case hashFunction - } - } - /// - Remark: Generated from `#/components/schemas/SignRawPayloadRequest`. - public struct SignRawPayloadRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/SignRawPayloadRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2 = "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2" - } - /// - Remark: Generated from `#/components/schemas/SignRawPayloadRequest/type`. - public var _type: Components.Schemas.SignRawPayloadRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/SignRawPayloadRequest/parameters`. - public var parameters: Components.Schemas.SignRawPayloadIntentV2 - /// Creates a new `SignRawPayloadRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.SignRawPayloadRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.SignRawPayloadIntentV2 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/SignRawPayloadResult`. - public struct SignRawPayloadResult: Codable, Hashable, Sendable { - /// Component of an ECSDA signature. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadResult/r`. - public var r: Swift.String - /// Component of an ECSDA signature. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadResult/s`. - public var s: Swift.String - /// Component of an ECSDA signature. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadResult/v`. - public var v: Swift.String - /// Creates a new `SignRawPayloadResult`. - /// - /// - Parameters: - /// - r: Component of an ECSDA signature. - /// - s: Component of an ECSDA signature. - /// - v: Component of an ECSDA signature. - public init( - r: Swift.String, - s: Swift.String, - v: Swift.String - ) { - self.r = r - self.s = s - self.v = v - } - public enum CodingKeys: String, CodingKey { - case r - case s - case v - } - } - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsIntent`. - public struct SignRawPayloadsIntent: Codable, Hashable, Sendable { - /// A Wallet account address, Private Key address, or Private Key identifier. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsIntent/signWith`. - public var signWith: Swift.String - /// An array of raw unsigned payloads to be signed. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsIntent/payloads`. - public var payloads: [Swift.String] - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsIntent/encoding`. - public var encoding: Components.Schemas.PayloadEncoding - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsIntent/hashFunction`. - public var hashFunction: Components.Schemas.HashFunction - /// Creates a new `SignRawPayloadsIntent`. - /// - /// - Parameters: - /// - signWith: A Wallet account address, Private Key address, or Private Key identifier. - /// - payloads: An array of raw unsigned payloads to be signed. - /// - encoding: - /// - hashFunction: - public init( - signWith: Swift.String, - payloads: [Swift.String], - encoding: Components.Schemas.PayloadEncoding, - hashFunction: Components.Schemas.HashFunction - ) { - self.signWith = signWith - self.payloads = payloads - self.encoding = encoding - self.hashFunction = hashFunction - } - public enum CodingKeys: String, CodingKey { - case signWith - case payloads - case encoding - case hashFunction - } - } - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsRequest`. - public struct SignRawPayloadsRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_SIGN_RAW_PAYLOADS = "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS" - } - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsRequest/type`. - public var _type: Components.Schemas.SignRawPayloadsRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsRequest/parameters`. - public var parameters: Components.Schemas.SignRawPayloadsIntent - /// Creates a new `SignRawPayloadsRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.SignRawPayloadsRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.SignRawPayloadsIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsResult`. - public struct SignRawPayloadsResult: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/SignRawPayloadsResult/signatures`. - public var signatures: [Components.Schemas.SignRawPayloadResult]? - /// Creates a new `SignRawPayloadsResult`. - /// - /// - Parameters: - /// - signatures: - public init(signatures: [Components.Schemas.SignRawPayloadResult]? = nil) { - self.signatures = signatures - } - public enum CodingKeys: String, CodingKey { - case signatures - } - } - /// - Remark: Generated from `#/components/schemas/SignTransactionIntent`. - public struct SignTransactionIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Private Key. - /// - /// - Remark: Generated from `#/components/schemas/SignTransactionIntent/privateKeyId`. - public var privateKeyId: Swift.String - /// Raw unsigned transaction to be signed by a particular Private Key. - /// - /// - Remark: Generated from `#/components/schemas/SignTransactionIntent/unsignedTransaction`. - public var unsignedTransaction: Swift.String - /// - Remark: Generated from `#/components/schemas/SignTransactionIntent/type`. - public var _type: Components.Schemas.TransactionType - /// Creates a new `SignTransactionIntent`. - /// - /// - Parameters: - /// - privateKeyId: Unique identifier for a given Private Key. - /// - unsignedTransaction: Raw unsigned transaction to be signed by a particular Private Key. - /// - _type: - public init( - privateKeyId: Swift.String, - unsignedTransaction: Swift.String, - _type: Components.Schemas.TransactionType - ) { - self.privateKeyId = privateKeyId - self.unsignedTransaction = unsignedTransaction - self._type = _type - } - public enum CodingKeys: String, CodingKey { - case privateKeyId - case unsignedTransaction - case _type = "type" - } - } - /// - Remark: Generated from `#/components/schemas/SignTransactionIntentV2`. - public struct SignTransactionIntentV2: Codable, Hashable, Sendable { - /// A Wallet account address, Private Key address, or Private Key identifier. - /// - /// - Remark: Generated from `#/components/schemas/SignTransactionIntentV2/signWith`. - public var signWith: Swift.String - /// Raw unsigned transaction to be signed - /// - /// - Remark: Generated from `#/components/schemas/SignTransactionIntentV2/unsignedTransaction`. - public var unsignedTransaction: Swift.String - /// - Remark: Generated from `#/components/schemas/SignTransactionIntentV2/type`. - public var _type: Components.Schemas.TransactionType - /// Creates a new `SignTransactionIntentV2`. - /// - /// - Parameters: - /// - signWith: A Wallet account address, Private Key address, or Private Key identifier. - /// - unsignedTransaction: Raw unsigned transaction to be signed - /// - _type: - public init( - signWith: Swift.String, - unsignedTransaction: Swift.String, - _type: Components.Schemas.TransactionType - ) { - self.signWith = signWith - self.unsignedTransaction = unsignedTransaction - self._type = _type - } - public enum CodingKeys: String, CodingKey { - case signWith - case unsignedTransaction - case _type = "type" - } - } - /// - Remark: Generated from `#/components/schemas/SignTransactionRequest`. - public struct SignTransactionRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/SignTransactionRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_SIGN_TRANSACTION_V2 = "ACTIVITY_TYPE_SIGN_TRANSACTION_V2" - } - /// - Remark: Generated from `#/components/schemas/SignTransactionRequest/type`. - public var _type: Components.Schemas.SignTransactionRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/SignTransactionRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/SignTransactionRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/SignTransactionRequest/parameters`. - public var parameters: Components.Schemas.SignTransactionIntentV2 - /// Creates a new `SignTransactionRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.SignTransactionRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.SignTransactionIntentV2 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/SignTransactionResult`. - public struct SignTransactionResult: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/SignTransactionResult/signedTransaction`. - public var signedTransaction: Swift.String - /// Creates a new `SignTransactionResult`. - /// - /// - Parameters: - /// - signedTransaction: - public init(signedTransaction: Swift.String) { - self.signedTransaction = signedTransaction - } - public enum CodingKeys: String, CodingKey { - case signedTransaction - } - } - /// - Remark: Generated from `#/components/schemas/SimpleClientExtensionResults`. - public struct SimpleClientExtensionResults: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/SimpleClientExtensionResults/appid`. - public var appid: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/SimpleClientExtensionResults/appidExclude`. - public var appidExclude: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/SimpleClientExtensionResults/credProps`. - public var credProps: Components.Schemas.CredPropsAuthenticationExtensionsClientOutputs? - /// Creates a new `SimpleClientExtensionResults`. - /// - /// - Parameters: - /// - appid: - /// - appidExclude: - /// - credProps: - public init( - appid: Swift.Bool? = nil, - appidExclude: Swift.Bool? = nil, - credProps: Components.Schemas.CredPropsAuthenticationExtensionsClientOutputs? = nil - ) { - self.appid = appid - self.appidExclude = appidExclude - self.credProps = credProps - } - public enum CodingKeys: String, CodingKey { - case appid - case appidExclude - case credProps - } - } - /// - Remark: Generated from `#/components/schemas/SmsCustomizationParams`. - public struct SmsCustomizationParams: Codable, Hashable, Sendable { - /// Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}} - /// - /// - Remark: Generated from `#/components/schemas/SmsCustomizationParams/template`. - public var template: Swift.String? - /// Creates a new `SmsCustomizationParams`. - /// - /// - Parameters: - /// - template: Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}} - public init(template: Swift.String? = nil) { - self.template = template - } - public enum CodingKeys: String, CodingKey { - case template - } - } - /// - Remark: Generated from `#/components/schemas/StampLoginIntent`. - public struct StampLoginIntent: Codable, Hashable, Sendable { - /// Client-side public key generated by the user, which will be conditionally added to org data based on the passkey stamp associated with this request - /// - /// - Remark: Generated from `#/components/schemas/StampLoginIntent/publicKey`. - public var publicKey: Swift.String - /// Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. - /// - /// - Remark: Generated from `#/components/schemas/StampLoginIntent/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Invalidate all other previously generated Login API keys - /// - /// - Remark: Generated from `#/components/schemas/StampLoginIntent/invalidateExisting`. - public var invalidateExisting: Swift.Bool? - /// Creates a new `StampLoginIntent`. - /// - /// - Parameters: - /// - publicKey: Client-side public key generated by the user, which will be conditionally added to org data based on the passkey stamp associated with this request - /// - expirationSeconds: Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. - /// - invalidateExisting: Invalidate all other previously generated Login API keys - public init( - publicKey: Swift.String, - expirationSeconds: Swift.String? = nil, - invalidateExisting: Swift.Bool? = nil - ) { - self.publicKey = publicKey - self.expirationSeconds = expirationSeconds - self.invalidateExisting = invalidateExisting - } - public enum CodingKeys: String, CodingKey { - case publicKey - case expirationSeconds - case invalidateExisting - } - } - /// - Remark: Generated from `#/components/schemas/StampLoginRequest`. - public struct StampLoginRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/StampLoginRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_STAMP_LOGIN = "ACTIVITY_TYPE_STAMP_LOGIN" - } - /// - Remark: Generated from `#/components/schemas/StampLoginRequest/type`. - public var _type: Components.Schemas.StampLoginRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/StampLoginRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/StampLoginRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/StampLoginRequest/parameters`. - public var parameters: Components.Schemas.StampLoginIntent - /// Creates a new `StampLoginRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.StampLoginRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.StampLoginIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/StampLoginResult`. - public struct StampLoginResult: Codable, Hashable, Sendable { - /// Signed JWT containing an expiry, public key, session type, user id, and organization id - /// - /// - Remark: Generated from `#/components/schemas/StampLoginResult/session`. - public var session: Swift.String - /// Creates a new `StampLoginResult`. - /// - /// - Parameters: - /// - session: Signed JWT containing an expiry, public key, session type, user id, and organization id - public init(session: Swift.String) { - self.session = session - } - public enum CodingKeys: String, CodingKey { - case session - } - } - /// - Remark: Generated from `#/components/schemas/Status`. - public struct Status: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Status/code`. - public var code: Swift.Int32? - /// - Remark: Generated from `#/components/schemas/Status/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/components/schemas/Status/details`. - public var details: [Components.Schemas._Any]? - /// Creates a new `Status`. - /// - /// - Parameters: - /// - code: - /// - message: - /// - details: - public init( - code: Swift.Int32? = nil, - message: Swift.String? = nil, - details: [Components.Schemas._Any]? = nil - ) { - self.code = code - self.message = message - self.details = details - } - public enum CodingKeys: String, CodingKey { - case code - case message - case details - } - } - /// - Remark: Generated from `#/components/schemas/TagType`. - @frozen public enum TagType: String, Codable, Hashable, Sendable, CaseIterable { - case TAG_TYPE_USER = "TAG_TYPE_USER" - case TAG_TYPE_PRIVATE_KEY = "TAG_TYPE_PRIVATE_KEY" - } - /// - Remark: Generated from `#/components/schemas/TransactionType`. - @frozen public enum TransactionType: String, Codable, Hashable, Sendable, CaseIterable { - case TRANSACTION_TYPE_ETHEREUM = "TRANSACTION_TYPE_ETHEREUM" - case TRANSACTION_TYPE_SOLANA = "TRANSACTION_TYPE_SOLANA" - case TRANSACTION_TYPE_TRON = "TRANSACTION_TYPE_TRON" - } - /// - Remark: Generated from `#/components/schemas/UpdateAllowedOriginsIntent`. - public struct UpdateAllowedOriginsIntent: Codable, Hashable, Sendable { - /// Additional origins requests are allowed from besides Turnkey origins - /// - /// - Remark: Generated from `#/components/schemas/UpdateAllowedOriginsIntent/allowedOrigins`. - public var allowedOrigins: [Swift.String] - /// Creates a new `UpdateAllowedOriginsIntent`. - /// - /// - Parameters: - /// - allowedOrigins: Additional origins requests are allowed from besides Turnkey origins - public init(allowedOrigins: [Swift.String]) { - self.allowedOrigins = allowedOrigins - } - public enum CodingKeys: String, CodingKey { - case allowedOrigins - } - } - /// - Remark: Generated from `#/components/schemas/UpdateAllowedOriginsResult`. - public typealias UpdateAllowedOriginsResult = OpenAPIRuntime.OpenAPIObjectContainer - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntent`. - public struct UpdatePolicyIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Policy. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntent/policyId`. - public var policyId: Swift.String - /// Human-readable name for a Policy. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntent/policyName`. - public var policyName: Swift.String? - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntent/policyEffect`. - public var policyEffect: Components.Schemas.Effect? - /// The condition expression that triggers the Effect (optional). - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntent/policyCondition`. - public var policyCondition: Swift.String? - /// The consensus expression that triggers the Effect (optional). - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntent/policyConsensus`. - public var policyConsensus: Swift.String? - /// Accompanying notes for a Policy (optional). - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntent/policyNotes`. - public var policyNotes: Swift.String? - /// Creates a new `UpdatePolicyIntent`. - /// - /// - Parameters: - /// - policyId: Unique identifier for a given Policy. - /// - policyName: Human-readable name for a Policy. - /// - policyEffect: - /// - policyCondition: The condition expression that triggers the Effect (optional). - /// - policyConsensus: The consensus expression that triggers the Effect (optional). - /// - policyNotes: Accompanying notes for a Policy (optional). - public init( - policyId: Swift.String, - policyName: Swift.String? = nil, - policyEffect: Components.Schemas.Effect? = nil, - policyCondition: Swift.String? = nil, - policyConsensus: Swift.String? = nil, - policyNotes: Swift.String? = nil - ) { - self.policyId = policyId - self.policyName = policyName - self.policyEffect = policyEffect - self.policyCondition = policyCondition - self.policyConsensus = policyConsensus - self.policyNotes = policyNotes - } - public enum CodingKeys: String, CodingKey { - case policyId - case policyName - case policyEffect - case policyCondition - case policyConsensus - case policyNotes - } - } - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntentV2`. - public struct UpdatePolicyIntentV2: Codable, Hashable, Sendable { - /// Unique identifier for a given Policy. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntentV2/policyId`. - public var policyId: Swift.String - /// Human-readable name for a Policy. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntentV2/policyName`. - public var policyName: Swift.String? - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntentV2/policyEffect`. - public var policyEffect: Components.Schemas.Effect? - /// The condition expression that triggers the Effect (optional). - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntentV2/policyCondition`. - public var policyCondition: Swift.String? - /// The consensus expression that triggers the Effect (optional). - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntentV2/policyConsensus`. - public var policyConsensus: Swift.String? - /// Accompanying notes for a Policy (optional). - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyIntentV2/policyNotes`. - public var policyNotes: Swift.String? - /// Creates a new `UpdatePolicyIntentV2`. - /// - /// - Parameters: - /// - policyId: Unique identifier for a given Policy. - /// - policyName: Human-readable name for a Policy. - /// - policyEffect: - /// - policyCondition: The condition expression that triggers the Effect (optional). - /// - policyConsensus: The consensus expression that triggers the Effect (optional). - /// - policyNotes: Accompanying notes for a Policy (optional). - public init( - policyId: Swift.String, - policyName: Swift.String? = nil, - policyEffect: Components.Schemas.Effect? = nil, - policyCondition: Swift.String? = nil, - policyConsensus: Swift.String? = nil, - policyNotes: Swift.String? = nil - ) { - self.policyId = policyId - self.policyName = policyName - self.policyEffect = policyEffect - self.policyCondition = policyCondition - self.policyConsensus = policyConsensus - self.policyNotes = policyNotes - } - public enum CodingKeys: String, CodingKey { - case policyId - case policyName - case policyEffect - case policyCondition - case policyConsensus - case policyNotes - } - } - /// - Remark: Generated from `#/components/schemas/UpdatePolicyRequest`. - public struct UpdatePolicyRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/UpdatePolicyRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_UPDATE_POLICY_V2 = "ACTIVITY_TYPE_UPDATE_POLICY_V2" - } - /// - Remark: Generated from `#/components/schemas/UpdatePolicyRequest/type`. - public var _type: Components.Schemas.UpdatePolicyRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/UpdatePolicyRequest/parameters`. - public var parameters: Components.Schemas.UpdatePolicyIntentV2 - /// Creates a new `UpdatePolicyRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.UpdatePolicyRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.UpdatePolicyIntentV2 - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/UpdatePolicyResult`. - public struct UpdatePolicyResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Policy. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyResult/policyId`. - public var policyId: Swift.String - /// Creates a new `UpdatePolicyResult`. - /// - /// - Parameters: - /// - policyId: Unique identifier for a given Policy. - public init(policyId: Swift.String) { - self.policyId = policyId - } - public enum CodingKeys: String, CodingKey { - case policyId - } - } - /// - Remark: Generated from `#/components/schemas/UpdatePolicyResultV2`. - public struct UpdatePolicyResultV2: Codable, Hashable, Sendable { - /// Unique identifier for a given Policy. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePolicyResultV2/policyId`. - public var policyId: Swift.String - /// Creates a new `UpdatePolicyResultV2`. - /// - /// - Parameters: - /// - policyId: Unique identifier for a given Policy. - public init(policyId: Swift.String) { - self.policyId = policyId - } - public enum CodingKeys: String, CodingKey { - case policyId - } - } - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagIntent`. - public struct UpdatePrivateKeyTagIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Private Key Tag. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagIntent/privateKeyTagId`. - public var privateKeyTagId: Swift.String - /// The new, human-readable name for the tag with the given ID. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagIntent/newPrivateKeyTagName`. - public var newPrivateKeyTagName: Swift.String? - /// A list of Private Keys IDs to add this tag to. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagIntent/addPrivateKeyIds`. - public var addPrivateKeyIds: [Swift.String] - /// A list of Private Key IDs to remove this tag from. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagIntent/removePrivateKeyIds`. - public var removePrivateKeyIds: [Swift.String] - /// Creates a new `UpdatePrivateKeyTagIntent`. - /// - /// - Parameters: - /// - privateKeyTagId: Unique identifier for a given Private Key Tag. - /// - newPrivateKeyTagName: The new, human-readable name for the tag with the given ID. - /// - addPrivateKeyIds: A list of Private Keys IDs to add this tag to. - /// - removePrivateKeyIds: A list of Private Key IDs to remove this tag from. - public init( - privateKeyTagId: Swift.String, - newPrivateKeyTagName: Swift.String? = nil, - addPrivateKeyIds: [Swift.String], - removePrivateKeyIds: [Swift.String] - ) { - self.privateKeyTagId = privateKeyTagId - self.newPrivateKeyTagName = newPrivateKeyTagName - self.addPrivateKeyIds = addPrivateKeyIds - self.removePrivateKeyIds = removePrivateKeyIds - } - public enum CodingKeys: String, CodingKey { - case privateKeyTagId - case newPrivateKeyTagName - case addPrivateKeyIds - case removePrivateKeyIds - } - } - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagRequest`. - public struct UpdatePrivateKeyTagRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG = "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG" - } - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagRequest/type`. - public var _type: Components.Schemas.UpdatePrivateKeyTagRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagRequest/parameters`. - public var parameters: Components.Schemas.UpdatePrivateKeyTagIntent - /// Creates a new `UpdatePrivateKeyTagRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.UpdatePrivateKeyTagRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.UpdatePrivateKeyTagIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagResult`. - public struct UpdatePrivateKeyTagResult: Codable, Hashable, Sendable { - /// Unique identifier for a given Private Key Tag. - /// - /// - Remark: Generated from `#/components/schemas/UpdatePrivateKeyTagResult/privateKeyTagId`. - public var privateKeyTagId: Swift.String - /// Creates a new `UpdatePrivateKeyTagResult`. - /// - /// - Parameters: - /// - privateKeyTagId: Unique identifier for a given Private Key Tag. - public init(privateKeyTagId: Swift.String) { - self.privateKeyTagId = privateKeyTagId - } - public enum CodingKeys: String, CodingKey { - case privateKeyTagId - } - } - /// - Remark: Generated from `#/components/schemas/UpdateRootQuorumIntent`. - public struct UpdateRootQuorumIntent: Codable, Hashable, Sendable { - /// The threshold of unique approvals to reach quorum. - /// - /// - Remark: Generated from `#/components/schemas/UpdateRootQuorumIntent/threshold`. - public var threshold: Swift.Int32 - /// The unique identifiers of users who comprise the quorum set. - /// - /// - Remark: Generated from `#/components/schemas/UpdateRootQuorumIntent/userIds`. - public var userIds: [Swift.String] - /// Creates a new `UpdateRootQuorumIntent`. - /// - /// - Parameters: - /// - threshold: The threshold of unique approvals to reach quorum. - /// - userIds: The unique identifiers of users who comprise the quorum set. - public init( - threshold: Swift.Int32, - userIds: [Swift.String] - ) { - self.threshold = threshold - self.userIds = userIds - } - public enum CodingKeys: String, CodingKey { - case threshold - case userIds - } - } - /// - Remark: Generated from `#/components/schemas/UpdateRootQuorumRequest`. - public struct UpdateRootQuorumRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/UpdateRootQuorumRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_UPDATE_ROOT_QUORUM = "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM" - } - /// - Remark: Generated from `#/components/schemas/UpdateRootQuorumRequest/type`. - public var _type: Components.Schemas.UpdateRootQuorumRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/UpdateRootQuorumRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/UpdateRootQuorumRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/UpdateRootQuorumRequest/parameters`. - public var parameters: Components.Schemas.UpdateRootQuorumIntent - /// Creates a new `UpdateRootQuorumRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.UpdateRootQuorumRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.UpdateRootQuorumIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/UpdateRootQuorumResult`. - public typealias UpdateRootQuorumResult = OpenAPIRuntime.OpenAPIObjectContainer - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailIntent`. - public struct UpdateUserEmailIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailIntent/userId`. - public var userId: Swift.String - /// The user's email address. Setting this to an empty string will remove the user's email. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailIntent/userEmail`. - public var userEmail: Swift.String - /// Signed JWT containing a unique id, expiry, verification type, contact - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailIntent/verificationToken`. - public var verificationToken: Swift.String? - /// Creates a new `UpdateUserEmailIntent`. - /// - /// - Parameters: - /// - userId: Unique identifier for a given User. - /// - userEmail: The user's email address. Setting this to an empty string will remove the user's email. - /// - verificationToken: Signed JWT containing a unique id, expiry, verification type, contact - public init( - userId: Swift.String, - userEmail: Swift.String, - verificationToken: Swift.String? = nil - ) { - self.userId = userId - self.userEmail = userEmail - self.verificationToken = verificationToken - } - public enum CodingKeys: String, CodingKey { - case userId - case userEmail - case verificationToken - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailRequest`. - public struct UpdateUserEmailRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_UPDATE_USER_EMAIL = "ACTIVITY_TYPE_UPDATE_USER_EMAIL" - } - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailRequest/type`. - public var _type: Components.Schemas.UpdateUserEmailRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailRequest/parameters`. - public var parameters: Components.Schemas.UpdateUserEmailIntent - /// Creates a new `UpdateUserEmailRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.UpdateUserEmailRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.UpdateUserEmailIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailResult`. - public struct UpdateUserEmailResult: Codable, Hashable, Sendable { - /// Unique identifier of the User whose email was updated. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserEmailResult/userId`. - public var userId: Swift.String - /// Creates a new `UpdateUserEmailResult`. - /// - /// - Parameters: - /// - userId: Unique identifier of the User whose email was updated. - public init(userId: Swift.String) { - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case userId - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserIntent`. - public struct UpdateUserIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserIntent/userId`. - public var userId: Swift.String - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserIntent/userName`. - public var userName: Swift.String? - /// The user's email address. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserIntent/userEmail`. - public var userEmail: Swift.String? - /// An updated list of User Tags to apply to this User. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserIntent/userTagIds`. - public var userTagIds: [Swift.String]? - /// The user's phone number in E.164 format e.g. +13214567890 - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserIntent/userPhoneNumber`. - public var userPhoneNumber: Swift.String? - /// Creates a new `UpdateUserIntent`. - /// - /// - Parameters: - /// - userId: Unique identifier for a given User. - /// - userName: Human-readable name for a User. - /// - userEmail: The user's email address. - /// - userTagIds: An updated list of User Tags to apply to this User. This field, if not needed, should be an empty array in your request body. - /// - userPhoneNumber: The user's phone number in E.164 format e.g. +13214567890 - public init( - userId: Swift.String, - userName: Swift.String? = nil, - userEmail: Swift.String? = nil, - userTagIds: [Swift.String]? = nil, - userPhoneNumber: Swift.String? = nil - ) { - self.userId = userId - self.userName = userName - self.userEmail = userEmail - self.userTagIds = userTagIds - self.userPhoneNumber = userPhoneNumber - } - public enum CodingKeys: String, CodingKey { - case userId - case userName - case userEmail - case userTagIds - case userPhoneNumber - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserNameIntent`. - public struct UpdateUserNameIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserNameIntent/userId`. - public var userId: Swift.String - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserNameIntent/userName`. - public var userName: Swift.String - /// Creates a new `UpdateUserNameIntent`. - /// - /// - Parameters: - /// - userId: Unique identifier for a given User. - /// - userName: Human-readable name for a User. - public init( - userId: Swift.String, - userName: Swift.String - ) { - self.userId = userId - self.userName = userName - } - public enum CodingKeys: String, CodingKey { - case userId - case userName - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserNameRequest`. - public struct UpdateUserNameRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/UpdateUserNameRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_UPDATE_USER_NAME = "ACTIVITY_TYPE_UPDATE_USER_NAME" - } - /// - Remark: Generated from `#/components/schemas/UpdateUserNameRequest/type`. - public var _type: Components.Schemas.UpdateUserNameRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserNameRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserNameRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/UpdateUserNameRequest/parameters`. - public var parameters: Components.Schemas.UpdateUserNameIntent - /// Creates a new `UpdateUserNameRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.UpdateUserNameRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.UpdateUserNameIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserNameResult`. - public struct UpdateUserNameResult: Codable, Hashable, Sendable { - /// Unique identifier of the User whose name was updated. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserNameResult/userId`. - public var userId: Swift.String - /// Creates a new `UpdateUserNameResult`. - /// - /// - Parameters: - /// - userId: Unique identifier of the User whose name was updated. - public init(userId: Swift.String) { - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case userId - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberIntent`. - public struct UpdateUserPhoneNumberIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberIntent/userId`. - public var userId: Swift.String - /// The user's phone number in E.164 format e.g. +13214567890. Setting this to an empty string will remove the user's phone number. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberIntent/userPhoneNumber`. - public var userPhoneNumber: Swift.String - /// Signed JWT containing a unique id, expiry, verification type, contact - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberIntent/verificationToken`. - public var verificationToken: Swift.String? - /// Creates a new `UpdateUserPhoneNumberIntent`. - /// - /// - Parameters: - /// - userId: Unique identifier for a given User. - /// - userPhoneNumber: The user's phone number in E.164 format e.g. +13214567890. Setting this to an empty string will remove the user's phone number. - /// - verificationToken: Signed JWT containing a unique id, expiry, verification type, contact - public init( - userId: Swift.String, - userPhoneNumber: Swift.String, - verificationToken: Swift.String? = nil - ) { - self.userId = userId - self.userPhoneNumber = userPhoneNumber - self.verificationToken = verificationToken - } - public enum CodingKeys: String, CodingKey { - case userId - case userPhoneNumber - case verificationToken - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberRequest`. - public struct UpdateUserPhoneNumberRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER = "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER" - } - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberRequest/type`. - public var _type: Components.Schemas.UpdateUserPhoneNumberRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberRequest/parameters`. - public var parameters: Components.Schemas.UpdateUserPhoneNumberIntent - /// Creates a new `UpdateUserPhoneNumberRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.UpdateUserPhoneNumberRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.UpdateUserPhoneNumberIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberResult`. - public struct UpdateUserPhoneNumberResult: Codable, Hashable, Sendable { - /// Unique identifier of the User whose phone number was updated. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserPhoneNumberResult/userId`. - public var userId: Swift.String - /// Creates a new `UpdateUserPhoneNumberResult`. - /// - /// - Parameters: - /// - userId: Unique identifier of the User whose phone number was updated. - public init(userId: Swift.String) { - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case userId - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserRequest`. - public struct UpdateUserRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/UpdateUserRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_UPDATE_USER = "ACTIVITY_TYPE_UPDATE_USER" - } - /// - Remark: Generated from `#/components/schemas/UpdateUserRequest/type`. - public var _type: Components.Schemas.UpdateUserRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/UpdateUserRequest/parameters`. - public var parameters: Components.Schemas.UpdateUserIntent - /// Creates a new `UpdateUserRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.UpdateUserRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.UpdateUserIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserResult`. - public struct UpdateUserResult: Codable, Hashable, Sendable { - /// A User ID. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserResult/userId`. - public var userId: Swift.String - /// Creates a new `UpdateUserResult`. - /// - /// - Parameters: - /// - userId: A User ID. - public init(userId: Swift.String) { - self.userId = userId - } - public enum CodingKeys: String, CodingKey { - case userId - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserTagIntent`. - public struct UpdateUserTagIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given User Tag. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserTagIntent/userTagId`. - public var userTagId: Swift.String - /// The new, human-readable name for the tag with the given ID. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserTagIntent/newUserTagName`. - public var newUserTagName: Swift.String? - /// A list of User IDs to add this tag to. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserTagIntent/addUserIds`. - public var addUserIds: [Swift.String] - /// A list of User IDs to remove this tag from. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserTagIntent/removeUserIds`. - public var removeUserIds: [Swift.String] - /// Creates a new `UpdateUserTagIntent`. - /// - /// - Parameters: - /// - userTagId: Unique identifier for a given User Tag. - /// - newUserTagName: The new, human-readable name for the tag with the given ID. - /// - addUserIds: A list of User IDs to add this tag to. - /// - removeUserIds: A list of User IDs to remove this tag from. - public init( - userTagId: Swift.String, - newUserTagName: Swift.String? = nil, - addUserIds: [Swift.String], - removeUserIds: [Swift.String] - ) { - self.userTagId = userTagId - self.newUserTagName = newUserTagName - self.addUserIds = addUserIds - self.removeUserIds = removeUserIds - } - public enum CodingKeys: String, CodingKey { - case userTagId - case newUserTagName - case addUserIds - case removeUserIds - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserTagRequest`. - public struct UpdateUserTagRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/UpdateUserTagRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_UPDATE_USER_TAG = "ACTIVITY_TYPE_UPDATE_USER_TAG" - } - /// - Remark: Generated from `#/components/schemas/UpdateUserTagRequest/type`. - public var _type: Components.Schemas.UpdateUserTagRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserTagRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserTagRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/UpdateUserTagRequest/parameters`. - public var parameters: Components.Schemas.UpdateUserTagIntent - /// Creates a new `UpdateUserTagRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.UpdateUserTagRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.UpdateUserTagIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/UpdateUserTagResult`. - public struct UpdateUserTagResult: Codable, Hashable, Sendable { - /// Unique identifier for a given User Tag. - /// - /// - Remark: Generated from `#/components/schemas/UpdateUserTagResult/userTagId`. - public var userTagId: Swift.String - /// Creates a new `UpdateUserTagResult`. - /// - /// - Parameters: - /// - userTagId: Unique identifier for a given User Tag. - public init(userTagId: Swift.String) { - self.userTagId = userTagId - } - public enum CodingKeys: String, CodingKey { - case userTagId - } - } - /// - Remark: Generated from `#/components/schemas/UpdateWalletIntent`. - public struct UpdateWalletIntent: Codable, Hashable, Sendable { - /// Unique identifier for a given Wallet. - /// - /// - Remark: Generated from `#/components/schemas/UpdateWalletIntent/walletId`. - public var walletId: Swift.String - /// Human-readable name for a Wallet. - /// - /// - Remark: Generated from `#/components/schemas/UpdateWalletIntent/walletName`. - public var walletName: Swift.String? - /// Creates a new `UpdateWalletIntent`. - /// - /// - Parameters: - /// - walletId: Unique identifier for a given Wallet. - /// - walletName: Human-readable name for a Wallet. - public init( - walletId: Swift.String, - walletName: Swift.String? = nil - ) { - self.walletId = walletId - self.walletName = walletName - } - public enum CodingKeys: String, CodingKey { - case walletId - case walletName - } - } - /// - Remark: Generated from `#/components/schemas/UpdateWalletRequest`. - public struct UpdateWalletRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/UpdateWalletRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_UPDATE_WALLET = "ACTIVITY_TYPE_UPDATE_WALLET" - } - /// - Remark: Generated from `#/components/schemas/UpdateWalletRequest/type`. - public var _type: Components.Schemas.UpdateWalletRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/UpdateWalletRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/UpdateWalletRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/UpdateWalletRequest/parameters`. - public var parameters: Components.Schemas.UpdateWalletIntent - /// Creates a new `UpdateWalletRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.UpdateWalletRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.UpdateWalletIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/UpdateWalletResult`. - public struct UpdateWalletResult: Codable, Hashable, Sendable { - /// A Wallet ID. - /// - /// - Remark: Generated from `#/components/schemas/UpdateWalletResult/walletId`. - public var walletId: Swift.String - /// Creates a new `UpdateWalletResult`. - /// - /// - Parameters: - /// - walletId: A Wallet ID. - public init(walletId: Swift.String) { - self.walletId = walletId - } - public enum CodingKeys: String, CodingKey { - case walletId - } - } - /// - Remark: Generated from `#/components/schemas/User`. - public struct User: Codable, Hashable, Sendable { - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/User/userId`. - public var userId: Swift.String - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/User/userName`. - public var userName: Swift.String - /// The user's email address. - /// - /// - Remark: Generated from `#/components/schemas/User/userEmail`. - public var userEmail: Swift.String? - /// The user's phone number in E.164 format e.g. +13214567890 - /// - /// - Remark: Generated from `#/components/schemas/User/userPhoneNumber`. - public var userPhoneNumber: Swift.String? - /// A list of Authenticator parameters. - /// - /// - Remark: Generated from `#/components/schemas/User/authenticators`. - public var authenticators: [Components.Schemas.Authenticator] - /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/User/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKey] - /// A list of User Tag IDs. - /// - /// - Remark: Generated from `#/components/schemas/User/userTags`. - public var userTags: [Swift.String] - /// A list of Oauth Providers. - /// - /// - Remark: Generated from `#/components/schemas/User/oauthProviders`. - public var oauthProviders: [Components.Schemas.OauthProvider] - /// - Remark: Generated from `#/components/schemas/User/createdAt`. - public var createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// - Remark: Generated from `#/components/schemas/User/updatedAt`. - public var updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// Creates a new `User`. - /// - /// - Parameters: - /// - userId: Unique identifier for a given User. - /// - userName: Human-readable name for a User. - /// - userEmail: The user's email address. - /// - userPhoneNumber: The user's phone number in E.164 format e.g. +13214567890 - /// - authenticators: A list of Authenticator parameters. - /// - apiKeys: A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - userTags: A list of User Tag IDs. - /// - oauthProviders: A list of Oauth Providers. - /// - createdAt: - /// - updatedAt: - public init( - userId: Swift.String, - userName: Swift.String, - userEmail: Swift.String? = nil, - userPhoneNumber: Swift.String? = nil, - authenticators: [Components.Schemas.Authenticator], - apiKeys: [Components.Schemas.ApiKey], - userTags: [Swift.String], - oauthProviders: [Components.Schemas.OauthProvider], - createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - ) { - self.userId = userId - self.userName = userName - self.userEmail = userEmail - self.userPhoneNumber = userPhoneNumber - self.authenticators = authenticators - self.apiKeys = apiKeys - self.userTags = userTags - self.oauthProviders = oauthProviders - self.createdAt = createdAt - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case userId - case userName - case userEmail - case userPhoneNumber - case authenticators - case apiKeys - case userTags - case oauthProviders - case createdAt - case updatedAt - } - } - /// - Remark: Generated from `#/components/schemas/UserParams`. - public struct UserParams: Codable, Hashable, Sendable { - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/UserParams/userName`. - public var userName: Swift.String - /// The user's email address. - /// - /// - Remark: Generated from `#/components/schemas/UserParams/userEmail`. - public var userEmail: Swift.String? - /// - Remark: Generated from `#/components/schemas/UserParams/accessType`. - public var accessType: Components.Schemas.AccessType - /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/UserParams/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKeyParams] - /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/UserParams/authenticators`. - public var authenticators: [Components.Schemas.AuthenticatorParams] - /// A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/UserParams/userTags`. - public var userTags: [Swift.String] - /// Creates a new `UserParams`. - /// - /// - Parameters: - /// - userName: Human-readable name for a User. - /// - userEmail: The user's email address. - /// - accessType: - /// - apiKeys: A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - authenticators: A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - userTags: A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. - public init( - userName: Swift.String, - userEmail: Swift.String? = nil, - accessType: Components.Schemas.AccessType, - apiKeys: [Components.Schemas.ApiKeyParams], - authenticators: [Components.Schemas.AuthenticatorParams], - userTags: [Swift.String] - ) { - self.userName = userName - self.userEmail = userEmail - self.accessType = accessType - self.apiKeys = apiKeys - self.authenticators = authenticators - self.userTags = userTags - } - public enum CodingKeys: String, CodingKey { - case userName - case userEmail - case accessType - case apiKeys - case authenticators - case userTags - } - } - /// - Remark: Generated from `#/components/schemas/UserParamsV2`. - public struct UserParamsV2: Codable, Hashable, Sendable { - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV2/userName`. - public var userName: Swift.String - /// The user's email address. - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV2/userEmail`. - public var userEmail: Swift.String? - /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV2/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKeyParams] - /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV2/authenticators`. - public var authenticators: [Components.Schemas.AuthenticatorParamsV2] - /// A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV2/userTags`. - public var userTags: [Swift.String] - /// Creates a new `UserParamsV2`. - /// - /// - Parameters: - /// - userName: Human-readable name for a User. - /// - userEmail: The user's email address. - /// - apiKeys: A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - authenticators: A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - userTags: A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. - public init( - userName: Swift.String, - userEmail: Swift.String? = nil, - apiKeys: [Components.Schemas.ApiKeyParams], - authenticators: [Components.Schemas.AuthenticatorParamsV2], - userTags: [Swift.String] - ) { - self.userName = userName - self.userEmail = userEmail - self.apiKeys = apiKeys - self.authenticators = authenticators - self.userTags = userTags - } - public enum CodingKeys: String, CodingKey { - case userName - case userEmail - case apiKeys - case authenticators - case userTags - } - } - /// - Remark: Generated from `#/components/schemas/UserParamsV3`. - public struct UserParamsV3: Codable, Hashable, Sendable { - /// Human-readable name for a User. - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV3/userName`. - public var userName: Swift.String - /// The user's email address. - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV3/userEmail`. - public var userEmail: Swift.String? - /// The user's phone number in E.164 format e.g. +13214567890 - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV3/userPhoneNumber`. - public var userPhoneNumber: Swift.String? - /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV3/apiKeys`. - public var apiKeys: [Components.Schemas.ApiKeyParamsV2] - /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV3/authenticators`. - public var authenticators: [Components.Schemas.AuthenticatorParamsV2] - /// A list of Oauth providers. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV3/oauthProviders`. - public var oauthProviders: [Components.Schemas.OauthProviderParams] - /// A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/UserParamsV3/userTags`. - public var userTags: [Swift.String] - /// Creates a new `UserParamsV3`. - /// - /// - Parameters: - /// - userName: Human-readable name for a User. - /// - userEmail: The user's email address. - /// - userPhoneNumber: The user's phone number in E.164 format e.g. +13214567890 - /// - apiKeys: A list of API Key parameters. This field, if not needed, should be an empty array in your request body. - /// - authenticators: A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. - /// - oauthProviders: A list of Oauth providers. This field, if not needed, should be an empty array in your request body. - /// - userTags: A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. - public init( - userName: Swift.String, - userEmail: Swift.String? = nil, - userPhoneNumber: Swift.String? = nil, - apiKeys: [Components.Schemas.ApiKeyParamsV2], - authenticators: [Components.Schemas.AuthenticatorParamsV2], - oauthProviders: [Components.Schemas.OauthProviderParams], - userTags: [Swift.String] - ) { - self.userName = userName - self.userEmail = userEmail - self.userPhoneNumber = userPhoneNumber - self.apiKeys = apiKeys - self.authenticators = authenticators - self.oauthProviders = oauthProviders - self.userTags = userTags - } - public enum CodingKeys: String, CodingKey { - case userName - case userEmail - case userPhoneNumber - case apiKeys - case authenticators - case oauthProviders - case userTags - } - } - /// - Remark: Generated from `#/components/schemas/VerifyOtpIntent`. - public struct VerifyOtpIntent: Codable, Hashable, Sendable { - /// ID representing the result of an init OTP activity. - /// - /// - Remark: Generated from `#/components/schemas/VerifyOtpIntent/otpId`. - public var otpId: Swift.String - /// OTP sent out to a user's contact (email or SMS) - /// - /// - Remark: Generated from `#/components/schemas/VerifyOtpIntent/otpCode`. - public var otpCode: Swift.String - /// Expiration window (in seconds) indicating how long the verification token is valid for. If not provided, a default of 1 hour will be used. Maximum value is 86400 seconds (24 hours) - /// - /// - Remark: Generated from `#/components/schemas/VerifyOtpIntent/expirationSeconds`. - public var expirationSeconds: Swift.String? - /// Creates a new `VerifyOtpIntent`. - /// - /// - Parameters: - /// - otpId: ID representing the result of an init OTP activity. - /// - otpCode: OTP sent out to a user's contact (email or SMS) - /// - expirationSeconds: Expiration window (in seconds) indicating how long the verification token is valid for. If not provided, a default of 1 hour will be used. Maximum value is 86400 seconds (24 hours) - public init( - otpId: Swift.String, - otpCode: Swift.String, - expirationSeconds: Swift.String? = nil - ) { - self.otpId = otpId - self.otpCode = otpCode - self.expirationSeconds = expirationSeconds - } - public enum CodingKeys: String, CodingKey { - case otpId - case otpCode - case expirationSeconds - } - } - /// - Remark: Generated from `#/components/schemas/VerifyOtpRequest`. - public struct VerifyOtpRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/VerifyOtpRequest/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable, CaseIterable { - case ACTIVITY_TYPE_VERIFY_OTP = "ACTIVITY_TYPE_VERIFY_OTP" - } - /// - Remark: Generated from `#/components/schemas/VerifyOtpRequest/type`. - public var _type: Components.Schemas.VerifyOtpRequest._typePayload - /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - /// - Remark: Generated from `#/components/schemas/VerifyOtpRequest/timestampMs`. - public var timestampMs: Swift.String - /// Unique identifier for a given Organization. - /// - /// - Remark: Generated from `#/components/schemas/VerifyOtpRequest/organizationId`. - public var organizationId: Swift.String - /// - Remark: Generated from `#/components/schemas/VerifyOtpRequest/parameters`. - public var parameters: Components.Schemas.VerifyOtpIntent - /// Creates a new `VerifyOtpRequest`. - /// - /// - Parameters: - /// - _type: - /// - timestampMs: Timestamp (in milliseconds) of the request, used to verify liveness of user requests. - /// - organizationId: Unique identifier for a given Organization. - /// - parameters: - public init( - _type: Components.Schemas.VerifyOtpRequest._typePayload, - timestampMs: Swift.String, - organizationId: Swift.String, - parameters: Components.Schemas.VerifyOtpIntent - ) { - self._type = _type - self.timestampMs = timestampMs - self.organizationId = organizationId - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case timestampMs - case organizationId - case parameters - } - } - /// - Remark: Generated from `#/components/schemas/VerifyOtpResult`. - public struct VerifyOtpResult: Codable, Hashable, Sendable { - /// Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests) - /// - /// - Remark: Generated from `#/components/schemas/VerifyOtpResult/verificationToken`. - public var verificationToken: Swift.String - /// Creates a new `VerifyOtpResult`. - /// - /// - Parameters: - /// - verificationToken: Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests) - public init(verificationToken: Swift.String) { - self.verificationToken = verificationToken - } - public enum CodingKeys: String, CodingKey { - case verificationToken - } - } - /// - Remark: Generated from `#/components/schemas/Vote`. - public struct Vote: Codable, Hashable, Sendable { - /// Unique identifier for a given Vote object. - /// - /// - Remark: Generated from `#/components/schemas/Vote/id`. - public var id: Swift.String - /// Unique identifier for a given User. - /// - /// - Remark: Generated from `#/components/schemas/Vote/userId`. - public var userId: Swift.String - /// - Remark: Generated from `#/components/schemas/Vote/user`. - public var user: Components.Schemas.User - /// Unique identifier for a given Activity object. - /// - /// - Remark: Generated from `#/components/schemas/Vote/activityId`. - public var activityId: Swift.String - /// - Remark: Generated from `#/components/schemas/Vote/selection`. - @frozen public enum selectionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case VOTE_SELECTION_APPROVED = "VOTE_SELECTION_APPROVED" - case VOTE_SELECTION_REJECTED = "VOTE_SELECTION_REJECTED" - } - /// - Remark: Generated from `#/components/schemas/Vote/selection`. - public var selection: Components.Schemas.Vote.selectionPayload - /// The raw message being signed within a Vote. - /// - /// - Remark: Generated from `#/components/schemas/Vote/message`. - public var message: Swift.String - /// The public component of a cryptographic key pair used to sign messages and transactions. - /// - /// - Remark: Generated from `#/components/schemas/Vote/publicKey`. - public var publicKey: Swift.String - /// The signature applied to a particular vote. - /// - /// - Remark: Generated from `#/components/schemas/Vote/signature`. - public var signature: Swift.String - /// Method used to produce a signature. - /// - /// - Remark: Generated from `#/components/schemas/Vote/scheme`. - public var scheme: Swift.String - /// - Remark: Generated from `#/components/schemas/Vote/createdAt`. - public var createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// Creates a new `Vote`. - /// - /// - Parameters: - /// - id: Unique identifier for a given Vote object. - /// - userId: Unique identifier for a given User. - /// - user: - /// - activityId: Unique identifier for a given Activity object. - /// - selection: - /// - message: The raw message being signed within a Vote. - /// - publicKey: The public component of a cryptographic key pair used to sign messages and transactions. - /// - signature: The signature applied to a particular vote. - /// - scheme: Method used to produce a signature. - /// - createdAt: - public init( - id: Swift.String, - userId: Swift.String, - user: Components.Schemas.User, - activityId: Swift.String, - selection: Components.Schemas.Vote.selectionPayload, - message: Swift.String, - publicKey: Swift.String, - signature: Swift.String, - scheme: Swift.String, - createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - ) { - self.id = id - self.userId = userId - self.user = user - self.activityId = activityId - self.selection = selection - self.message = message - self.publicKey = publicKey - self.signature = signature - self.scheme = scheme - self.createdAt = createdAt - } - public enum CodingKeys: String, CodingKey { - case id - case userId - case user - case activityId - case selection - case message - case publicKey - case signature - case scheme - case createdAt - } - } - /// - Remark: Generated from `#/components/schemas/Wallet`. - public struct Wallet: Codable, Hashable, Sendable { - /// Unique identifier for a given Wallet. - /// - /// - Remark: Generated from `#/components/schemas/Wallet/walletId`. - public var walletId: Swift.String - /// Human-readable name for a Wallet. - /// - /// - Remark: Generated from `#/components/schemas/Wallet/walletName`. - public var walletName: Swift.String - /// - Remark: Generated from `#/components/schemas/Wallet/createdAt`. - public var createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// - Remark: Generated from `#/components/schemas/Wallet/updatedAt`. - public var updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// True when a given Wallet is exported, false otherwise. - /// - /// - Remark: Generated from `#/components/schemas/Wallet/exported`. - public var exported: Swift.Bool - /// True when a given Wallet is imported, false otherwise. - /// - /// - Remark: Generated from `#/components/schemas/Wallet/imported`. - public var imported: Swift.Bool - /// Creates a new `Wallet`. - /// - /// - Parameters: - /// - walletId: Unique identifier for a given Wallet. - /// - walletName: Human-readable name for a Wallet. - /// - createdAt: - /// - updatedAt: - /// - exported: True when a given Wallet is exported, false otherwise. - /// - imported: True when a given Wallet is imported, false otherwise. - public init( - walletId: Swift.String, - walletName: Swift.String, - createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - exported: Swift.Bool, - imported: Swift.Bool - ) { - self.walletId = walletId - self.walletName = walletName - self.createdAt = createdAt - self.updatedAt = updatedAt - self.exported = exported - self.imported = imported - } - public enum CodingKeys: String, CodingKey { - case walletId - case walletName - case createdAt - case updatedAt - case exported - case imported - } - } - /// - Remark: Generated from `#/components/schemas/WalletAccount`. - public struct WalletAccount: Codable, Hashable, Sendable { - /// Unique identifier for a given Wallet Account. - /// - /// - Remark: Generated from `#/components/schemas/WalletAccount/walletAccountId`. - public var walletAccountId: Swift.String - /// The Organization the Account belongs to. - /// - /// - Remark: Generated from `#/components/schemas/WalletAccount/organizationId`. - public var organizationId: Swift.String - /// The Wallet the Account was derived from. - /// - /// - Remark: Generated from `#/components/schemas/WalletAccount/walletId`. - public var walletId: Swift.String - /// - Remark: Generated from `#/components/schemas/WalletAccount/curve`. - public var curve: Components.Schemas.Curve - /// - Remark: Generated from `#/components/schemas/WalletAccount/pathFormat`. - public var pathFormat: Components.Schemas.PathFormat - /// Path used to generate the Account. - /// - /// - Remark: Generated from `#/components/schemas/WalletAccount/path`. - public var path: Swift.String - /// - Remark: Generated from `#/components/schemas/WalletAccount/addressFormat`. - public var addressFormat: Components.Schemas.AddressFormat - /// Address generated using the Wallet seed and Account parameters. - /// - /// - Remark: Generated from `#/components/schemas/WalletAccount/address`. - public var address: Swift.String - /// - Remark: Generated from `#/components/schemas/WalletAccount/createdAt`. - public var createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// - Remark: Generated from `#/components/schemas/WalletAccount/updatedAt`. - public var updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// The public component of this wallet account's underlying cryptographic key pair. - /// - /// - Remark: Generated from `#/components/schemas/WalletAccount/publicKey`. - public var publicKey: Swift.String? - /// Creates a new `WalletAccount`. - /// - /// - Parameters: - /// - walletAccountId: Unique identifier for a given Wallet Account. - /// - organizationId: The Organization the Account belongs to. - /// - walletId: The Wallet the Account was derived from. - /// - curve: - /// - pathFormat: - /// - path: Path used to generate the Account. - /// - addressFormat: - /// - address: Address generated using the Wallet seed and Account parameters. - /// - createdAt: - /// - updatedAt: - /// - publicKey: The public component of this wallet account's underlying cryptographic key pair. - public init( - walletAccountId: Swift.String, - organizationId: Swift.String, - walletId: Swift.String, - curve: Components.Schemas.Curve, - pathFormat: Components.Schemas.PathFormat, - path: Swift.String, - addressFormat: Components.Schemas.AddressFormat, - address: Swift.String, - createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - publicKey: Swift.String? = nil - ) { - self.walletAccountId = walletAccountId - self.organizationId = organizationId - self.walletId = walletId - self.curve = curve - self.pathFormat = pathFormat - self.path = path - self.addressFormat = addressFormat - self.address = address - self.createdAt = createdAt - self.updatedAt = updatedAt - self.publicKey = publicKey - } - public enum CodingKeys: String, CodingKey { - case walletAccountId - case organizationId - case walletId - case curve - case pathFormat - case path - case addressFormat - case address - case createdAt - case updatedAt - case publicKey - } - } - /// - Remark: Generated from `#/components/schemas/WalletAccountParams`. - public struct WalletAccountParams: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/WalletAccountParams/curve`. - public var curve: Components.Schemas.Curve - /// - Remark: Generated from `#/components/schemas/WalletAccountParams/pathFormat`. - public var pathFormat: Components.Schemas.PathFormat - /// Path used to generate a wallet Account. - /// - /// - Remark: Generated from `#/components/schemas/WalletAccountParams/path`. - public var path: Swift.String - /// - Remark: Generated from `#/components/schemas/WalletAccountParams/addressFormat`. - public var addressFormat: Components.Schemas.AddressFormat - /// Creates a new `WalletAccountParams`. - /// - /// - Parameters: - /// - curve: - /// - pathFormat: - /// - path: Path used to generate a wallet Account. - /// - addressFormat: - public init( - curve: Components.Schemas.Curve, - pathFormat: Components.Schemas.PathFormat, - path: Swift.String, - addressFormat: Components.Schemas.AddressFormat - ) { - self.curve = curve - self.pathFormat = pathFormat - self.path = path - self.addressFormat = addressFormat - } - public enum CodingKeys: String, CodingKey { - case curve - case pathFormat - case path - case addressFormat - } - } - /// - Remark: Generated from `#/components/schemas/WalletParams`. - public struct WalletParams: Codable, Hashable, Sendable { - /// Human-readable name for a Wallet. - /// - /// - Remark: Generated from `#/components/schemas/WalletParams/walletName`. - public var walletName: Swift.String - /// A list of wallet Accounts. This field, if not needed, should be an empty array in your request body. - /// - /// - Remark: Generated from `#/components/schemas/WalletParams/accounts`. - public var accounts: [Components.Schemas.WalletAccountParams] - /// Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24. - /// - /// - Remark: Generated from `#/components/schemas/WalletParams/mnemonicLength`. - public var mnemonicLength: Swift.Int32? - /// Creates a new `WalletParams`. - /// - /// - Parameters: - /// - walletName: Human-readable name for a Wallet. - /// - accounts: A list of wallet Accounts. This field, if not needed, should be an empty array in your request body. - /// - mnemonicLength: Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24. - public init( - walletName: Swift.String, - accounts: [Components.Schemas.WalletAccountParams], - mnemonicLength: Swift.Int32? = nil - ) { - self.walletName = walletName - self.accounts = accounts - self.mnemonicLength = mnemonicLength - } - public enum CodingKeys: String, CodingKey { - case walletName - case accounts - case mnemonicLength - } - } - /// - Remark: Generated from `#/components/schemas/WalletResult`. - public struct WalletResult: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/WalletResult/walletId`. - public var walletId: Swift.String - /// A list of account addresses. - /// - /// - Remark: Generated from `#/components/schemas/WalletResult/addresses`. - public var addresses: [Swift.String] - /// Creates a new `WalletResult`. - /// - /// - Parameters: - /// - walletId: - /// - addresses: A list of account addresses. - public init( - walletId: Swift.String, - addresses: [Swift.String] - ) { - self.walletId = walletId - self.addresses = addresses - } - public enum CodingKeys: String, CodingKey { - case walletId - case addresses - } - } - /// - Remark: Generated from `#/components/schemas/activity.v1.Address`. - public struct activity_period_v1_period_Address: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/activity.v1.Address/format`. - public var format: Components.Schemas.AddressFormat? - /// - Remark: Generated from `#/components/schemas/activity.v1.Address/address`. - public var address: Swift.String? - /// Creates a new `activity_period_v1_period_Address`. - /// - /// - Parameters: - /// - format: - /// - address: - public init( - format: Components.Schemas.AddressFormat? = nil, - address: Swift.String? = nil - ) { - self.format = format - self.address = address - } - public enum CodingKeys: String, CodingKey { - case format - case address - } - } - /// - Remark: Generated from `#/components/schemas/data.v1.Address`. - public struct data_period_v1_period_Address: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/data.v1.Address/format`. - public var format: Components.Schemas.AddressFormat? - /// - Remark: Generated from `#/components/schemas/data.v1.Address/address`. - public var address: Swift.String? - /// Creates a new `data_period_v1_period_Address`. - /// - /// - Parameters: - /// - format: - /// - address: - public init( - format: Components.Schemas.AddressFormat? = nil, - address: Swift.String? = nil - ) { - self.format = format - self.address = address - } - public enum CodingKeys: String, CodingKey { - case format - case address - } - } - /// - Remark: Generated from `#/components/schemas/external.data.v1.Credential`. - public struct external_period_data_period_v1_period_Credential: Codable, Hashable, Sendable { - /// The public component of a cryptographic key pair used to sign messages and transactions. - /// - /// - Remark: Generated from `#/components/schemas/external.data.v1.Credential/publicKey`. - public var publicKey: Swift.String - /// - Remark: Generated from `#/components/schemas/external.data.v1.Credential/type`. - public var _type: Components.Schemas.CredentialType - /// Creates a new `external_period_data_period_v1_period_Credential`. - /// - /// - Parameters: - /// - publicKey: The public component of a cryptographic key pair used to sign messages and transactions. - /// - _type: - public init( - publicKey: Swift.String, - _type: Components.Schemas.CredentialType - ) { - self.publicKey = publicKey - self._type = _type - } - public enum CodingKeys: String, CodingKey { - case publicKey - case _type = "type" - } - } - /// - Remark: Generated from `#/components/schemas/external.data.v1.Quorum`. - public struct external_period_data_period_v1_period_Quorum: Codable, Hashable, Sendable { - /// Count of unique approvals required to meet quorum. - /// - /// - Remark: Generated from `#/components/schemas/external.data.v1.Quorum/threshold`. - public var threshold: Swift.Int32 - /// Unique identifiers of quorum set members. - /// - /// - Remark: Generated from `#/components/schemas/external.data.v1.Quorum/userIds`. - public var userIds: [Swift.String] - /// Creates a new `external_period_data_period_v1_period_Quorum`. - /// - /// - Parameters: - /// - threshold: Count of unique approvals required to meet quorum. - /// - userIds: Unique identifiers of quorum set members. - public init( - threshold: Swift.Int32, - userIds: [Swift.String] - ) { - self.threshold = threshold - self.userIds = userIds - } - public enum CodingKeys: String, CodingKey { - case threshold - case userIds - } - } - /// - Remark: Generated from `#/components/schemas/external.data.v1.Timestamp`. - public struct external_period_data_period_v1_period_Timestamp: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/external.data.v1.Timestamp/seconds`. - public var seconds: Swift.String - /// - Remark: Generated from `#/components/schemas/external.data.v1.Timestamp/nanos`. - public var nanos: Swift.String - /// Creates a new `external_period_data_period_v1_period_Timestamp`. - /// - /// - Parameters: - /// - seconds: - /// - nanos: - public init( - seconds: Swift.String, - nanos: Swift.String - ) { - self.seconds = seconds - self.nanos = nanos - } - public enum CodingKeys: String, CodingKey { - case seconds - case nanos - } - } - /// - Remark: Generated from `#/components/schemas/v1.Tag`. - public struct v1_period_Tag: Codable, Hashable, Sendable { - /// Unique identifier for a given Tag. - /// - /// - Remark: Generated from `#/components/schemas/v1.Tag/tagId`. - public var tagId: Swift.String - /// Human-readable name for a Tag. - /// - /// - Remark: Generated from `#/components/schemas/v1.Tag/tagName`. - public var tagName: Swift.String - /// - Remark: Generated from `#/components/schemas/v1.Tag/tagType`. - public var tagType: Components.Schemas.TagType - /// - Remark: Generated from `#/components/schemas/v1.Tag/createdAt`. - public var createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// - Remark: Generated from `#/components/schemas/v1.Tag/updatedAt`. - public var updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - /// Creates a new `v1_period_Tag`. - /// - /// - Parameters: - /// - tagId: Unique identifier for a given Tag. - /// - tagName: Human-readable name for a Tag. - /// - tagType: - /// - createdAt: - /// - updatedAt: - public init( - tagId: Swift.String, - tagName: Swift.String, - tagType: Components.Schemas.TagType, - createdAt: Components.Schemas.external_period_data_period_v1_period_Timestamp, - updatedAt: Components.Schemas.external_period_data_period_v1_period_Timestamp - ) { - self.tagId = tagId - self.tagName = tagName - self.tagType = tagType - self.createdAt = createdAt - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case tagId - case tagName - case tagType - case createdAt - case updatedAt - } - } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters {} - /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. - public enum RequestBodies {} - /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses {} - /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers {} -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { - /// Get Activity - /// - /// Get details about an Activity - /// - /// - Remark: HTTP `POST /public/v1/query/get_activity`. - /// - Remark: Generated from `#/paths//public/v1/query/get_activity/post(GetActivity)`. - public enum GetActivity { - public static let id: Swift.String = "GetActivity" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_activity/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetActivity.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetActivity.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_activity/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_activity/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetActivityRequest) - } - public var body: Operations.GetActivity.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetActivity.Input.Headers = .init(), - body: Operations.GetActivity.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_activity/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_activity/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetActivity.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetActivity.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_activity/post(GetActivity)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetActivity.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetActivity.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get API key - /// - /// Get details about an API key - /// - /// - Remark: HTTP `POST /public/v1/query/get_api_key`. - /// - Remark: Generated from `#/paths//public/v1/query/get_api_key/post(GetApiKey)`. - public enum GetApiKey { - public static let id: Swift.String = "GetApiKey" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_api_key/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetApiKey.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetApiKey.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_api_key/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_api_key/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetApiKeyRequest) - } - public var body: Operations.GetApiKey.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetApiKey.Input.Headers = .init(), - body: Operations.GetApiKey.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_api_key/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_api_key/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetApiKeyResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetApiKeyResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetApiKey.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetApiKey.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_api_key/post(GetApiKey)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetApiKey.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetApiKey.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get API keys - /// - /// Get details about API keys for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/query/get_api_keys/post(GetApiKeys)`. - public enum GetApiKeys { - public static let id: Swift.String = "GetApiKeys" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_api_keys/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetApiKeys.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetApiKeys.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_api_keys/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_api_keys/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetApiKeysRequest) - } - public var body: Operations.GetApiKeys.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetApiKeys.Input.Headers = .init(), - body: Operations.GetApiKeys.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_api_keys/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_api_keys/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetApiKeysResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetApiKeysResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetApiKeys.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetApiKeys.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_api_keys/post(GetApiKeys)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetApiKeys.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetApiKeys.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get Authenticator - /// - /// Get details about an authenticator - /// - /// - Remark: HTTP `POST /public/v1/query/get_authenticator`. - /// - Remark: Generated from `#/paths//public/v1/query/get_authenticator/post(GetAuthenticator)`. - public enum GetAuthenticator { - public static let id: Swift.String = "GetAuthenticator" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_authenticator/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetAuthenticator.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetAuthenticator.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetAuthenticator.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_authenticator/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_authenticator/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetAuthenticatorRequest) - } - public var body: Operations.GetAuthenticator.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetAuthenticator.Input.Headers = .init(), - body: Operations.GetAuthenticator.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_authenticator/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_authenticator/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetAuthenticatorResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetAuthenticatorResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetAuthenticator.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetAuthenticator.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_authenticator/post(GetAuthenticator)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetAuthenticator.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetAuthenticator.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get Authenticators - /// - /// Get details about authenticators for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/query/get_authenticators/post(GetAuthenticators)`. - public enum GetAuthenticators { - public static let id: Swift.String = "GetAuthenticators" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_authenticators/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetAuthenticators.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetAuthenticators.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetAuthenticators.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_authenticators/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_authenticators/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetAuthenticatorsRequest) - } - public var body: Operations.GetAuthenticators.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetAuthenticators.Input.Headers = .init(), - body: Operations.GetAuthenticators.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_authenticators/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_authenticators/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetAuthenticatorsResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetAuthenticatorsResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetAuthenticators.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetAuthenticators.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_authenticators/post(GetAuthenticators)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetAuthenticators.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetAuthenticators.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get Oauth providers - /// - /// Get details about Oauth providers for a user - /// - /// - Remark: HTTP `POST /public/v1/query/get_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/query/get_oauth_providers/post(GetOauthProviders)`. - public enum GetOauthProviders { - public static let id: Swift.String = "GetOauthProviders" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_oauth_providers/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetOauthProviders.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetOauthProviders.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetOauthProviders.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_oauth_providers/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_oauth_providers/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetOauthProvidersRequest) - } - public var body: Operations.GetOauthProviders.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetOauthProviders.Input.Headers = .init(), - body: Operations.GetOauthProviders.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_oauth_providers/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_oauth_providers/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetOauthProvidersResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetOauthProvidersResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetOauthProviders.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetOauthProviders.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_oauth_providers/post(GetOauthProviders)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetOauthProviders.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetOauthProviders.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get Configs - /// - /// Get quorum settings and features for an organization - /// - /// - Remark: HTTP `POST /public/v1/query/get_organization_configs`. - /// - Remark: Generated from `#/paths//public/v1/query/get_organization_configs/post(GetOrganizationConfigs)`. - public enum GetOrganizationConfigs { - public static let id: Swift.String = "GetOrganizationConfigs" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_organization_configs/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetOrganizationConfigs.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetOrganizationConfigs.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetOrganizationConfigs.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_organization_configs/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_organization_configs/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetOrganizationConfigsRequest) - } - public var body: Operations.GetOrganizationConfigs.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetOrganizationConfigs.Input.Headers = .init(), - body: Operations.GetOrganizationConfigs.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_organization_configs/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_organization_configs/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetOrganizationConfigsResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetOrganizationConfigsResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetOrganizationConfigs.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetOrganizationConfigs.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_organization_configs/post(GetOrganizationConfigs)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetOrganizationConfigs.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetOrganizationConfigs.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get Policy - /// - /// Get details about a Policy - /// - /// - Remark: HTTP `POST /public/v1/query/get_policy`. - /// - Remark: Generated from `#/paths//public/v1/query/get_policy/post(GetPolicy)`. - public enum GetPolicy { - public static let id: Swift.String = "GetPolicy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_policy/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetPolicy.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetPolicy.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_policy/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_policy/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetPolicyRequest) - } - public var body: Operations.GetPolicy.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetPolicy.Input.Headers = .init(), - body: Operations.GetPolicy.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_policy/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_policy/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetPolicyResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetPolicyResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetPolicy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetPolicy.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_policy/post(GetPolicy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetPolicy.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetPolicy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get Private Key - /// - /// Get details about a Private Key - /// - /// - Remark: HTTP `POST /public/v1/query/get_private_key`. - /// - Remark: Generated from `#/paths//public/v1/query/get_private_key/post(GetPrivateKey)`. - public enum GetPrivateKey { - public static let id: Swift.String = "GetPrivateKey" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_private_key/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetPrivateKey.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetPrivateKey.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_private_key/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_private_key/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetPrivateKeyRequest) - } - public var body: Operations.GetPrivateKey.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetPrivateKey.Input.Headers = .init(), - body: Operations.GetPrivateKey.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_private_key/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_private_key/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetPrivateKeyResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetPrivateKeyResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetPrivateKey.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetPrivateKey.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_private_key/post(GetPrivateKey)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetPrivateKey.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetPrivateKey.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get User - /// - /// Get details about a User - /// - /// - Remark: HTTP `POST /public/v1/query/get_user`. - /// - Remark: Generated from `#/paths//public/v1/query/get_user/post(GetUser)`. - public enum GetUser { - public static let id: Swift.String = "GetUser" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_user/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetUser.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetUser.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_user/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_user/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetUserRequest) - } - public var body: Operations.GetUser.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetUser.Input.Headers = .init(), - body: Operations.GetUser.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_user/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_user/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetUserResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetUserResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetUser.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_user/post(GetUser)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetUser.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetUser.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get Wallet - /// - /// Get details about a Wallet - /// - /// - Remark: HTTP `POST /public/v1/query/get_wallet`. - /// - Remark: Generated from `#/paths//public/v1/query/get_wallet/post(GetWallet)`. - public enum GetWallet { - public static let id: Swift.String = "GetWallet" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_wallet/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetWallet.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetWallet.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_wallet/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_wallet/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetWalletRequest) - } - public var body: Operations.GetWallet.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetWallet.Input.Headers = .init(), - body: Operations.GetWallet.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_wallet/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_wallet/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetWalletResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetWalletResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetWallet.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetWallet.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_wallet/post(GetWallet)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetWallet.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetWallet.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get Wallet Account - /// - /// Get a single wallet account - /// - /// - Remark: HTTP `POST /public/v1/query/get_wallet_account`. - /// - Remark: Generated from `#/paths//public/v1/query/get_wallet_account/post(GetWalletAccount)`. - public enum GetWalletAccount { - public static let id: Swift.String = "GetWalletAccount" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_wallet_account/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetWalletAccount.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetWalletAccount.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetWalletAccount.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/get_wallet_account/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_wallet_account/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetWalletAccountRequest) - } - public var body: Operations.GetWalletAccount.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetWalletAccount.Input.Headers = .init(), - body: Operations.GetWalletAccount.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_wallet_account/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/get_wallet_account/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetWalletAccountResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetWalletAccountResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetWalletAccount.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetWalletAccount.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/get_wallet_account/post(GetWalletAccount)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetWalletAccount.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetWalletAccount.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List Activities - /// - /// List all Activities within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_activities`. - /// - Remark: Generated from `#/paths//public/v1/query/list_activities/post(GetActivities)`. - public enum GetActivities { - public static let id: Swift.String = "GetActivities" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_activities/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetActivities.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetActivities.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/list_activities/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_activities/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetActivitiesRequest) - } - public var body: Operations.GetActivities.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetActivities.Input.Headers = .init(), - body: Operations.GetActivities.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_activities/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_activities/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetActivitiesResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetActivitiesResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetActivities.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetActivities.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/list_activities/post(GetActivities)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetActivities.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetActivities.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List Policies - /// - /// List all Policies within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_policies`. - /// - Remark: Generated from `#/paths//public/v1/query/list_policies/post(GetPolicies)`. - public enum GetPolicies { - public static let id: Swift.String = "GetPolicies" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_policies/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetPolicies.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetPolicies.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/list_policies/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_policies/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetPoliciesRequest) - } - public var body: Operations.GetPolicies.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetPolicies.Input.Headers = .init(), - body: Operations.GetPolicies.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_policies/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_policies/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetPoliciesResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetPoliciesResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetPolicies.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetPolicies.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/list_policies/post(GetPolicies)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetPolicies.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetPolicies.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List Private Key Tags - /// - /// List all Private Key Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_private_key_tags`. - /// - Remark: Generated from `#/paths//public/v1/query/list_private_key_tags/post(ListPrivateKeyTags)`. - public enum ListPrivateKeyTags { - public static let id: Swift.String = "ListPrivateKeyTags" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_private_key_tags/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ListPrivateKeyTags.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ListPrivateKeyTags.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.ListPrivateKeyTags.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/list_private_key_tags/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_private_key_tags/POST/requestBody/content/application\/json`. - case json(Components.Schemas.ListPrivateKeyTagsRequest) - } - public var body: Operations.ListPrivateKeyTags.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.ListPrivateKeyTags.Input.Headers = .init(), - body: Operations.ListPrivateKeyTags.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_private_key_tags/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_private_key_tags/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ListPrivateKeyTagsResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ListPrivateKeyTagsResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ListPrivateKeyTags.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ListPrivateKeyTags.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/list_private_key_tags/post(ListPrivateKeyTags)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ListPrivateKeyTags.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ListPrivateKeyTags.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List Private Keys - /// - /// List all Private Keys within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/query/list_private_keys/post(GetPrivateKeys)`. - public enum GetPrivateKeys { - public static let id: Swift.String = "GetPrivateKeys" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_private_keys/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetPrivateKeys.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetPrivateKeys.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/list_private_keys/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_private_keys/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetPrivateKeysRequest) - } - public var body: Operations.GetPrivateKeys.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetPrivateKeys.Input.Headers = .init(), - body: Operations.GetPrivateKeys.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_private_keys/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_private_keys/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetPrivateKeysResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetPrivateKeysResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetPrivateKeys.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetPrivateKeys.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/list_private_keys/post(GetPrivateKeys)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetPrivateKeys.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetPrivateKeys.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get Suborgs - /// - /// Get all suborg IDs associated given a parent org ID and an optional filter. - /// - /// - Remark: HTTP `POST /public/v1/query/list_suborgs`. - /// - Remark: Generated from `#/paths//public/v1/query/list_suborgs/post(GetSubOrgIds)`. - public enum GetSubOrgIds { - public static let id: Swift.String = "GetSubOrgIds" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_suborgs/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetSubOrgIds.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetSubOrgIds.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/list_suborgs/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_suborgs/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetSubOrgIdsRequest) - } - public var body: Operations.GetSubOrgIds.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetSubOrgIds.Input.Headers = .init(), - body: Operations.GetSubOrgIds.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_suborgs/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_suborgs/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetSubOrgIdsResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetSubOrgIdsResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetSubOrgIds.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetSubOrgIds.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/list_suborgs/post(GetSubOrgIds)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetSubOrgIds.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetSubOrgIds.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List User Tags - /// - /// List all User Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_user_tags`. - /// - Remark: Generated from `#/paths//public/v1/query/list_user_tags/post(ListUserTags)`. - public enum ListUserTags { - public static let id: Swift.String = "ListUserTags" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_user_tags/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ListUserTags.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.ListUserTags.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/list_user_tags/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_user_tags/POST/requestBody/content/application\/json`. - case json(Components.Schemas.ListUserTagsRequest) - } - public var body: Operations.ListUserTags.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.ListUserTags.Input.Headers = .init(), - body: Operations.ListUserTags.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_user_tags/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_user_tags/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ListUserTagsResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ListUserTagsResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ListUserTags.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ListUserTags.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/list_user_tags/post(ListUserTags)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ListUserTags.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ListUserTags.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List Users - /// - /// List all Users within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_users`. - /// - Remark: Generated from `#/paths//public/v1/query/list_users/post(GetUsers)`. - public enum GetUsers { - public static let id: Swift.String = "GetUsers" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_users/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetUsers.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetUsers.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/list_users/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_users/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetUsersRequest) - } - public var body: Operations.GetUsers.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetUsers.Input.Headers = .init(), - body: Operations.GetUsers.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_users/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_users/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetUsersResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetUsersResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetUsers.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetUsers.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/list_users/post(GetUsers)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetUsers.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetUsers.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get Verified Suborgs - /// - /// Get all email or phone verified suborg IDs associated given a parent org ID. - /// - /// - Remark: HTTP `POST /public/v1/query/list_verified_suborgs`. - /// - Remark: Generated from `#/paths//public/v1/query/list_verified_suborgs/post(GetVerifiedSubOrgIds)`. - public enum GetVerifiedSubOrgIds { - public static let id: Swift.String = "GetVerifiedSubOrgIds" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_verified_suborgs/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetVerifiedSubOrgIds.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetVerifiedSubOrgIds.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetVerifiedSubOrgIds.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/list_verified_suborgs/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_verified_suborgs/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetVerifiedSubOrgIdsRequest) - } - public var body: Operations.GetVerifiedSubOrgIds.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetVerifiedSubOrgIds.Input.Headers = .init(), - body: Operations.GetVerifiedSubOrgIds.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_verified_suborgs/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_verified_suborgs/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetVerifiedSubOrgIdsResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetVerifiedSubOrgIdsResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetVerifiedSubOrgIds.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetVerifiedSubOrgIds.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/list_verified_suborgs/post(GetVerifiedSubOrgIds)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetVerifiedSubOrgIds.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetVerifiedSubOrgIds.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List Wallets Accounts - /// - /// List all Accounts within a Wallet - /// - /// - Remark: HTTP `POST /public/v1/query/list_wallet_accounts`. - /// - Remark: Generated from `#/paths//public/v1/query/list_wallet_accounts/post(GetWalletAccounts)`. - public enum GetWalletAccounts { - public static let id: Swift.String = "GetWalletAccounts" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_wallet_accounts/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetWalletAccounts.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetWalletAccounts.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetWalletAccounts.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/list_wallet_accounts/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_wallet_accounts/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetWalletAccountsRequest) - } - public var body: Operations.GetWalletAccounts.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetWalletAccounts.Input.Headers = .init(), - body: Operations.GetWalletAccounts.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_wallet_accounts/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_wallet_accounts/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetWalletAccountsResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetWalletAccountsResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetWalletAccounts.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetWalletAccounts.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/list_wallet_accounts/post(GetWalletAccounts)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetWalletAccounts.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetWalletAccounts.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List Wallets - /// - /// List all Wallets within an Organization - /// - /// - Remark: HTTP `POST /public/v1/query/list_wallets`. - /// - Remark: Generated from `#/paths//public/v1/query/list_wallets/post(GetWallets)`. - public enum GetWallets { - public static let id: Swift.String = "GetWallets" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_wallets/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetWallets.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetWallets.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/list_wallets/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_wallets/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetWalletsRequest) - } - public var body: Operations.GetWallets.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetWallets.Input.Headers = .init(), - body: Operations.GetWallets.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_wallets/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/list_wallets/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetWalletsResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetWalletsResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetWallets.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetWallets.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/list_wallets/post(GetWallets)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetWallets.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetWallets.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Who am I? - /// - /// Get basic information about your current API or WebAuthN user and their organization. Affords Sub-Organization look ups via Parent Organization for WebAuthN or API key users. - /// - /// - Remark: HTTP `POST /public/v1/query/whoami`. - /// - Remark: Generated from `#/paths//public/v1/query/whoami/post(GetWhoami)`. - public enum GetWhoami { - public static let id: Swift.String = "GetWhoami" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/whoami/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.GetWhoami.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.GetWhoami.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/query/whoami/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/whoami/POST/requestBody/content/application\/json`. - case json(Components.Schemas.GetWhoamiRequest) - } - public var body: Operations.GetWhoami.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.GetWhoami.Input.Headers = .init(), - body: Operations.GetWhoami.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/whoami/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/query/whoami/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GetWhoamiResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GetWhoamiResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.GetWhoami.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.GetWhoami.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/query/whoami/post(GetWhoami)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetWhoami.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetWhoami.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Approve Activity - /// - /// Approve an Activity - /// - /// - Remark: HTTP `POST /public/v1/submit/approve_activity`. - /// - Remark: Generated from `#/paths//public/v1/submit/approve_activity/post(ApproveActivity)`. - public enum ApproveActivity { - public static let id: Swift.String = "ApproveActivity" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/approve_activity/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ApproveActivity.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.ApproveActivity.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/approve_activity/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/approve_activity/POST/requestBody/content/application\/json`. - case json(Components.Schemas.ApproveActivityRequest) - } - public var body: Operations.ApproveActivity.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.ApproveActivity.Input.Headers = .init(), - body: Operations.ApproveActivity.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/approve_activity/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/approve_activity/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ApproveActivity.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ApproveActivity.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/approve_activity/post(ApproveActivity)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ApproveActivity.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ApproveActivity.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create API Keys - /// - /// Add api keys to an existing User - /// - /// - Remark: HTTP `POST /public/v1/submit/create_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_api_keys/post(CreateApiKeys)`. - public enum CreateApiKeys { - public static let id: Swift.String = "CreateApiKeys" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_api_keys/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateApiKeys.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreateApiKeys.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_api_keys/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_api_keys/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreateApiKeysRequest) - } - public var body: Operations.CreateApiKeys.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreateApiKeys.Input.Headers = .init(), - body: Operations.CreateApiKeys.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_api_keys/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_api_keys/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateApiKeys.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateApiKeys.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_api_keys/post(CreateApiKeys)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreateApiKeys.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreateApiKeys.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Authenticators - /// - /// Create Authenticators to authenticate requests to Turnkey - /// - /// - Remark: HTTP `POST /public/v1/submit/create_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_authenticators/post(CreateAuthenticators)`. - public enum CreateAuthenticators { - public static let id: Swift.String = "CreateAuthenticators" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_authenticators/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateAuthenticators.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateAuthenticators.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreateAuthenticators.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_authenticators/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_authenticators/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreateAuthenticatorsRequest) - } - public var body: Operations.CreateAuthenticators.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreateAuthenticators.Input.Headers = .init(), - body: Operations.CreateAuthenticators.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_authenticators/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_authenticators/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateAuthenticators.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateAuthenticators.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_authenticators/post(CreateAuthenticators)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreateAuthenticators.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreateAuthenticators.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Invitations - /// - /// Create Invitations to join an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_invitations`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_invitations/post(CreateInvitations)`. - public enum CreateInvitations { - public static let id: Swift.String = "CreateInvitations" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_invitations/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateInvitations.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateInvitations.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreateInvitations.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_invitations/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_invitations/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreateInvitationsRequest) - } - public var body: Operations.CreateInvitations.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreateInvitations.Input.Headers = .init(), - body: Operations.CreateInvitations.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_invitations/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_invitations/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateInvitations.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateInvitations.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_invitations/post(CreateInvitations)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreateInvitations.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreateInvitations.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Oauth Providers - /// - /// Creates Oauth providers for a specified user - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/create_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_oauth_providers/post(CreateOauthProviders)`. - public enum CreateOauthProviders { - public static let id: Swift.String = "CreateOauthProviders" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_oauth_providers/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateOauthProviders.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateOauthProviders.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreateOauthProviders.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_oauth_providers/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_oauth_providers/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreateOauthProvidersRequest) - } - public var body: Operations.CreateOauthProviders.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreateOauthProviders.Input.Headers = .init(), - body: Operations.CreateOauthProviders.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_oauth_providers/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_oauth_providers/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateOauthProviders.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateOauthProviders.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_oauth_providers/post(CreateOauthProviders)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreateOauthProviders.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreateOauthProviders.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Policies - /// - /// Create new Policies - /// - /// - Remark: HTTP `POST /public/v1/submit/create_policies`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_policies/post(CreatePolicies)`. - public enum CreatePolicies { - public static let id: Swift.String = "CreatePolicies" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_policies/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreatePolicies.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreatePolicies.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_policies/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_policies/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreatePoliciesRequest) - } - public var body: Operations.CreatePolicies.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreatePolicies.Input.Headers = .init(), - body: Operations.CreatePolicies.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_policies/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_policies/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreatePolicies.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreatePolicies.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_policies/post(CreatePolicies)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreatePolicies.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreatePolicies.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Policy - /// - /// Create a new Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/create_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_policy/post(CreatePolicy)`. - public enum CreatePolicy { - public static let id: Swift.String = "CreatePolicy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_policy/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreatePolicy.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreatePolicy.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_policy/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_policy/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreatePolicyRequest) - } - public var body: Operations.CreatePolicy.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreatePolicy.Input.Headers = .init(), - body: Operations.CreatePolicy.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_policy/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_policy/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreatePolicy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreatePolicy.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_policy/post(CreatePolicy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreatePolicy.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreatePolicy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Private Key Tag - /// - /// Create a private key tag and add it to private keys. - /// - /// - Remark: HTTP `POST /public/v1/submit/create_private_key_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_private_key_tag/post(CreatePrivateKeyTag)`. - public enum CreatePrivateKeyTag { - public static let id: Swift.String = "CreatePrivateKeyTag" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_private_key_tag/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreatePrivateKeyTag.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreatePrivateKeyTag.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreatePrivateKeyTag.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_private_key_tag/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_private_key_tag/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreatePrivateKeyTagRequest) - } - public var body: Operations.CreatePrivateKeyTag.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreatePrivateKeyTag.Input.Headers = .init(), - body: Operations.CreatePrivateKeyTag.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_private_key_tag/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_private_key_tag/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreatePrivateKeyTag.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreatePrivateKeyTag.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_private_key_tag/post(CreatePrivateKeyTag)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreatePrivateKeyTag.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreatePrivateKeyTag.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Private Keys - /// - /// Create new Private Keys - /// - /// - Remark: HTTP `POST /public/v1/submit/create_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_private_keys/post(CreatePrivateKeys)`. - public enum CreatePrivateKeys { - public static let id: Swift.String = "CreatePrivateKeys" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_private_keys/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreatePrivateKeys.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreatePrivateKeys.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreatePrivateKeys.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_private_keys/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_private_keys/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreatePrivateKeysRequest) - } - public var body: Operations.CreatePrivateKeys.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreatePrivateKeys.Input.Headers = .init(), - body: Operations.CreatePrivateKeys.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_private_keys/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_private_keys/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreatePrivateKeys.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreatePrivateKeys.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_private_keys/post(CreatePrivateKeys)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreatePrivateKeys.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreatePrivateKeys.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Read Only Session - /// - /// Create a read only session for a user (valid for 1 hour) - /// - /// - Remark: HTTP `POST /public/v1/submit/create_read_only_session`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_read_only_session/post(CreateReadOnlySession)`. - public enum CreateReadOnlySession { - public static let id: Swift.String = "CreateReadOnlySession" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_read_only_session/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateReadOnlySession.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateReadOnlySession.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreateReadOnlySession.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_read_only_session/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_read_only_session/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreateReadOnlySessionRequest) - } - public var body: Operations.CreateReadOnlySession.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreateReadOnlySession.Input.Headers = .init(), - body: Operations.CreateReadOnlySession.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_read_only_session/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_read_only_session/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateReadOnlySession.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateReadOnlySession.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_read_only_session/post(CreateReadOnlySession)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreateReadOnlySession.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreateReadOnlySession.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Read Write Session - /// - /// Create a read write session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/create_read_write_session`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_read_write_session/post(CreateReadWriteSession)`. - public enum CreateReadWriteSession { - public static let id: Swift.String = "CreateReadWriteSession" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_read_write_session/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateReadWriteSession.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateReadWriteSession.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreateReadWriteSession.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_read_write_session/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_read_write_session/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreateReadWriteSessionRequest) - } - public var body: Operations.CreateReadWriteSession.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreateReadWriteSession.Input.Headers = .init(), - body: Operations.CreateReadWriteSession.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_read_write_session/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_read_write_session/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateReadWriteSession.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateReadWriteSession.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_read_write_session/post(CreateReadWriteSession)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreateReadWriteSession.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreateReadWriteSession.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Sub-Organization - /// - /// Create a new Sub-Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_sub_organization`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_sub_organization/post(CreateSubOrganization)`. - public enum CreateSubOrganization { - public static let id: Swift.String = "CreateSubOrganization" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_sub_organization/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateSubOrganization.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateSubOrganization.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreateSubOrganization.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_sub_organization/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_sub_organization/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreateSubOrganizationRequest) - } - public var body: Operations.CreateSubOrganization.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreateSubOrganization.Input.Headers = .init(), - body: Operations.CreateSubOrganization.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_sub_organization/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_sub_organization/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateSubOrganization.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateSubOrganization.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_sub_organization/post(CreateSubOrganization)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreateSubOrganization.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreateSubOrganization.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create User Tag - /// - /// Create a user tag and add it to users. - /// - /// - Remark: HTTP `POST /public/v1/submit/create_user_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_user_tag/post(CreateUserTag)`. - public enum CreateUserTag { - public static let id: Swift.String = "CreateUserTag" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_user_tag/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateUserTag.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreateUserTag.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_user_tag/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_user_tag/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreateUserTagRequest) - } - public var body: Operations.CreateUserTag.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreateUserTag.Input.Headers = .init(), - body: Operations.CreateUserTag.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_user_tag/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_user_tag/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateUserTag.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateUserTag.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_user_tag/post(CreateUserTag)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreateUserTag.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreateUserTag.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Users - /// - /// Create Users in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/create_users`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_users/post(CreateUsers)`. - public enum CreateUsers { - public static let id: Swift.String = "CreateUsers" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_users/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateUsers.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreateUsers.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_users/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_users/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreateUsersRequest) - } - public var body: Operations.CreateUsers.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreateUsers.Input.Headers = .init(), - body: Operations.CreateUsers.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_users/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_users/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateUsers.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateUsers.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_users/post(CreateUsers)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreateUsers.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreateUsers.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Wallet - /// - /// Create a Wallet and derive addresses - /// - /// - Remark: HTTP `POST /public/v1/submit/create_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_wallet/post(CreateWallet)`. - public enum CreateWallet { - public static let id: Swift.String = "CreateWallet" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_wallet/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateWallet.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreateWallet.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_wallet/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_wallet/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreateWalletRequest) - } - public var body: Operations.CreateWallet.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreateWallet.Input.Headers = .init(), - body: Operations.CreateWallet.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_wallet/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_wallet/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateWallet.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateWallet.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_wallet/post(CreateWallet)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreateWallet.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreateWallet.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create Wallet Accounts - /// - /// Derive additional addresses using an existing wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/create_wallet_accounts`. - /// - Remark: Generated from `#/paths//public/v1/submit/create_wallet_accounts/post(CreateWalletAccounts)`. - public enum CreateWalletAccounts { - public static let id: Swift.String = "CreateWalletAccounts" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_wallet_accounts/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateWalletAccounts.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.CreateWalletAccounts.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.CreateWalletAccounts.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/create_wallet_accounts/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_wallet_accounts/POST/requestBody/content/application\/json`. - case json(Components.Schemas.CreateWalletAccountsRequest) - } - public var body: Operations.CreateWalletAccounts.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.CreateWalletAccounts.Input.Headers = .init(), - body: Operations.CreateWalletAccounts.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_wallet_accounts/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/create_wallet_accounts/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateWalletAccounts.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateWalletAccounts.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/create_wallet_accounts/post(CreateWalletAccounts)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CreateWalletAccounts.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CreateWalletAccounts.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete API Keys - /// - /// Remove api keys from a User - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_api_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_api_keys/post(DeleteApiKeys)`. - public enum DeleteApiKeys { - public static let id: Swift.String = "DeleteApiKeys" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_api_keys/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteApiKeys.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.DeleteApiKeys.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/delete_api_keys/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_api_keys/POST/requestBody/content/application\/json`. - case json(Components.Schemas.DeleteApiKeysRequest) - } - public var body: Operations.DeleteApiKeys.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.DeleteApiKeys.Input.Headers = .init(), - body: Operations.DeleteApiKeys.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_api_keys/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_api_keys/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DeleteApiKeys.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DeleteApiKeys.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/delete_api_keys/post(DeleteApiKeys)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DeleteApiKeys.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DeleteApiKeys.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete Authenticators - /// - /// Remove authenticators from a User - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_authenticators`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_authenticators/post(DeleteAuthenticators)`. - public enum DeleteAuthenticators { - public static let id: Swift.String = "DeleteAuthenticators" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_authenticators/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteAuthenticators.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteAuthenticators.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.DeleteAuthenticators.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/delete_authenticators/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_authenticators/POST/requestBody/content/application\/json`. - case json(Components.Schemas.DeleteAuthenticatorsRequest) - } - public var body: Operations.DeleteAuthenticators.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.DeleteAuthenticators.Input.Headers = .init(), - body: Operations.DeleteAuthenticators.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_authenticators/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_authenticators/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DeleteAuthenticators.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DeleteAuthenticators.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/delete_authenticators/post(DeleteAuthenticators)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DeleteAuthenticators.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DeleteAuthenticators.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete Invitation - /// - /// Delete an existing Invitation - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_invitation`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_invitation/post(DeleteInvitation)`. - public enum DeleteInvitation { - public static let id: Swift.String = "DeleteInvitation" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_invitation/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteInvitation.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteInvitation.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.DeleteInvitation.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/delete_invitation/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_invitation/POST/requestBody/content/application\/json`. - case json(Components.Schemas.DeleteInvitationRequest) - } - public var body: Operations.DeleteInvitation.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.DeleteInvitation.Input.Headers = .init(), - body: Operations.DeleteInvitation.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_invitation/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_invitation/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DeleteInvitation.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DeleteInvitation.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/delete_invitation/post(DeleteInvitation)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DeleteInvitation.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DeleteInvitation.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete Oauth Providers - /// - /// Removes Oauth providers for a specified user - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_oauth_providers`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_oauth_providers/post(DeleteOauthProviders)`. - public enum DeleteOauthProviders { - public static let id: Swift.String = "DeleteOauthProviders" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_oauth_providers/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteOauthProviders.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteOauthProviders.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.DeleteOauthProviders.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/delete_oauth_providers/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_oauth_providers/POST/requestBody/content/application\/json`. - case json(Components.Schemas.DeleteOauthProvidersRequest) - } - public var body: Operations.DeleteOauthProviders.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.DeleteOauthProviders.Input.Headers = .init(), - body: Operations.DeleteOauthProviders.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_oauth_providers/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_oauth_providers/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DeleteOauthProviders.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DeleteOauthProviders.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/delete_oauth_providers/post(DeleteOauthProviders)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DeleteOauthProviders.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DeleteOauthProviders.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete Policy - /// - /// Delete an existing Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_policy/post(DeletePolicy)`. - public enum DeletePolicy { - public static let id: Swift.String = "DeletePolicy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_policy/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeletePolicy.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.DeletePolicy.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/delete_policy/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_policy/POST/requestBody/content/application\/json`. - case json(Components.Schemas.DeletePolicyRequest) - } - public var body: Operations.DeletePolicy.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.DeletePolicy.Input.Headers = .init(), - body: Operations.DeletePolicy.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_policy/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_policy/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DeletePolicy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DeletePolicy.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/delete_policy/post(DeletePolicy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DeletePolicy.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DeletePolicy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete Private Key Tags - /// - /// Delete Private Key Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_private_key_tags`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_private_key_tags/post(DeletePrivateKeyTags)`. - public enum DeletePrivateKeyTags { - public static let id: Swift.String = "DeletePrivateKeyTags" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_private_key_tags/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeletePrivateKeyTags.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeletePrivateKeyTags.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.DeletePrivateKeyTags.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/delete_private_key_tags/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_private_key_tags/POST/requestBody/content/application\/json`. - case json(Components.Schemas.DeletePrivateKeyTagsRequest) - } - public var body: Operations.DeletePrivateKeyTags.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.DeletePrivateKeyTags.Input.Headers = .init(), - body: Operations.DeletePrivateKeyTags.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_private_key_tags/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_private_key_tags/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DeletePrivateKeyTags.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DeletePrivateKeyTags.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/delete_private_key_tags/post(DeletePrivateKeyTags)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DeletePrivateKeyTags.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DeletePrivateKeyTags.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete Private Keys - /// - /// Deletes private keys for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_private_keys`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_private_keys/post(DeletePrivateKeys)`. - public enum DeletePrivateKeys { - public static let id: Swift.String = "DeletePrivateKeys" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_private_keys/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeletePrivateKeys.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeletePrivateKeys.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.DeletePrivateKeys.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/delete_private_keys/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_private_keys/POST/requestBody/content/application\/json`. - case json(Components.Schemas.DeletePrivateKeysRequest) - } - public var body: Operations.DeletePrivateKeys.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.DeletePrivateKeys.Input.Headers = .init(), - body: Operations.DeletePrivateKeys.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_private_keys/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_private_keys/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DeletePrivateKeys.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DeletePrivateKeys.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/delete_private_keys/post(DeletePrivateKeys)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DeletePrivateKeys.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DeletePrivateKeys.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete Sub Organization - /// - /// Deletes a sub organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_sub_organization`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_sub_organization/post(DeleteSubOrganization)`. - public enum DeleteSubOrganization { - public static let id: Swift.String = "DeleteSubOrganization" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_sub_organization/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteSubOrganization.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteSubOrganization.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.DeleteSubOrganization.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/delete_sub_organization/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_sub_organization/POST/requestBody/content/application\/json`. - case json(Components.Schemas.DeleteSubOrganizationRequest) - } - public var body: Operations.DeleteSubOrganization.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.DeleteSubOrganization.Input.Headers = .init(), - body: Operations.DeleteSubOrganization.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_sub_organization/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_sub_organization/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DeleteSubOrganization.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DeleteSubOrganization.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/delete_sub_organization/post(DeleteSubOrganization)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DeleteSubOrganization.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DeleteSubOrganization.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete User Tags - /// - /// Delete User Tags within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_user_tags`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_user_tags/post(DeleteUserTags)`. - public enum DeleteUserTags { - public static let id: Swift.String = "DeleteUserTags" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_user_tags/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteUserTags.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.DeleteUserTags.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/delete_user_tags/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_user_tags/POST/requestBody/content/application\/json`. - case json(Components.Schemas.DeleteUserTagsRequest) - } - public var body: Operations.DeleteUserTags.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.DeleteUserTags.Input.Headers = .init(), - body: Operations.DeleteUserTags.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_user_tags/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_user_tags/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DeleteUserTags.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DeleteUserTags.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/delete_user_tags/post(DeleteUserTags)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DeleteUserTags.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DeleteUserTags.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete Users - /// - /// Delete Users within an Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_users`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_users/post(DeleteUsers)`. - public enum DeleteUsers { - public static let id: Swift.String = "DeleteUsers" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_users/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteUsers.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.DeleteUsers.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/delete_users/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_users/POST/requestBody/content/application\/json`. - case json(Components.Schemas.DeleteUsersRequest) - } - public var body: Operations.DeleteUsers.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.DeleteUsers.Input.Headers = .init(), - body: Operations.DeleteUsers.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_users/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_users/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DeleteUsers.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DeleteUsers.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/delete_users/post(DeleteUsers)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DeleteUsers.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DeleteUsers.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete Wallets - /// - /// Deletes wallets for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/delete_wallets`. - /// - Remark: Generated from `#/paths//public/v1/submit/delete_wallets/post(DeleteWallets)`. - public enum DeleteWallets { - public static let id: Swift.String = "DeleteWallets" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_wallets/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.DeleteWallets.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.DeleteWallets.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/delete_wallets/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_wallets/POST/requestBody/content/application\/json`. - case json(Components.Schemas.DeleteWalletsRequest) - } - public var body: Operations.DeleteWallets.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.DeleteWallets.Input.Headers = .init(), - body: Operations.DeleteWallets.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_wallets/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/delete_wallets/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DeleteWallets.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DeleteWallets.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/delete_wallets/post(DeleteWallets)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DeleteWallets.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DeleteWallets.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Perform Email Auth - /// - /// Authenticate a user via Email - /// - /// - Remark: HTTP `POST /public/v1/submit/email_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/email_auth/post(EmailAuth)`. - public enum EmailAuth { - public static let id: Swift.String = "EmailAuth" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/email_auth/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.EmailAuth.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.EmailAuth.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/email_auth/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/email_auth/POST/requestBody/content/application\/json`. - case json(Components.Schemas.EmailAuthRequest) - } - public var body: Operations.EmailAuth.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.EmailAuth.Input.Headers = .init(), - body: Operations.EmailAuth.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/email_auth/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/email_auth/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.EmailAuth.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.EmailAuth.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/email_auth/post(EmailAuth)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.EmailAuth.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.EmailAuth.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Export Private Key - /// - /// Exports a Private Key - /// - /// - Remark: HTTP `POST /public/v1/submit/export_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_private_key/post(ExportPrivateKey)`. - public enum ExportPrivateKey { - public static let id: Swift.String = "ExportPrivateKey" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_private_key/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ExportPrivateKey.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ExportPrivateKey.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.ExportPrivateKey.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/export_private_key/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_private_key/POST/requestBody/content/application\/json`. - case json(Components.Schemas.ExportPrivateKeyRequest) - } - public var body: Operations.ExportPrivateKey.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.ExportPrivateKey.Input.Headers = .init(), - body: Operations.ExportPrivateKey.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_private_key/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_private_key/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ExportPrivateKey.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ExportPrivateKey.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/export_private_key/post(ExportPrivateKey)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ExportPrivateKey.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ExportPrivateKey.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Export Wallet - /// - /// Exports a Wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/export_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_wallet/post(ExportWallet)`. - public enum ExportWallet { - public static let id: Swift.String = "ExportWallet" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_wallet/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ExportWallet.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.ExportWallet.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/export_wallet/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_wallet/POST/requestBody/content/application\/json`. - case json(Components.Schemas.ExportWalletRequest) - } - public var body: Operations.ExportWallet.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.ExportWallet.Input.Headers = .init(), - body: Operations.ExportWallet.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_wallet/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_wallet/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ExportWallet.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ExportWallet.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/export_wallet/post(ExportWallet)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ExportWallet.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ExportWallet.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Export Wallet Account - /// - /// Exports a Wallet Account - /// - /// - Remark: HTTP `POST /public/v1/submit/export_wallet_account`. - /// - Remark: Generated from `#/paths//public/v1/submit/export_wallet_account/post(ExportWalletAccount)`. - public enum ExportWalletAccount { - public static let id: Swift.String = "ExportWalletAccount" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_wallet_account/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ExportWalletAccount.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ExportWalletAccount.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.ExportWalletAccount.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/export_wallet_account/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_wallet_account/POST/requestBody/content/application\/json`. - case json(Components.Schemas.ExportWalletAccountRequest) - } - public var body: Operations.ExportWalletAccount.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.ExportWalletAccount.Input.Headers = .init(), - body: Operations.ExportWalletAccount.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_wallet_account/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/export_wallet_account/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ExportWalletAccount.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ExportWalletAccount.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/export_wallet_account/post(ExportWalletAccount)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ExportWalletAccount.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ExportWalletAccount.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Import Private Key - /// - /// Imports a private key - /// - /// - Remark: HTTP `POST /public/v1/submit/import_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/import_private_key/post(ImportPrivateKey)`. - public enum ImportPrivateKey { - public static let id: Swift.String = "ImportPrivateKey" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/import_private_key/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ImportPrivateKey.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ImportPrivateKey.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.ImportPrivateKey.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/import_private_key/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/import_private_key/POST/requestBody/content/application\/json`. - case json(Components.Schemas.ImportPrivateKeyRequest) - } - public var body: Operations.ImportPrivateKey.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.ImportPrivateKey.Input.Headers = .init(), - body: Operations.ImportPrivateKey.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/import_private_key/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/import_private_key/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ImportPrivateKey.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ImportPrivateKey.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/import_private_key/post(ImportPrivateKey)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ImportPrivateKey.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ImportPrivateKey.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Import Wallet - /// - /// Imports a wallet - /// - /// - Remark: HTTP `POST /public/v1/submit/import_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/import_wallet/post(ImportWallet)`. - public enum ImportWallet { - public static let id: Swift.String = "ImportWallet" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/import_wallet/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.ImportWallet.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.ImportWallet.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/import_wallet/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/import_wallet/POST/requestBody/content/application\/json`. - case json(Components.Schemas.ImportWalletRequest) - } - public var body: Operations.ImportWallet.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.ImportWallet.Input.Headers = .init(), - body: Operations.ImportWallet.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/import_wallet/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/import_wallet/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ImportWallet.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ImportWallet.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/import_wallet/post(ImportWallet)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ImportWallet.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ImportWallet.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Init Import Private Key - /// - /// Initializes a new private key import - /// - /// - Remark: HTTP `POST /public/v1/submit/init_import_private_key`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_import_private_key/post(InitImportPrivateKey)`. - public enum InitImportPrivateKey { - public static let id: Swift.String = "InitImportPrivateKey" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_import_private_key/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.InitImportPrivateKey.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.InitImportPrivateKey.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.InitImportPrivateKey.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/init_import_private_key/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_import_private_key/POST/requestBody/content/application\/json`. - case json(Components.Schemas.InitImportPrivateKeyRequest) - } - public var body: Operations.InitImportPrivateKey.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.InitImportPrivateKey.Input.Headers = .init(), - body: Operations.InitImportPrivateKey.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_import_private_key/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_import_private_key/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.InitImportPrivateKey.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.InitImportPrivateKey.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/init_import_private_key/post(InitImportPrivateKey)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.InitImportPrivateKey.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.InitImportPrivateKey.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Init Import Wallet - /// - /// Initializes a new wallet import - /// - /// - Remark: HTTP `POST /public/v1/submit/init_import_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_import_wallet/post(InitImportWallet)`. - public enum InitImportWallet { - public static let id: Swift.String = "InitImportWallet" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_import_wallet/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.InitImportWallet.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.InitImportWallet.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.InitImportWallet.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/init_import_wallet/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_import_wallet/POST/requestBody/content/application\/json`. - case json(Components.Schemas.InitImportWalletRequest) - } - public var body: Operations.InitImportWallet.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.InitImportWallet.Input.Headers = .init(), - body: Operations.InitImportWallet.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_import_wallet/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_import_wallet/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.InitImportWallet.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.InitImportWallet.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/init_import_wallet/post(InitImportWallet)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.InitImportWallet.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.InitImportWallet.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Init Generic OTP - /// - /// Initiate a Generic OTP activity - /// - /// - Remark: HTTP `POST /public/v1/submit/init_otp`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_otp/post(InitOtp)`. - public enum InitOtp { - public static let id: Swift.String = "InitOtp" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_otp/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.InitOtp.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.InitOtp.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/init_otp/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_otp/POST/requestBody/content/application\/json`. - case json(Components.Schemas.InitOtpRequest) - } - public var body: Operations.InitOtp.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.InitOtp.Input.Headers = .init(), - body: Operations.InitOtp.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_otp/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_otp/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.InitOtp.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.InitOtp.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/init_otp/post(InitOtp)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.InitOtp.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.InitOtp.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Init OTP auth - /// - /// Initiate an OTP auth activity - /// - /// - Remark: HTTP `POST /public/v1/submit/init_otp_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_otp_auth/post(InitOtpAuth)`. - public enum InitOtpAuth { - public static let id: Swift.String = "InitOtpAuth" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_otp_auth/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.InitOtpAuth.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.InitOtpAuth.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/init_otp_auth/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_otp_auth/POST/requestBody/content/application\/json`. - case json(Components.Schemas.InitOtpAuthRequest) - } - public var body: Operations.InitOtpAuth.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.InitOtpAuth.Input.Headers = .init(), - body: Operations.InitOtpAuth.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_otp_auth/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_otp_auth/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.InitOtpAuth.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.InitOtpAuth.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/init_otp_auth/post(InitOtpAuth)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.InitOtpAuth.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.InitOtpAuth.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Init Email Recovery - /// - /// Initializes a new email recovery - /// - /// - Remark: HTTP `POST /public/v1/submit/init_user_email_recovery`. - /// - Remark: Generated from `#/paths//public/v1/submit/init_user_email_recovery/post(InitUserEmailRecovery)`. - public enum InitUserEmailRecovery { - public static let id: Swift.String = "InitUserEmailRecovery" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_user_email_recovery/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.InitUserEmailRecovery.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.InitUserEmailRecovery.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.InitUserEmailRecovery.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/init_user_email_recovery/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_user_email_recovery/POST/requestBody/content/application\/json`. - case json(Components.Schemas.InitUserEmailRecoveryRequest) - } - public var body: Operations.InitUserEmailRecovery.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.InitUserEmailRecovery.Input.Headers = .init(), - body: Operations.InitUserEmailRecovery.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_user_email_recovery/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/init_user_email_recovery/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.InitUserEmailRecovery.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.InitUserEmailRecovery.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/init_user_email_recovery/post(InitUserEmailRecovery)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.InitUserEmailRecovery.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.InitUserEmailRecovery.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Oauth - /// - /// Authenticate a user with an Oidc token (Oauth) - BETA - /// - /// - Remark: HTTP `POST /public/v1/submit/oauth`. - /// - Remark: Generated from `#/paths//public/v1/submit/oauth/post(Oauth)`. - public enum Oauth { - public static let id: Swift.String = "Oauth" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/oauth/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType] = - .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.Oauth.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/oauth/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/oauth/POST/requestBody/content/application\/json`. - case json(Components.Schemas.OauthRequest) - } - public var body: Operations.Oauth.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.Oauth.Input.Headers = .init(), - body: Operations.Oauth.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/oauth/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/oauth/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.Oauth.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.Oauth.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/oauth/post(Oauth)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.Oauth.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.Oauth.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Login with Oauth - /// - /// Create an Oauth session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/oauth_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/oauth_login/post(OauthLogin)`. - public enum OauthLogin { - public static let id: Swift.String = "OauthLogin" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/oauth_login/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.OauthLogin.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.OauthLogin.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/oauth_login/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/oauth_login/POST/requestBody/content/application\/json`. - case json(Components.Schemas.OauthLoginRequest) - } - public var body: Operations.OauthLogin.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.OauthLogin.Input.Headers = .init(), - body: Operations.OauthLogin.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/oauth_login/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/oauth_login/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OauthLogin.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OauthLogin.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/oauth_login/post(OauthLogin)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.OauthLogin.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OauthLogin.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// OTP auth - /// - /// Authenticate a user with an OTP code sent via email or SMS - /// - /// - Remark: HTTP `POST /public/v1/submit/otp_auth`. - /// - Remark: Generated from `#/paths//public/v1/submit/otp_auth/post(OtpAuth)`. - public enum OtpAuth { - public static let id: Swift.String = "OtpAuth" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/otp_auth/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.OtpAuth.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.OtpAuth.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/otp_auth/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/otp_auth/POST/requestBody/content/application\/json`. - case json(Components.Schemas.OtpAuthRequest) - } - public var body: Operations.OtpAuth.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.OtpAuth.Input.Headers = .init(), - body: Operations.OtpAuth.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/otp_auth/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/otp_auth/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OtpAuth.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OtpAuth.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/otp_auth/post(OtpAuth)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.OtpAuth.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OtpAuth.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Login with OTP - /// - /// Create an OTP session for a user - /// - /// - Remark: HTTP `POST /public/v1/submit/otp_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/otp_login/post(OtpLogin)`. - public enum OtpLogin { - public static let id: Swift.String = "OtpLogin" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/otp_login/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.OtpLogin.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.OtpLogin.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/otp_login/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/otp_login/POST/requestBody/content/application\/json`. - case json(Components.Schemas.OtpLoginRequest) - } - public var body: Operations.OtpLogin.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.OtpLogin.Input.Headers = .init(), - body: Operations.OtpLogin.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/otp_login/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/otp_login/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OtpLogin.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OtpLogin.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/otp_login/post(OtpLogin)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.OtpLogin.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OtpLogin.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Recover a user - /// - /// Completes the process of recovering a user by adding an authenticator - /// - /// - Remark: HTTP `POST /public/v1/submit/recover_user`. - /// - Remark: Generated from `#/paths//public/v1/submit/recover_user/post(RecoverUser)`. - public enum RecoverUser { - public static let id: Swift.String = "RecoverUser" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/recover_user/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.RecoverUser.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.RecoverUser.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/recover_user/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/recover_user/POST/requestBody/content/application\/json`. - case json(Components.Schemas.RecoverUserRequest) - } - public var body: Operations.RecoverUser.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.RecoverUser.Input.Headers = .init(), - body: Operations.RecoverUser.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/recover_user/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/recover_user/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.RecoverUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.RecoverUser.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/recover_user/post(RecoverUser)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.RecoverUser.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.RecoverUser.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Reject Activity - /// - /// Reject an Activity - /// - /// - Remark: HTTP `POST /public/v1/submit/reject_activity`. - /// - Remark: Generated from `#/paths//public/v1/submit/reject_activity/post(RejectActivity)`. - public enum RejectActivity { - public static let id: Swift.String = "RejectActivity" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/reject_activity/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.RejectActivity.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.RejectActivity.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/reject_activity/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/reject_activity/POST/requestBody/content/application\/json`. - case json(Components.Schemas.RejectActivityRequest) - } - public var body: Operations.RejectActivity.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.RejectActivity.Input.Headers = .init(), - body: Operations.RejectActivity.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/reject_activity/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/reject_activity/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.RejectActivity.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.RejectActivity.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/reject_activity/post(RejectActivity)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.RejectActivity.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.RejectActivity.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Remove Organization Feature - /// - /// Removes an organization feature. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/remove_organization_feature`. - /// - Remark: Generated from `#/paths//public/v1/submit/remove_organization_feature/post(RemoveOrganizationFeature)`. - public enum RemoveOrganizationFeature { - public static let id: Swift.String = "RemoveOrganizationFeature" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/remove_organization_feature/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.RemoveOrganizationFeature.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.RemoveOrganizationFeature.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.RemoveOrganizationFeature.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/remove_organization_feature/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/remove_organization_feature/POST/requestBody/content/application\/json`. - case json(Components.Schemas.RemoveOrganizationFeatureRequest) - } - public var body: Operations.RemoveOrganizationFeature.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.RemoveOrganizationFeature.Input.Headers = .init(), - body: Operations.RemoveOrganizationFeature.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/remove_organization_feature/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/remove_organization_feature/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.RemoveOrganizationFeature.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.RemoveOrganizationFeature.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/remove_organization_feature/post(RemoveOrganizationFeature)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.RemoveOrganizationFeature.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.RemoveOrganizationFeature.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Set Organization Feature - /// - /// Sets an organization feature. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/set_organization_feature`. - /// - Remark: Generated from `#/paths//public/v1/submit/set_organization_feature/post(SetOrganizationFeature)`. - public enum SetOrganizationFeature { - public static let id: Swift.String = "SetOrganizationFeature" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/set_organization_feature/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.SetOrganizationFeature.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.SetOrganizationFeature.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.SetOrganizationFeature.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/set_organization_feature/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/set_organization_feature/POST/requestBody/content/application\/json`. - case json(Components.Schemas.SetOrganizationFeatureRequest) - } - public var body: Operations.SetOrganizationFeature.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.SetOrganizationFeature.Input.Headers = .init(), - body: Operations.SetOrganizationFeature.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/set_organization_feature/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/set_organization_feature/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.SetOrganizationFeature.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.SetOrganizationFeature.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/set_organization_feature/post(SetOrganizationFeature)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.SetOrganizationFeature.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.SetOrganizationFeature.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Sign Raw Payload - /// - /// Sign a raw payload - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_raw_payload`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_raw_payload/post(SignRawPayload)`. - public enum SignRawPayload { - public static let id: Swift.String = "SignRawPayload" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_raw_payload/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.SignRawPayload.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.SignRawPayload.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/sign_raw_payload/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_raw_payload/POST/requestBody/content/application\/json`. - case json(Components.Schemas.SignRawPayloadRequest) - } - public var body: Operations.SignRawPayload.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.SignRawPayload.Input.Headers = .init(), - body: Operations.SignRawPayload.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_raw_payload/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_raw_payload/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.SignRawPayload.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.SignRawPayload.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/sign_raw_payload/post(SignRawPayload)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.SignRawPayload.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.SignRawPayload.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Sign Raw Payloads - /// - /// Sign multiple raw payloads with the same signing parameters - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_raw_payloads`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_raw_payloads/post(SignRawPayloads)`. - public enum SignRawPayloads { - public static let id: Swift.String = "SignRawPayloads" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_raw_payloads/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.SignRawPayloads.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.SignRawPayloads.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/sign_raw_payloads/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_raw_payloads/POST/requestBody/content/application\/json`. - case json(Components.Schemas.SignRawPayloadsRequest) - } - public var body: Operations.SignRawPayloads.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.SignRawPayloads.Input.Headers = .init(), - body: Operations.SignRawPayloads.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_raw_payloads/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_raw_payloads/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.SignRawPayloads.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.SignRawPayloads.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/sign_raw_payloads/post(SignRawPayloads)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.SignRawPayloads.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.SignRawPayloads.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Sign Transaction - /// - /// Sign a transaction - /// - /// - Remark: HTTP `POST /public/v1/submit/sign_transaction`. - /// - Remark: Generated from `#/paths//public/v1/submit/sign_transaction/post(SignTransaction)`. - public enum SignTransaction { - public static let id: Swift.String = "SignTransaction" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_transaction/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.SignTransaction.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.SignTransaction.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/sign_transaction/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_transaction/POST/requestBody/content/application\/json`. - case json(Components.Schemas.SignTransactionRequest) - } - public var body: Operations.SignTransaction.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.SignTransaction.Input.Headers = .init(), - body: Operations.SignTransaction.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_transaction/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/sign_transaction/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.SignTransaction.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.SignTransaction.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/sign_transaction/post(SignTransaction)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.SignTransaction.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.SignTransaction.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Login with a Stamp - /// - /// Create a session for a user through stamping client side (api key, wallet client, or passkey client) - /// - /// - Remark: HTTP `POST /public/v1/submit/stamp_login`. - /// - Remark: Generated from `#/paths//public/v1/submit/stamp_login/post(StampLogin)`. - public enum StampLogin { - public static let id: Swift.String = "StampLogin" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/stamp_login/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.StampLogin.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.StampLogin.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/stamp_login/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/stamp_login/POST/requestBody/content/application\/json`. - case json(Components.Schemas.StampLoginRequest) - } - public var body: Operations.StampLogin.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.StampLogin.Input.Headers = .init(), - body: Operations.StampLogin.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/stamp_login/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/stamp_login/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.StampLogin.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.StampLogin.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/stamp_login/post(StampLogin)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.StampLogin.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.StampLogin.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update Policy - /// - /// Update an existing Policy - /// - /// - Remark: HTTP `POST /public/v1/submit/update_policy`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_policy/post(UpdatePolicy)`. - public enum UpdatePolicy { - public static let id: Swift.String = "UpdatePolicy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_policy/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdatePolicy.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.UpdatePolicy.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/update_policy/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_policy/POST/requestBody/content/application\/json`. - case json(Components.Schemas.UpdatePolicyRequest) - } - public var body: Operations.UpdatePolicy.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.UpdatePolicy.Input.Headers = .init(), - body: Operations.UpdatePolicy.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_policy/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_policy/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdatePolicy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdatePolicy.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/update_policy/post(UpdatePolicy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdatePolicy.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdatePolicy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update Private Key Tag - /// - /// Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_private_key_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_private_key_tag/post(UpdatePrivateKeyTag)`. - public enum UpdatePrivateKeyTag { - public static let id: Swift.String = "UpdatePrivateKeyTag" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_private_key_tag/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdatePrivateKeyTag.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdatePrivateKeyTag.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.UpdatePrivateKeyTag.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/update_private_key_tag/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_private_key_tag/POST/requestBody/content/application\/json`. - case json(Components.Schemas.UpdatePrivateKeyTagRequest) - } - public var body: Operations.UpdatePrivateKeyTag.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.UpdatePrivateKeyTag.Input.Headers = .init(), - body: Operations.UpdatePrivateKeyTag.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_private_key_tag/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_private_key_tag/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdatePrivateKeyTag.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdatePrivateKeyTag.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/update_private_key_tag/post(UpdatePrivateKeyTag)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdatePrivateKeyTag.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdatePrivateKeyTag.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update Root Quorum - /// - /// Set the threshold and members of the root quorum. This activity must be approved by the current root quorum. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_root_quorum`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_root_quorum/post(UpdateRootQuorum)`. - public enum UpdateRootQuorum { - public static let id: Swift.String = "UpdateRootQuorum" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_root_quorum/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdateRootQuorum.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdateRootQuorum.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.UpdateRootQuorum.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/update_root_quorum/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_root_quorum/POST/requestBody/content/application\/json`. - case json(Components.Schemas.UpdateRootQuorumRequest) - } - public var body: Operations.UpdateRootQuorum.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.UpdateRootQuorum.Input.Headers = .init(), - body: Operations.UpdateRootQuorum.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_root_quorum/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_root_quorum/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdateRootQuorum.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdateRootQuorum.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/update_root_quorum/post(UpdateRootQuorum)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdateRootQuorum.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdateRootQuorum.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update User - /// - /// Update a User in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user/post(UpdateUser)`. - public enum UpdateUser { - public static let id: Swift.String = "UpdateUser" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdateUser.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.UpdateUser.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/update_user/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user/POST/requestBody/content/application\/json`. - case json(Components.Schemas.UpdateUserRequest) - } - public var body: Operations.UpdateUser.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.UpdateUser.Input.Headers = .init(), - body: Operations.UpdateUser.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdateUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdateUser.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/update_user/post(UpdateUser)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdateUser.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdateUser.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update User's Email - /// - /// Update a User's email in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_email`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_email/post(UpdateUserEmail)`. - public enum UpdateUserEmail { - public static let id: Swift.String = "UpdateUserEmail" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_email/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdateUserEmail.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.UpdateUserEmail.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_email/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_email/POST/requestBody/content/application\/json`. - case json(Components.Schemas.UpdateUserEmailRequest) - } - public var body: Operations.UpdateUserEmail.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.UpdateUserEmail.Input.Headers = .init(), - body: Operations.UpdateUserEmail.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_email/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_email/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdateUserEmail.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdateUserEmail.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_email/post(UpdateUserEmail)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdateUserEmail.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdateUserEmail.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update User's Name - /// - /// Update a User's name in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_name`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_name/post(UpdateUserName)`. - public enum UpdateUserName { - public static let id: Swift.String = "UpdateUserName" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_name/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdateUserName.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.UpdateUserName.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_name/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_name/POST/requestBody/content/application\/json`. - case json(Components.Schemas.UpdateUserNameRequest) - } - public var body: Operations.UpdateUserName.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.UpdateUserName.Input.Headers = .init(), - body: Operations.UpdateUserName.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_name/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_name/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdateUserName.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdateUserName.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_name/post(UpdateUserName)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdateUserName.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdateUserName.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update User's Phone Number - /// - /// Update a User's phone number in an existing Organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_phone_number`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_phone_number/post(UpdateUserPhoneNumber)`. - public enum UpdateUserPhoneNumber { - public static let id: Swift.String = "UpdateUserPhoneNumber" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_phone_number/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdateUserPhoneNumber.AcceptableContentType - >] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdateUserPhoneNumber.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.UpdateUserPhoneNumber.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_phone_number/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_phone_number/POST/requestBody/content/application\/json`. - case json(Components.Schemas.UpdateUserPhoneNumberRequest) - } - public var body: Operations.UpdateUserPhoneNumber.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.UpdateUserPhoneNumber.Input.Headers = .init(), - body: Operations.UpdateUserPhoneNumber.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_phone_number/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_phone_number/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdateUserPhoneNumber.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdateUserPhoneNumber.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_phone_number/post(UpdateUserPhoneNumber)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdateUserPhoneNumber.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdateUserPhoneNumber.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update User Tag - /// - /// Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. - /// - /// - Remark: HTTP `POST /public/v1/submit/update_user_tag`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_tag/post(UpdateUserTag)`. - public enum UpdateUserTag { - public static let id: Swift.String = "UpdateUserTag" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_tag/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdateUserTag.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.UpdateUserTag.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_tag/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_tag/POST/requestBody/content/application\/json`. - case json(Components.Schemas.UpdateUserTagRequest) - } - public var body: Operations.UpdateUserTag.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.UpdateUserTag.Input.Headers = .init(), - body: Operations.UpdateUserTag.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_tag/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_user_tag/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdateUserTag.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdateUserTag.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/update_user_tag/post(UpdateUserTag)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdateUserTag.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdateUserTag.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update Wallet - /// - /// Update a wallet for an organization - /// - /// - Remark: HTTP `POST /public/v1/submit/update_wallet`. - /// - Remark: Generated from `#/paths//public/v1/submit/update_wallet/post(UpdateWallet)`. - public enum UpdateWallet { - public static let id: Swift.String = "UpdateWallet" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_wallet/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.UpdateWallet.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.UpdateWallet.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/update_wallet/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_wallet/POST/requestBody/content/application\/json`. - case json(Components.Schemas.UpdateWalletRequest) - } - public var body: Operations.UpdateWallet.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.UpdateWallet.Input.Headers = .init(), - body: Operations.UpdateWallet.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_wallet/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/update_wallet/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdateWallet.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdateWallet.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/update_wallet/post(UpdateWallet)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdateWallet.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdateWallet.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Verify Generic OTP - /// - /// Verify a Generic OTP - /// - /// - Remark: HTTP `POST /public/v1/submit/verify_otp`. - /// - Remark: Generated from `#/paths//public/v1/submit/verify_otp/post(VerifyOtp)`. - public enum VerifyOtp { - public static let id: Swift.String = "VerifyOtp" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/verify_otp/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: - [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init( - accept: [OpenAPIRuntime.AcceptHeaderContentType< - Operations.VerifyOtp.AcceptableContentType - >] = .defaultValues() - ) { - self.accept = accept - } - } - public var headers: Operations.VerifyOtp.Input.Headers - /// - Remark: Generated from `#/paths/public/v1/submit/verify_otp/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/verify_otp/POST/requestBody/content/application\/json`. - case json(Components.Schemas.VerifyOtpRequest) - } - public var body: Operations.VerifyOtp.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.VerifyOtp.Input.Headers = .init(), - body: Operations.VerifyOtp.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/verify_otp/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/public/v1/submit/verify_otp/POST/responses/200/content/application\/json`. - case json(Components.Schemas.ActivityResponse) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActivityResponse { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.VerifyOtp.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.VerifyOtp.Output.Ok.Body) { - self.body = body - } - } - /// A successful response. - /// - /// - Remark: Generated from `#/paths//public/v1/submit/verify_otp/post(VerifyOtp)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.VerifyOtp.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.VerifyOtp.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } -} diff --git a/Sources/TurnkeyHttp/Internal/TurnkeyClient+Requests.swift b/Sources/TurnkeyHttp/Internal/TurnkeyClient+Requests.swift new file mode 100644 index 00000000..cc7284a8 --- /dev/null +++ b/Sources/TurnkeyHttp/Internal/TurnkeyClient+Requests.swift @@ -0,0 +1,427 @@ +// Helper methods for making HTTP requests with TurnkeyTypes +// These replace the OpenAPI-generated operations + +import Foundation +import TurnkeyStamper +import TurnkeyTypes + +// Activity status constants +private let TERMINAL_ACTIVITY_STATUSES: Set = [ + "ACTIVITY_STATUS_COMPLETED", + "ACTIVITY_STATUS_FAILED", + "ACTIVITY_STATUS_CONSENSUS_NEEDED", + "ACTIVITY_STATUS_REJECTED", +] + +extension TurnkeyClient { + + // MARK: - Query/Request Methods + + /// Make a simple HTTP request (for query methods) + /// - Parameters: + /// - path: The API endpoint path + /// - body: The request body + /// - stampWith: Optional stamper to use instead of the client's default stamper + internal func request( + _ path: String, + body: TBody, + stampWith: Stamper? = nil + ) async throws -> TResponse { + let stamperToUse = stampWith ?? self.stamper + guard let stamper = stamperToUse else { + throw TurnkeyRequestError.clientNotConfigured("stamper not configured") + } + + let fullUrl = URL(string: baseUrl + path)! + let jsonData = try JSONEncoder().encode(body) + let jsonString = String(data: jsonData, encoding: .utf8)! + + // Stamp the request + let (stampHeaderName, stampHeaderValue) = try await stamper.stamp(payload: jsonString) + + // Build request + var request = URLRequest(url: fullUrl) + request.httpMethod = "POST" + request.httpBody = jsonData + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + request.setValue(stampHeaderValue, forHTTPHeaderField: stampHeaderName) + + // Execute request + let (data, response) = try await URLSession.shared.data(for: request) + + // Check response + guard let httpResponse = response as? HTTPURLResponse else { + throw TurnkeyRequestError.invalidResponse + } + + guard (200...299).contains(httpResponse.statusCode) else { + throw TurnkeyRequestError.apiError(statusCode: httpResponse.statusCode, payload: data) + } + + // Decode response + let decoder = JSONDecoder() + return try decoder.decode(TResponse.self, from: data) + } + + // MARK: - Activity Methods + + /// Make an activity request (for activity methods that need polling) + /// - Parameters: + /// - path: The API endpoint path + /// - body: The request body (should contain organizationId, timestampMs, and parameters) + /// - activityType: The activity type to add to the request + /// - resultKey: The key in the activity result to extract + /// - stampWith: Optional stamper to use instead of the client's default stamper + internal func activity( + _ path: String, + body: TBody, + activityType: String, + resultKey: String, + stampWith: Stamper? = nil + ) async throws -> TResponse { + let pollingDuration = Double(self.activityPoller.intervalMs) / 1000.0 + let maxRetries = self.activityPoller.numRetries + + // Wrap the body with the activity type + let wrappedBody = try wrapActivityBody(body, activityType: activityType) + + // Helper to handle response data + func handleResponse(_ data: Data) throws -> TResponse { + // Check status first + guard let responseDict = try? JSONSerialization.jsonObject(with: data) as? [String: Any], + let activity = responseDict["activity"] as? [String: Any], + let status = activity["status"] as? String else { + throw TurnkeyRequestError.invalidResponse + } + + if status == "ACTIVITY_STATUS_COMPLETED" { + // Merge result[resultKey] with activity response + return try mergeActivityResponse(data, resultKey: resultKey) + } + + // For non-completed states, decode as-is + return try JSONDecoder().decode(TResponse.self, from: data) + } + + var attempts = 0 + + // Recursive polling function + func pollStatus(_ activityId: String) async throws -> TResponse { + let pollBody = TGetActivityBody(activityId: activityId) + + // Make raw request to get Data + let stamperToUse = stampWith ?? self.stamper + guard let stamper = stamperToUse else { + throw TurnkeyRequestError.clientNotConfigured("stamper not configured") + } + + let fullUrl = URL(string: baseUrl + "/public/v1/query/get_activity")! + let jsonData = try JSONEncoder().encode(pollBody) + let jsonString = String(data: jsonData, encoding: .utf8)! + let (stampHeaderName, stampHeaderValue) = try await stamper.stamp(payload: jsonString) + + var request = URLRequest(url: fullUrl) + request.httpMethod = "POST" + request.httpBody = jsonData + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + request.setValue(stampHeaderValue, forHTTPHeaderField: stampHeaderName) + + let (data, response) = try await URLSession.shared.data(for: request) + + guard let httpResponse = response as? HTTPURLResponse, + (200...299).contains(httpResponse.statusCode) else { + throw TurnkeyRequestError.invalidResponse + } + + if attempts > maxRetries { + return try handleResponse(data) + } + + attempts += 1 + + // Check if we need to continue polling + if let responseDict = try? JSONSerialization.jsonObject(with: data) as? [String: Any], + let activity = responseDict["activity"] as? [String: Any], + let status = activity["status"] as? String, + !TERMINAL_ACTIVITY_STATUSES.contains(status) { + try await Task.sleep(nanoseconds: UInt64(pollingDuration * 1_000_000_000)) + return try await pollStatus(activityId) + } + + return try handleResponse(data) + } + + // Make initial request - get raw Data + let stamperToUse = stampWith ?? self.stamper + guard let stamper = stamperToUse else { + throw TurnkeyRequestError.clientNotConfigured("stamper not configured") + } + + let fullUrl = URL(string: baseUrl + path)! + let jsonData = try JSONEncoder().encode(wrappedBody) + let jsonString = String(data: jsonData, encoding: .utf8)! + let (stampHeaderName, stampHeaderValue) = try await stamper.stamp(payload: jsonString) + + var request = URLRequest(url: fullUrl) + request.httpMethod = "POST" + request.httpBody = jsonData + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + request.setValue(stampHeaderValue, forHTTPHeaderField: stampHeaderName) + + let (data, response) = try await URLSession.shared.data(for: request) + + guard let httpResponse = response as? HTTPURLResponse else { + throw TurnkeyRequestError.invalidResponse + } + + guard (200...299).contains(httpResponse.statusCode) else { + throw TurnkeyRequestError.apiError(statusCode: httpResponse.statusCode, payload: data) + } + + // Check if we need to poll + if let responseDict = try? JSONSerialization.jsonObject(with: data) as? [String: Any], + let activity = responseDict["activity"] as? [String: Any], + let status = activity["status"] as? String, + let activityId = activity["id"] as? String, + !TERMINAL_ACTIVITY_STATUSES.contains(status) { + return try await pollStatus(activityId) + } + + return try handleResponse(data) + } + + /// Wraps an activity body by extracting organizationId/timestampMs and adding the type field + private func wrapActivityBody(_ body: TBody, activityType: String) throws + -> ActivityRequestWrapper + { + let encoder = JSONEncoder() + let bodyData = try encoder.encode(body) + var bodyDict = try JSONSerialization.jsonObject(with: bodyData) as! [String: Any] + + // Extract organizationId and timestampMs if present + let organizationId = bodyDict["organizationId"] as? String + let timestampMs = + bodyDict["timestampMs"] as? String ?? String(Int(Date().timeIntervalSince1970 * 1000)) + + // Remove organizationId and timestampMs from the body dict (they'll be at top level) + bodyDict.removeValue(forKey: "organizationId") + bodyDict.removeValue(forKey: "timestampMs") + + return ActivityRequestWrapper( + type: activityType, + timestampMs: timestampMs, + organizationId: organizationId, + parameters: AnyCodableDict(bodyDict) + ) + } + + private func mergeActivityResponse( + _ activityData: Data, + resultKey: String + ) throws -> TResponse { + // Parse the activity response as a dictionary (working with raw JSON, not AnyCodable) + guard var responseDict = try JSONSerialization.jsonObject(with: activityData) as? [String: Any], + let activity = responseDict["activity"] as? [String: Any], + let result = activity["result"] as? [String: Any], + let specificResult = result[resultKey] as? [String: Any] else { + throw TurnkeyRequestError.invalidResponse + } + + // Merge: spread specificResult into top level, keep activity + // TypeScript does: { ...result[resultKey], ...activityData } + for (key, value) in specificResult { + responseDict[key] = value + } + + // Convert back to Data and decode to TResponse + let mergedData = try JSONSerialization.data(withJSONObject: responseDict) + return try JSONDecoder().decode(TResponse.self, from: mergedData) + } + + // MARK: - Activity Decision Methods + + /// Make an activity decision request (approve/reject) + /// - Parameters: + /// - path: The API endpoint path + /// - body: The request body + /// - stampWith: Optional stamper to use instead of the client's default stamper + internal func activityDecision( + _ path: String, + body: TBody, + activityType: String, + stampWith: Stamper? = nil + ) async throws -> TResponse { + // Use the specified stamper for this request + let activityData: TActivityResponse = try await request(path, body: body, stampWith: stampWith) + + // Merge activity.result with activityData + // This mimics the JS: { ...activityData["activity"]["result"], ...activityData } + let encoder = JSONEncoder() + let decoder = JSONDecoder() + + var activityDict = + try JSONSerialization.jsonObject( + with: encoder.encode(activityData) + ) as! [String: Any] + + // Extract result and merge + if let activity = activityDict["activity"] as? [String: Any], + let result = activity["result"] as? [String: Any] + { + // Merge result into activityDict (result values take precedence) + activityDict = activityDict.merging(result) { _, new in new } + } + + // Convert back to TResponse + let mergedData = try JSONSerialization.data(withJSONObject: activityDict) + return try decoder.decode(TResponse.self, from: mergedData) + } + + // MARK: - Auth Proxy Methods + + /// Make an auth proxy request + internal func authProxyRequest( + _ path: String, + body: TBody + ) async throws -> TResponse { + guard let authProxyUrl = self.authProxyUrl, + let authProxyConfigId = self.authProxyConfigId + else { + throw TurnkeyRequestError.clientNotConfigured( + "authProxyUrl or authProxyConfigId not configured") + } + + let fullUrl = URL(string: authProxyUrl + path)! + let jsonData = try JSONEncoder().encode(body) + + // Build request + var request = URLRequest(url: fullUrl) + request.httpMethod = "POST" + request.httpBody = jsonData + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + request.setValue(authProxyConfigId, forHTTPHeaderField: "X-Auth-Proxy-Config-ID") + + // Execute request + let (data, response) = try await URLSession.shared.data(for: request) + + // Check response + guard let httpResponse = response as? HTTPURLResponse else { + throw TurnkeyRequestError.invalidResponse + } + + guard (200...299).contains(httpResponse.statusCode) else { + throw TurnkeyRequestError.apiError(statusCode: httpResponse.statusCode, payload: data) + } + + // Decode response + let decoder = JSONDecoder() + return try decoder.decode(TResponse.self, from: data) + } +} + +// MARK: - Activity Request Wrapper Types + +/// Wrapper for activity requests that adds type, timestampMs, organizationId, and parameters +private struct ActivityRequestWrapper: Codable { + let type: String + let timestampMs: String + let organizationId: String? + let parameters: AnyCodableDict +} + +/// Helper for encoding/decoding arbitrary dictionaries +private struct AnyCodableDict: Codable { + let value: [String: Any] + + init(_ value: [String: Any]) { + self.value = value + } + + init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + let dict = try container.decode([String: AnyCodable].self) + value = dict.mapValues { $0.value } + } + + func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + // Convert [String: Any] to [String: AnyCodable] for encoding + var codableDict: [String: AnyCodable] = [:] + for (key, val) in value { + codableDict[key] = AnyCodable(val) + } + try container.encode(codableDict) + } +} + +// MARK: - Helper Types for Activity Handling + +// Helper types for activity handling +private struct TActivityResponse: Codable { + let activity: Activity + + struct Activity: Codable { + let id: String + let status: String + let result: [String: AnyCodable]? + } +} + +private struct TGetActivityBody: Codable { + let activityId: String +} + +// Helper for decoding any JSON value +private struct AnyCodable: Codable { + let value: Any + + init(_ value: Any) { + self.value = value + } + + init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + // Check bool BEFORE int to prevent bool->int conversion + if let bool = try? container.decode(Bool.self) { + value = bool + } else if let int = try? container.decode(Int.self) { + value = int + } else if let double = try? container.decode(Double.self) { + value = double + } else if let string = try? container.decode(String.self) { + value = string + } else if let dict = try? container.decode([String: AnyCodable].self) { + value = dict.mapValues { $0.value } + } else if let array = try? container.decode([AnyCodable].self) { + value = array.map { $0.value } + } else { + value = NSNull() + } + } + + func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch value { + // Check bool BEFORE int to prevent bool->int conversion during encoding + case let bool as Bool: + try container.encode(bool) + case let int as Int: + try container.encode(int) + case let double as Double: + try container.encode(double) + case let string as String: + try container.encode(string) + case let dict as [String: Any]: + // Convert to [String: AnyCodable] for encoding + try container.encode(dict.mapValues { AnyCodable($0) }) + case let array as [Any]: + // Convert to [AnyCodable] for encoding + try container.encode(array.map { AnyCodable($0) }) + case is NSNull: + try container.encodeNil() + default: + throw EncodingError.invalidValue( + value, EncodingError.Context(codingPath: [], debugDescription: "Invalid value")) + } + } +} diff --git a/Sources/TurnkeyHttp/Internal/TurnkeyClient+Unwrap.swift b/Sources/TurnkeyHttp/Internal/TurnkeyClient+Unwrap.swift deleted file mode 100644 index 97a284b4..00000000 --- a/Sources/TurnkeyHttp/Internal/TurnkeyClient+Unwrap.swift +++ /dev/null @@ -1,36 +0,0 @@ -import Foundation -import OpenAPIRuntime - -extension TurnkeyClient { - @inline(__always) - internal func call( - _ perform: () async throws -> RawEnum - ) async throws -> Ok { - let raw = try await perform() - return try await unwrapOK(raw) as! Ok - } -} - -@inline(__always) -func unwrapOK(_ output: OutputEnum) async throws -> Any { - let mirror = Mirror(reflecting: output) - - // if it's .ok we return its associated value - if let child = mirror.children.first(where: { $0.label == "ok" }) { - return child.value - } - - // if it's .undocumented we map to TurnkeyError.apiError - if let child = mirror.children.first(where: { $0.label == "undocumented" }), - let tuple = child.value as? (statusCode: Int, payload: UndocumentedPayload) - { - - var payloadData: Data? - if let body = tuple.payload.body { - payloadData = try await Data(collecting: body, upTo: .max) - } - throw TurnkeyRequestError.apiError(statusCode: tuple.statusCode, payload: payloadData) - } - - throw TurnkeyRequestError.invalidResponse -} diff --git a/Sources/TurnkeyHttp/Makefile b/Sources/TurnkeyHttp/Makefile deleted file mode 100644 index ae43a475..00000000 --- a/Sources/TurnkeyHttp/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -.PHONY: generate turnkey_client_types turnkey_client clean format - -generate: turnkey_client_types turnkey_client format - -turnkey_client_types: - swift run swift-openapi-generator generate \ - --output-directory Generated \ - --config Resources/openapi-generator-config.yaml Resources/openapi.yaml - -turnkey_client: - sourcery --sources Generated \ - --output Public/TurnkeyClient.swift \ - --templates Resources/Templates/TurnkeyClient.stencil \ - $(if $(WATCH),--watch,) - -test: - make clean - swift test - -format: - swift-format . -i -r - -WATCH ?= diff --git a/Sources/TurnkeyHttp/Middleware/AuthStampMiddleware.swift b/Sources/TurnkeyHttp/Middleware/AuthStampMiddleware.swift deleted file mode 100644 index 29424c0d..00000000 --- a/Sources/TurnkeyHttp/Middleware/AuthStampMiddleware.swift +++ /dev/null @@ -1,68 +0,0 @@ -import CryptoKit -import Foundation -import HTTPTypes -import OpenAPIRuntime -import TurnkeyStamper - -enum AuthStampError: Error { - case failedToStampAndSendRequest(error: Error) -} - -extension AuthStampError: LocalizedError { - public var errorDescription: String? { - switch self { - case .failedToStampAndSendRequest(let error): - return "Failed to stamp and send request: \(error.localizedDescription)" - } - } -} - -package struct AuthStampMiddleware { - private let stamper: Stamper - - package init(stamper: Stamper) { - self.stamper = stamper - } -} - -extension AuthStampMiddleware: ClientMiddleware { - - /// Intercepts an outgoing HTTP request, stamps its body using the `Stamper`, and adds a custom header. - /// - /// - Parameters: - /// - request: The original HTTP request. - /// - body: The request body, if present. - /// - baseURL: The base URL of the API. - /// - operationID: The operation ID defined by OpenAPI. - /// - next: The next middleware or transport to call. - /// - Returns: A tuple of HTTP response and optional body. - /// - Throws: `AuthStampError` if stamping or request forwarding fails. - package func intercept( - _ request: HTTPRequest, - body: HTTPBody?, - baseURL: URL, - operationID: String, - next: (HTTPRequest, HTTPBody?, URL) async throws -> (HTTPResponse, HTTPBody?) - ) async throws -> (HTTPResponse, HTTPBody?) { - var request = request - let maxBytes = 1_000_000 - - do { - if let body = body { - let bodyString = try await String(collecting: body, upTo: maxBytes) - let (stampHeaderName, stampHeaderValue) = try await stamper.stamp(payload: bodyString) - - let stampHeader = HTTPField( - name: HTTPField.Name(stampHeaderName)!, - value: stampHeaderValue - ) - request.headerFields.append(stampHeader) - } - - return try await next(request, body, baseURL) - - } catch { - throw AuthStampError.failedToStampAndSendRequest(error: error) - } - } -} diff --git a/Sources/TurnkeyHttp/Middleware/ProxyMiddleware.swift b/Sources/TurnkeyHttp/Middleware/ProxyMiddleware.swift deleted file mode 100644 index 1e6f136d..00000000 --- a/Sources/TurnkeyHttp/Middleware/ProxyMiddleware.swift +++ /dev/null @@ -1,70 +0,0 @@ -import Foundation -import HTTPTypes -import OpenAPIRuntime - -enum ProxyMiddlewareError: Error { - case invalidHeaderName(String) -} - -extension ProxyMiddlewareError: LocalizedError { - public var errorDescription: String? { - switch self { - case .invalidHeaderName(let name): - return "Failed to construct HTTP header name: \"\(name)\"" - } - } -} - -package struct ProxyMiddleware { - private let proxyURL: URL - - /// Initializes the middleware with a proxy base URL. - /// - /// - Parameter proxyURL: The base URL to forward all requests to. - package init(proxyURL: URL) { - self.proxyURL = proxyURL - } -} - -extension ProxyMiddleware: ClientMiddleware { - - /// Intercepts an outgoing HTTP request, appends a proxy header, and rewrites the base URL. - /// - /// - Parameters: - /// - request: The original HTTP request. - /// - body: The request body, if present. - /// - baseURL: The original base URL. - /// - operationID: The OpenAPI operation ID (unused here). - /// - next: The next middleware or transport to call. - /// - Returns: A tuple of HTTP response and optional body. - /// - Throws: Any error thrown by downstream middleware or transport. - package func intercept( - _ request: HTTPRequest, - body: HTTPBody?, - baseURL: URL, - operationID: String, - next: (HTTPRequest, HTTPBody?, URL) async throws -> (HTTPResponse, HTTPBody?) - ) async throws -> (HTTPResponse, HTTPBody?) { - // we save the original full URL: baseURL + request.path - let originalURL = baseURL.appendingPathComponent(request.path ?? "") - - // we add the X-Turnkey-Request-Url header to the request - var request = request - let headerName = "X-Turnkey-Request-Url" - guard let headerFieldName = HTTPField.Name(headerName) else { - throw ProxyMiddlewareError.invalidHeaderName(headerName) - } - - let xTurnkeyRequestUrl = HTTPField( - name: headerFieldName, - value: originalURL.absoluteString - ) - request.headerFields.append(xTurnkeyRequestUrl) - - // we clear the path since the proxy handles routing - request.path = "" - - // we forward the modified request to the proxy URL - return try await next(request, body, proxyURL) - } -} diff --git a/Sources/TurnkeyHttp/Models/Errors.swift b/Sources/TurnkeyHttp/Models/Errors.swift index 081d5c9a..c251353e 100644 --- a/Sources/TurnkeyHttp/Models/Errors.swift +++ b/Sources/TurnkeyHttp/Models/Errors.swift @@ -1,16 +1,15 @@ import Foundation import HTTPTypes -/// A unified error type surfaced by the Turnkey Swift SDK. public enum TurnkeyRequestError: LocalizedError, Sendable, Equatable { case apiError(statusCode: Int?, payload: Data?) case sdkError(Error) case network(Error) case invalidResponse + case clientNotConfigured(String) case unknown(Error) - // helpers public var statusCode: Int? { if case let .apiError(code, _) = self { return code } return nil @@ -21,34 +20,50 @@ public enum TurnkeyRequestError: LocalizedError, Sendable, Equatable { return nil } - /// pretty-prints either the JSON envelope or falls back to a raw string public var fullMessage: String { - // try JSON first - if case let .apiError(_, data?) = self, - let obj = try? JSONSerialization.jsonObject(with: data) as? [String: Any], - let json = try? JSONSerialization.data( - withJSONObject: obj, options: [.sortedKeys, .prettyPrinted]), - let str = String(data: json, encoding: .utf8) - { - return str - } - // fallback raw utf-8 - if case let .apiError(_, data?) = self, - let str = String(data: data, encoding: .utf8) - { - return str + if case let .apiError(code, data?) = self { + // try to pretty-print JSON + if let obj = try? JSONSerialization.jsonObject(with: data) as? [String: Any], + let json = try? JSONSerialization.data( + withJSONObject: obj, + options: [.sortedKeys, .prettyPrinted] + ), + let str = String(data: json, encoding: .utf8) + { + return "Status \(code ?? -1):\n\(str)" + } + + // fallback + // try raw UTF-8 string + if let str = String(data: data, encoding: .utf8) { + return "Status \(code ?? -1):\n\(str)" + } + + // fallback + // show byte count + return "Status \(code ?? -1): <\(data.count) bytes>" } + // this should never happen return errorDescription ?? "Unknown error" } public var errorDescription: String? { switch self { - case .apiError: return "Turnkey API returned an error response." - case .sdkError(let e): return e.localizedDescription - case .network(let e): return e.localizedDescription - case .invalidResponse: return "Invalid response from server." - case .unknown(let e): return e.localizedDescription + case .apiError(_, _?): + return fullMessage + case .apiError: + return "Turnkey API returned an error response." + case .sdkError(let e): + return e.localizedDescription + case .network(let e): + return e.localizedDescription + case .invalidResponse: + return "Invalid response from server." + case .clientNotConfigured(let client): + return "The required client (\(client)) is not configured." + case .unknown(let e): + return e.localizedDescription } } @@ -67,9 +82,12 @@ public enum TurnkeyRequestError: LocalizedError, Sendable, Equatable { public static func == (lhs: Self, rhs: Self) -> Bool { switch (lhs, rhs) { - case let (.apiError(c1, d1), .apiError(c2, d2)): return c1 == c2 && d1 == d2 - case (.invalidResponse, .invalidResponse): return true - default: return false + case let (.apiError(c1, d1), .apiError(c2, d2)): + return c1 == c2 && d1 == d2 + case (.invalidResponse, .invalidResponse): + return true + default: + return false } } } diff --git a/Sources/TurnkeyHttp/Public/TurnkeyClient+AuthProxy.swift b/Sources/TurnkeyHttp/Public/TurnkeyClient+AuthProxy.swift new file mode 100644 index 00000000..f2d4bbb4 --- /dev/null +++ b/Sources/TurnkeyHttp/Public/TurnkeyClient+AuthProxy.swift @@ -0,0 +1,64 @@ +// @generated by Clientgen. DO NOT EDIT BY HAND + +import Foundation +import TurnkeyTypes + +extension TurnkeyClient { + + /// Get Account + /// Return organization id associated with a given phone number, email, public key, credential ID or OIDC token. + public func proxyGetAccount(_ input: ProxyTGetAccountBody) async throws + -> ProxyTGetAccountResponse + { + return try await authProxyRequest("/v1/account", body: input) + } + + /// OAuth 2.0 Authenticate + /// Authenticate with an OAuth 2.0 provider and receive an OIDC token issued by Turnkey in response. + public func proxyOAuth2Authenticate(_ input: ProxyTOAuth2AuthenticateBody) async throws + -> ProxyTOAuth2AuthenticateResponse + { + return try await authProxyRequest("/v1/oauth2_authenticate", body: input) + } + + /// OAuth Login + /// Login using an OIDC token and public key. + public func proxyOAuthLogin(_ input: ProxyTOAuthLoginBody) async throws + -> ProxyTOAuthLoginResponse + { + return try await authProxyRequest("/v1/oauth_login", body: input) + } + + /// Init OTP + /// Initialize an OTP (email or SMS) for a user. + public func proxyInitOtp(_ input: ProxyTInitOtpBody) async throws -> ProxyTInitOtpResponse { + return try await authProxyRequest("/v1/otp_init", body: input) + } + + /// OTP Login + /// Login using a verification token and public key. + public func proxyOtpLogin(_ input: ProxyTOtpLoginBody) async throws -> ProxyTOtpLoginResponse { + return try await authProxyRequest("/v1/otp_login", body: input) + } + + /// Verify OTP + /// Verify the OTP code previously sent to the user's contact and return a verification token. + public func proxyVerifyOtp(_ input: ProxyTVerifyOtpBody) async throws -> ProxyTVerifyOtpResponse { + return try await authProxyRequest("/v1/otp_verify", body: input) + } + + /// Signup + /// Onboard a new user. + public func proxySignup(_ input: ProxyTSignupBody) async throws -> ProxyTSignupResponse { + return try await authProxyRequest("/v1/signup", body: input) + } + + /// Get WalletKit Config + /// Get wallet kit settings and feature toggles for the calling organization. + public func proxyGetWalletKitConfig(_ input: ProxyTGetWalletKitConfigBody) async throws + -> ProxyTGetWalletKitConfigResponse + { + return try await authProxyRequest("/v1/wallet_kit_config", body: input) + } + +} diff --git a/Sources/TurnkeyHttp/Public/TurnkeyClient+Initialization.swift b/Sources/TurnkeyHttp/Public/TurnkeyClient+Initialization.swift deleted file mode 100644 index de0982bf..00000000 --- a/Sources/TurnkeyHttp/Public/TurnkeyClient+Initialization.swift +++ /dev/null @@ -1,85 +0,0 @@ -import AuthenticationServices -import CryptoKit -import Foundation -import OpenAPIURLSession -import TurnkeyStamper - -extension TurnkeyClient { - - /// Initializes a `TurnkeyClient` with a proxy server URL. - /// - /// - Parameter proxyURL: The URL of the proxy server that requests will be forwarded to. - public init(proxyURL: String) { - self.init( - underlyingClient: Client( - serverURL: URL(string: TurnkeyClient.baseURLString)!, - transport: URLSessionTransport(), - middlewares: [ - ProxyMiddleware(proxyURL: URL(string: proxyURL)!) - ] - ) - ) - } - - /// Initializes a `TurnkeyClient` with an API key pair for authenticated requests. - /// - /// - Parameters: - /// - apiPrivateKey: The base64-encoded API private key. - /// - apiPublicKey: The base64-encoded API public key. - /// - baseUrl: Optional base URL (defaults to Turnkey production). - public init( - apiPrivateKey: String, - apiPublicKey: String, - baseUrl: String = TurnkeyClient.baseURLString - ) { - let stamper = Stamper(apiPublicKey: apiPublicKey, apiPrivateKey: apiPrivateKey) - self.init( - underlyingClient: Client( - serverURL: URL(string: baseUrl)!, - transport: URLSessionTransport(), - middlewares: [ - AuthStampMiddleware(stamper: stamper) - ] - ) - ) - } - - /// Initializes a `TurnkeyClient` using on-device session credentials. - /// - /// Assumes a valid session JWT has been stored locally. - public init() { - let stamper = Stamper() - self.init( - underlyingClient: Client( - serverURL: URL(string: TurnkeyClient.baseURLString)!, - transport: URLSessionTransport(), - middlewares: [ - AuthStampMiddleware(stamper: stamper) - ] - ) - ) - } - - /// Initializes a `TurnkeyClient` using passkeys for authentication. - /// - /// - Parameters: - /// - rpId: The Relying Party ID (must match your app's associated domain config). - /// - presentationAnchor: The window or view used to present authentication prompts. - /// - baseUrl: Optional base URL (defaults to Turnkey production). - public init( - rpId: String, - presentationAnchor: ASPresentationAnchor, - baseUrl: String = TurnkeyClient.baseURLString - ) { - let stamper = Stamper(rpId: rpId, presentationAnchor: presentationAnchor) - self.init( - underlyingClient: Client( - serverURL: URL(string: baseUrl)!, - transport: URLSessionTransport(), - middlewares: [ - AuthStampMiddleware(stamper: stamper) - ] - ) - ) - } -} diff --git a/Sources/TurnkeyHttp/Public/TurnkeyClient+Public.swift b/Sources/TurnkeyHttp/Public/TurnkeyClient+Public.swift new file mode 100644 index 00000000..b1d7d6fd --- /dev/null +++ b/Sources/TurnkeyHttp/Public/TurnkeyClient+Public.swift @@ -0,0 +1,903 @@ +// @generated by Clientgen. DO NOT EDIT BY HAND + +import Foundation +import TurnkeyTypes + +extension TurnkeyClient { + + /// Get activity + /// Get details about an activity. + public func getActivity(_ input: TGetActivityBody) async throws -> TGetActivityResponse { + return try await request("/public/v1/query/get_activity", body: input) + } + + /// Get API key + /// Get details about an API key. + public func getApiKey(_ input: TGetApiKeyBody) async throws -> TGetApiKeyResponse { + return try await request("/public/v1/query/get_api_key", body: input) + } + + /// Get API keys + /// Get details about API keys for a user. + public func getApiKeys(_ input: TGetApiKeysBody = .init()) async throws -> TGetApiKeysResponse { + return try await request("/public/v1/query/get_api_keys", body: input) + } + + /// Attestation + /// Get the attestation document corresponding to an enclave. + public func getAttestationDocument(_ input: TGetAttestationDocumentBody) async throws + -> TGetAttestationDocumentResponse + { + return try await request("/public/v1/query/get_attestation", body: input) + } + + /// Get authenticator + /// Get details about an authenticator. + public func getAuthenticator(_ input: TGetAuthenticatorBody) async throws + -> TGetAuthenticatorResponse + { + return try await request("/public/v1/query/get_authenticator", body: input) + } + + /// Get authenticators + /// Get details about authenticators for a user. + public func getAuthenticators(_ input: TGetAuthenticatorsBody) async throws + -> TGetAuthenticatorsResponse + { + return try await request("/public/v1/query/get_authenticators", body: input) + } + + /// Get a specific boot proof + /// Get the boot proof for a given ephemeral key. + public func getBootProof(_ input: TGetBootProofBody) async throws -> TGetBootProofResponse { + return try await request("/public/v1/query/get_boot_proof", body: input) + } + + /// Get the latest boot proof for an app + /// Get the latest boot proof for a given enclave app name. + public func getLatestBootProof(_ input: TGetLatestBootProofBody) async throws + -> TGetLatestBootProofResponse + { + return try await request("/public/v1/query/get_latest_boot_proof", body: input) + } + + /// Get OAuth 2.0 credential + /// Get details about an OAuth 2.0 credential. + public func getOauth2Credential(_ input: TGetOauth2CredentialBody) async throws + -> TGetOauth2CredentialResponse + { + return try await request("/public/v1/query/get_oauth2_credential", body: input) + } + + /// Get Oauth providers + /// Get details about Oauth providers for a user. + public func getOauthProviders(_ input: TGetOauthProvidersBody) async throws + -> TGetOauthProvidersResponse + { + return try await request("/public/v1/query/get_oauth_providers", body: input) + } + + /// Get organization + /// Get details about an organization. + public func getOrganization(_ input: TGetOrganizationBody = .init()) async throws + -> TGetOrganizationResponse + { + return try await request("/public/v1/query/get_organization", body: input) + } + + /// Get configs + /// Get quorum settings and features for an organization. + public func getOrganizationConfigs(_ input: TGetOrganizationConfigsBody) async throws + -> TGetOrganizationConfigsResponse + { + return try await request("/public/v1/query/get_organization_configs", body: input) + } + + /// Get policy + /// Get details about a policy. + public func getPolicy(_ input: TGetPolicyBody) async throws -> TGetPolicyResponse { + return try await request("/public/v1/query/get_policy", body: input) + } + + /// Get policy evaluations + /// Get the policy evaluations for an activity. + public func getPolicyEvaluations(_ input: TGetPolicyEvaluationsBody) async throws + -> TGetPolicyEvaluationsResponse + { + return try await request("/public/v1/query/get_policy_evaluations", body: input) + } + + /// Get private key + /// Get details about a private key. + public func getPrivateKey(_ input: TGetPrivateKeyBody) async throws -> TGetPrivateKeyResponse { + return try await request("/public/v1/query/get_private_key", body: input) + } + + /// Get smart contract interface + /// Get details about a smart contract interface. + public func getSmartContractInterface(_ input: TGetSmartContractInterfaceBody) async throws + -> TGetSmartContractInterfaceResponse + { + return try await request("/public/v1/query/get_smart_contract_interface", body: input) + } + + /// Get user + /// Get details about a user. + public func getUser(_ input: TGetUserBody) async throws -> TGetUserResponse { + return try await request("/public/v1/query/get_user", body: input) + } + + /// Get wallet + /// Get details about a wallet. + public func getWallet(_ input: TGetWalletBody) async throws -> TGetWalletResponse { + return try await request("/public/v1/query/get_wallet", body: input) + } + + /// Get wallet account + /// Get a single wallet account. + public func getWalletAccount(_ input: TGetWalletAccountBody) async throws + -> TGetWalletAccountResponse + { + return try await request("/public/v1/query/get_wallet_account", body: input) + } + + /// List activities + /// List all activities within an organization. + public func getActivities(_ input: TGetActivitiesBody = .init()) async throws + -> TGetActivitiesResponse + { + return try await request("/public/v1/query/list_activities", body: input) + } + + /// List app proofs for an activity + /// List the app proofs for the given activity. + public func getAppProofs(_ input: TGetAppProofsBody) async throws -> TGetAppProofsResponse { + return try await request("/public/v1/query/list_app_proofs", body: input) + } + + /// List OAuth 2.0 Credentials + /// List all OAuth 2.0 credentials within an organization. + public func listOauth2Credentials(_ input: TListOauth2CredentialsBody) async throws + -> TListOauth2CredentialsResponse + { + return try await request("/public/v1/query/list_oauth2_credentials", body: input) + } + + /// List policies + /// List all policies within an organization. + public func getPolicies(_ input: TGetPoliciesBody = .init()) async throws -> TGetPoliciesResponse + { + return try await request("/public/v1/query/list_policies", body: input) + } + + /// List private key tags + /// List all private key tags within an organization. + public func listPrivateKeyTags(_ input: TListPrivateKeyTagsBody) async throws + -> TListPrivateKeyTagsResponse + { + return try await request("/public/v1/query/list_private_key_tags", body: input) + } + + /// List private keys + /// List all private keys within an organization. + public func getPrivateKeys(_ input: TGetPrivateKeysBody = .init()) async throws + -> TGetPrivateKeysResponse + { + return try await request("/public/v1/query/list_private_keys", body: input) + } + + /// List smart contract interfaces + /// List all smart contract interfaces within an organization. + public func getSmartContractInterfaces(_ input: TGetSmartContractInterfacesBody) async throws + -> TGetSmartContractInterfacesResponse + { + return try await request("/public/v1/query/list_smart_contract_interfaces", body: input) + } + + /// Get sub-organizations + /// Get all suborg IDs associated given a parent org ID and an optional filter. + public func getSubOrgIds(_ input: TGetSubOrgIdsBody = .init()) async throws + -> TGetSubOrgIdsResponse + { + return try await request("/public/v1/query/list_suborgs", body: input) + } + + /// List user tags + /// List all user tags within an organization. + public func listUserTags(_ input: TListUserTagsBody) async throws -> TListUserTagsResponse { + return try await request("/public/v1/query/list_user_tags", body: input) + } + + /// List users + /// List all users within an organization. + public func getUsers(_ input: TGetUsersBody = .init()) async throws -> TGetUsersResponse { + return try await request("/public/v1/query/list_users", body: input) + } + + /// Get verified sub-organizations + /// Get all email or phone verified suborg IDs associated given a parent org ID. + public func getVerifiedSubOrgIds(_ input: TGetVerifiedSubOrgIdsBody) async throws + -> TGetVerifiedSubOrgIdsResponse + { + return try await request("/public/v1/query/list_verified_suborgs", body: input) + } + + /// List wallets accounts + /// List all accounts within a wallet. + public func getWalletAccounts(_ input: TGetWalletAccountsBody) async throws + -> TGetWalletAccountsResponse + { + return try await request("/public/v1/query/list_wallet_accounts", body: input) + } + + /// List wallets + /// List all wallets within an organization. + public func getWallets(_ input: TGetWalletsBody = .init()) async throws -> TGetWalletsResponse { + return try await request("/public/v1/query/list_wallets", body: input) + } + + /// Who am I? + /// Get basic information about your current API or WebAuthN user and their organization. Affords sub-organization look ups via parent organization for WebAuthN or API key users. + public func getWhoami(_ input: TGetWhoamiBody = .init()) async throws -> TGetWhoamiResponse { + return try await request("/public/v1/query/whoami", body: input) + } + + /// Approve activity + /// Approve an activity. + public func approveActivity(_ input: TApproveActivityBody) async throws + -> TApproveActivityResponse + { + return try await activityDecision( + "/public/v1/submit/approve_activity", body: input, + activityType: "ACTIVITY_TYPE_APPROVE_ACTIVITY") + } + + /// Create API keys + /// Add API keys to an existing user. + public func createApiKeys(_ input: TCreateApiKeysBody) async throws -> TCreateApiKeysResponse { + return try await activity( + "/public/v1/submit/create_api_keys", body: input, + activityType: "ACTIVITY_TYPE_CREATE_API_KEYS_V2", resultKey: "createApiKeysResult") + } + + /// Create API-only users + /// Create API-only users in an existing organization. + public func createApiOnlyUsers(_ input: TCreateApiOnlyUsersBody) async throws + -> TCreateApiOnlyUsersResponse + { + return try await activity( + "/public/v1/submit/create_api_only_users", body: input, + activityType: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS", resultKey: "createApiOnlyUsersResult") + } + + /// Create authenticators + /// Create authenticators to authenticate requests to Turnkey. + public func createAuthenticators(_ input: TCreateAuthenticatorsBody) async throws + -> TCreateAuthenticatorsResponse + { + return try await activity( + "/public/v1/submit/create_authenticators", body: input, + activityType: "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2", + resultKey: "createAuthenticatorsResult") + } + + /// Create invitations + /// Create invitations to join an existing organization. + public func createInvitations(_ input: TCreateInvitationsBody) async throws + -> TCreateInvitationsResponse + { + return try await activity( + "/public/v1/submit/create_invitations", body: input, + activityType: "ACTIVITY_TYPE_CREATE_INVITATIONS", resultKey: "createInvitationsResult") + } + + /// Create an OAuth 2.0 Credential + /// Enable authentication for end users with an OAuth 2.0 provider + public func createOauth2Credential(_ input: TCreateOauth2CredentialBody) async throws + -> TCreateOauth2CredentialResponse + { + return try await activity( + "/public/v1/submit/create_oauth2_credential", body: input, + activityType: "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL", + resultKey: "createOauth2CredentialResult") + } + + /// Create Oauth providers + /// Create Oauth providers for a specified user. + public func createOauthProviders(_ input: TCreateOauthProvidersBody) async throws + -> TCreateOauthProvidersResponse + { + return try await activity( + "/public/v1/submit/create_oauth_providers", body: input, + activityType: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS", resultKey: "createOauthProvidersResult") + } + + /// Create policies + /// Create new policies. + public func createPolicies(_ input: TCreatePoliciesBody) async throws -> TCreatePoliciesResponse { + return try await activity( + "/public/v1/submit/create_policies", body: input, + activityType: "ACTIVITY_TYPE_CREATE_POLICIES", resultKey: "createPoliciesResult") + } + + /// Create policy + /// Create a new policy. + public func createPolicy(_ input: TCreatePolicyBody) async throws -> TCreatePolicyResponse { + return try await activity( + "/public/v1/submit/create_policy", body: input, + activityType: "ACTIVITY_TYPE_CREATE_POLICY_V3", resultKey: "createPolicyResult") + } + + /// Create private key tag + /// Create a private key tag and add it to private keys. + public func createPrivateKeyTag(_ input: TCreatePrivateKeyTagBody) async throws + -> TCreatePrivateKeyTagResponse + { + return try await activity( + "/public/v1/submit/create_private_key_tag", body: input, + activityType: "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG", resultKey: "createPrivateKeyTagResult") + } + + /// Create private keys + /// Create new private keys. + public func createPrivateKeys(_ input: TCreatePrivateKeysBody) async throws + -> TCreatePrivateKeysResponse + { + return try await activity( + "/public/v1/submit/create_private_keys", body: input, + activityType: "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2", resultKey: "createPrivateKeysResultV2") + } + + /// Create read only session + /// Create a read only session for a user (valid for 1 hour). + public func createReadOnlySession(_ input: TCreateReadOnlySessionBody) async throws + -> TCreateReadOnlySessionResponse + { + return try await activity( + "/public/v1/submit/create_read_only_session", body: input, + activityType: "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION", + resultKey: "createReadOnlySessionResult") + } + + /// Create read write session + /// Create a read write session for a user. + public func createReadWriteSession(_ input: TCreateReadWriteSessionBody) async throws + -> TCreateReadWriteSessionResponse + { + return try await activity( + "/public/v1/submit/create_read_write_session", body: input, + activityType: "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2", + resultKey: "createReadWriteSessionResultV2") + } + + /// Create smart contract interface + /// Create an ABI/IDL in JSON. + public func createSmartContractInterface(_ input: TCreateSmartContractInterfaceBody) async throws + -> TCreateSmartContractInterfaceResponse + { + return try await activity( + "/public/v1/submit/create_smart_contract_interface", body: input, + activityType: "ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE", + resultKey: "createSmartContractInterfaceResult") + } + + /// Create sub-organization + /// Create a new sub-organization. + public func createSubOrganization(_ input: TCreateSubOrganizationBody) async throws + -> TCreateSubOrganizationResponse + { + return try await activity( + "/public/v1/submit/create_sub_organization", body: input, + activityType: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7", + resultKey: "createSubOrganizationResultV7") + } + + /// Create user tag + /// Create a user tag and add it to users. + public func createUserTag(_ input: TCreateUserTagBody) async throws -> TCreateUserTagResponse { + return try await activity( + "/public/v1/submit/create_user_tag", body: input, + activityType: "ACTIVITY_TYPE_CREATE_USER_TAG", resultKey: "createUserTagResult") + } + + /// Create users + /// Create users in an existing organization. + public func createUsers(_ input: TCreateUsersBody) async throws -> TCreateUsersResponse { + return try await activity( + "/public/v1/submit/create_users", body: input, activityType: "ACTIVITY_TYPE_CREATE_USERS_V3", + resultKey: "createUsersResult") + } + + /// Create wallet + /// Create a wallet and derive addresses. + public func createWallet(_ input: TCreateWalletBody) async throws -> TCreateWalletResponse { + return try await activity( + "/public/v1/submit/create_wallet", body: input, activityType: "ACTIVITY_TYPE_CREATE_WALLET", + resultKey: "createWalletResult") + } + + /// Create wallet accounts + /// Derive additional addresses using an existing wallet. + public func createWalletAccounts(_ input: TCreateWalletAccountsBody) async throws + -> TCreateWalletAccountsResponse + { + return try await activity( + "/public/v1/submit/create_wallet_accounts", body: input, + activityType: "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS", resultKey: "createWalletAccountsResult") + } + + /// Delete API keys + /// Remove api keys from a user. + public func deleteApiKeys(_ input: TDeleteApiKeysBody) async throws -> TDeleteApiKeysResponse { + return try await activity( + "/public/v1/submit/delete_api_keys", body: input, + activityType: "ACTIVITY_TYPE_DELETE_API_KEYS", resultKey: "deleteApiKeysResult") + } + + /// Delete authenticators + /// Remove authenticators from a user. + public func deleteAuthenticators(_ input: TDeleteAuthenticatorsBody) async throws + -> TDeleteAuthenticatorsResponse + { + return try await activity( + "/public/v1/submit/delete_authenticators", body: input, + activityType: "ACTIVITY_TYPE_DELETE_AUTHENTICATORS", resultKey: "deleteAuthenticatorsResult") + } + + /// Delete invitation + /// Delete an existing invitation. + public func deleteInvitation(_ input: TDeleteInvitationBody) async throws + -> TDeleteInvitationResponse + { + return try await activity( + "/public/v1/submit/delete_invitation", body: input, + activityType: "ACTIVITY_TYPE_DELETE_INVITATION", resultKey: "deleteInvitationResult") + } + + /// Delete an OAuth 2.0 Credential + /// Disable authentication for end users with an OAuth 2.0 provider + public func deleteOauth2Credential(_ input: TDeleteOauth2CredentialBody) async throws + -> TDeleteOauth2CredentialResponse + { + return try await activity( + "/public/v1/submit/delete_oauth2_credential", body: input, + activityType: "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL", + resultKey: "deleteOauth2CredentialResult") + } + + /// Delete Oauth providers + /// Remove Oauth providers for a specified user. + public func deleteOauthProviders(_ input: TDeleteOauthProvidersBody) async throws + -> TDeleteOauthProvidersResponse + { + return try await activity( + "/public/v1/submit/delete_oauth_providers", body: input, + activityType: "ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS", resultKey: "deleteOauthProvidersResult") + } + + /// Delete policies + /// Delete existing policies. + public func deletePolicies(_ input: TDeletePoliciesBody) async throws -> TDeletePoliciesResponse { + return try await activity( + "/public/v1/submit/delete_policies", body: input, + activityType: "ACTIVITY_TYPE_DELETE_POLICIES", resultKey: "deletePoliciesResult") + } + + /// Delete policy + /// Delete an existing policy. + public func deletePolicy(_ input: TDeletePolicyBody) async throws -> TDeletePolicyResponse { + return try await activity( + "/public/v1/submit/delete_policy", body: input, activityType: "ACTIVITY_TYPE_DELETE_POLICY", + resultKey: "deletePolicyResult") + } + + /// Delete private key tags + /// Delete private key tags within an organization. + public func deletePrivateKeyTags(_ input: TDeletePrivateKeyTagsBody) async throws + -> TDeletePrivateKeyTagsResponse + { + return try await activity( + "/public/v1/submit/delete_private_key_tags", body: input, + activityType: "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS", resultKey: "deletePrivateKeyTagsResult" + ) + } + + /// Delete private keys + /// Delete private keys for an organization. + public func deletePrivateKeys(_ input: TDeletePrivateKeysBody) async throws + -> TDeletePrivateKeysResponse + { + return try await activity( + "/public/v1/submit/delete_private_keys", body: input, + activityType: "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS", resultKey: "deletePrivateKeysResult") + } + + /// Delete smart contract interface + /// Delete a smart contract interface. + public func deleteSmartContractInterface(_ input: TDeleteSmartContractInterfaceBody) async throws + -> TDeleteSmartContractInterfaceResponse + { + return try await activity( + "/public/v1/submit/delete_smart_contract_interface", body: input, + activityType: "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE", + resultKey: "deleteSmartContractInterfaceResult") + } + + /// Delete sub-organization + /// Delete a sub-organization. + public func deleteSubOrganization(_ input: TDeleteSubOrganizationBody) async throws + -> TDeleteSubOrganizationResponse + { + return try await activity( + "/public/v1/submit/delete_sub_organization", body: input, + activityType: "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION", + resultKey: "deleteSubOrganizationResult") + } + + /// Delete user tags + /// Delete user tags within an organization. + public func deleteUserTags(_ input: TDeleteUserTagsBody) async throws -> TDeleteUserTagsResponse { + return try await activity( + "/public/v1/submit/delete_user_tags", body: input, + activityType: "ACTIVITY_TYPE_DELETE_USER_TAGS", resultKey: "deleteUserTagsResult") + } + + /// Delete users + /// Delete users within an organization. + public func deleteUsers(_ input: TDeleteUsersBody) async throws -> TDeleteUsersResponse { + return try await activity( + "/public/v1/submit/delete_users", body: input, activityType: "ACTIVITY_TYPE_DELETE_USERS", + resultKey: "deleteUsersResult") + } + + /// Delete wallet accounts + /// Delete wallet accounts for an organization. + public func deleteWalletAccounts(_ input: TDeleteWalletAccountsBody) async throws + -> TDeleteWalletAccountsResponse + { + return try await activity( + "/public/v1/submit/delete_wallet_accounts", body: input, + activityType: "ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS", resultKey: "deleteWalletAccountsResult") + } + + /// Delete wallets + /// Delete wallets for an organization. + public func deleteWallets(_ input: TDeleteWalletsBody) async throws -> TDeleteWalletsResponse { + return try await activity( + "/public/v1/submit/delete_wallets", body: input, activityType: "ACTIVITY_TYPE_DELETE_WALLETS", + resultKey: "deleteWalletsResult") + } + + /// Perform email auth + /// Authenticate a user via email. + public func emailAuth(_ input: TEmailAuthBody) async throws -> TEmailAuthResponse { + return try await activity( + "/public/v1/submit/email_auth", body: input, activityType: "ACTIVITY_TYPE_EMAIL_AUTH_V2", + resultKey: "emailAuthResult") + } + + /// Export private key + /// Export a private key. + public func exportPrivateKey(_ input: TExportPrivateKeyBody) async throws + -> TExportPrivateKeyResponse + { + return try await activity( + "/public/v1/submit/export_private_key", body: input, + activityType: "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY", resultKey: "exportPrivateKeyResult") + } + + /// Export wallet + /// Export a wallet. + public func exportWallet(_ input: TExportWalletBody) async throws -> TExportWalletResponse { + return try await activity( + "/public/v1/submit/export_wallet", body: input, activityType: "ACTIVITY_TYPE_EXPORT_WALLET", + resultKey: "exportWalletResult") + } + + /// Export wallet account + /// Export a wallet account. + public func exportWalletAccount(_ input: TExportWalletAccountBody) async throws + -> TExportWalletAccountResponse + { + return try await activity( + "/public/v1/submit/export_wallet_account", body: input, + activityType: "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT", resultKey: "exportWalletAccountResult") + } + + /// Import private key + /// Import a private key. + public func importPrivateKey(_ input: TImportPrivateKeyBody) async throws + -> TImportPrivateKeyResponse + { + return try await activity( + "/public/v1/submit/import_private_key", body: input, + activityType: "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY", resultKey: "importPrivateKeyResult") + } + + /// Import wallet + /// Import a wallet. + public func importWallet(_ input: TImportWalletBody) async throws -> TImportWalletResponse { + return try await activity( + "/public/v1/submit/import_wallet", body: input, activityType: "ACTIVITY_TYPE_IMPORT_WALLET", + resultKey: "importWalletResult") + } + + /// Init fiat on ramp + /// Initiate a fiat on ramp flow. + public func initFiatOnRamp(_ input: TInitFiatOnRampBody) async throws -> TInitFiatOnRampResponse { + return try await activity( + "/public/v1/submit/init_fiat_on_ramp", body: input, + activityType: "ACTIVITY_TYPE_INIT_FIAT_ON_RAMP", resultKey: "initFiatOnRampResult") + } + + /// Init import private key + /// Initialize a new private key import. + public func initImportPrivateKey(_ input: TInitImportPrivateKeyBody) async throws + -> TInitImportPrivateKeyResponse + { + return try await activity( + "/public/v1/submit/init_import_private_key", body: input, + activityType: "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY", resultKey: "initImportPrivateKeyResult" + ) + } + + /// Init import wallet + /// Initialize a new wallet import. + public func initImportWallet(_ input: TInitImportWalletBody) async throws + -> TInitImportWalletResponse + { + return try await activity( + "/public/v1/submit/init_import_wallet", body: input, + activityType: "ACTIVITY_TYPE_INIT_IMPORT_WALLET", resultKey: "initImportWalletResult") + } + + /// Init generic OTP + /// Initiate a generic OTP activity. + public func initOtp(_ input: TInitOtpBody) async throws -> TInitOtpResponse { + return try await activity( + "/public/v1/submit/init_otp", body: input, activityType: "ACTIVITY_TYPE_INIT_OTP", + resultKey: "initOtpResult") + } + + /// Init OTP auth + /// Initiate an OTP auth activity. + public func initOtpAuth(_ input: TInitOtpAuthBody) async throws -> TInitOtpAuthResponse { + return try await activity( + "/public/v1/submit/init_otp_auth", body: input, + activityType: "ACTIVITY_TYPE_INIT_OTP_AUTH_V2", resultKey: "initOtpAuthResultV2") + } + + /// Init email recovery + /// Initialize a new email recovery. + public func initUserEmailRecovery(_ input: TInitUserEmailRecoveryBody) async throws + -> TInitUserEmailRecoveryResponse + { + return try await activity( + "/public/v1/submit/init_user_email_recovery", body: input, + activityType: "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY", + resultKey: "initUserEmailRecoveryResult") + } + + /// Oauth + /// Authenticate a user with an OIDC token (Oauth). + public func oauth(_ input: TOauthBody) async throws -> TOauthResponse { + return try await activity( + "/public/v1/submit/oauth", body: input, activityType: "ACTIVITY_TYPE_OAUTH", + resultKey: "oauthResult") + } + + /// OAuth 2.0 authentication + /// Authenticate a user with an OAuth 2.0 provider and receive an OIDC token to use with the LoginWithOAuth or CreateSubOrganization activities + public func oauth2Authenticate(_ input: TOauth2AuthenticateBody) async throws + -> TOauth2AuthenticateResponse + { + return try await activity( + "/public/v1/submit/oauth2_authenticate", body: input, + activityType: "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE", resultKey: "oauth2AuthenticateResult") + } + + /// Login with Oauth + /// Create an Oauth session for a user. + public func oauthLogin(_ input: TOauthLoginBody) async throws -> TOauthLoginResponse { + return try await activity( + "/public/v1/submit/oauth_login", body: input, activityType: "ACTIVITY_TYPE_OAUTH_LOGIN", + resultKey: "oauthLoginResult") + } + + /// OTP auth + /// Authenticate a user with an OTP code sent via email or SMS. + public func otpAuth(_ input: TOtpAuthBody) async throws -> TOtpAuthResponse { + return try await activity( + "/public/v1/submit/otp_auth", body: input, activityType: "ACTIVITY_TYPE_OTP_AUTH", + resultKey: "otpAuthResult") + } + + /// Login with OTP + /// Create an OTP session for a user. + public func otpLogin(_ input: TOtpLoginBody) async throws -> TOtpLoginResponse { + return try await activity( + "/public/v1/submit/otp_login", body: input, activityType: "ACTIVITY_TYPE_OTP_LOGIN", + resultKey: "otpLoginResult") + } + + /// Recover a user + /// Complete the process of recovering a user by adding an authenticator. + public func recoverUser(_ input: TRecoverUserBody) async throws -> TRecoverUserResponse { + return try await activity( + "/public/v1/submit/recover_user", body: input, activityType: "ACTIVITY_TYPE_RECOVER_USER", + resultKey: "recoverUserResult") + } + + /// Reject activity + /// Reject an activity. + public func rejectActivity(_ input: TRejectActivityBody) async throws -> TRejectActivityResponse { + return try await activityDecision( + "/public/v1/submit/reject_activity", body: input, + activityType: "ACTIVITY_TYPE_REJECT_ACTIVITY") + } + + /// Remove organization feature + /// Remove an organization feature. This activity must be approved by the current root quorum. + public func removeOrganizationFeature(_ input: TRemoveOrganizationFeatureBody) async throws + -> TRemoveOrganizationFeatureResponse + { + return try await activity( + "/public/v1/submit/remove_organization_feature", body: input, + activityType: "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE", + resultKey: "removeOrganizationFeatureResult") + } + + /// Set organization feature + /// Set an organization feature. This activity must be approved by the current root quorum. + public func setOrganizationFeature(_ input: TSetOrganizationFeatureBody) async throws + -> TSetOrganizationFeatureResponse + { + return try await activity( + "/public/v1/submit/set_organization_feature", body: input, + activityType: "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE", + resultKey: "setOrganizationFeatureResult") + } + + /// Sign raw payload + /// Sign a raw payload. + public func signRawPayload(_ input: TSignRawPayloadBody) async throws -> TSignRawPayloadResponse { + return try await activity( + "/public/v1/submit/sign_raw_payload", body: input, + activityType: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2", resultKey: "signRawPayloadResult") + } + + /// Sign raw payloads + /// Sign multiple raw payloads with the same signing parameters. + public func signRawPayloads(_ input: TSignRawPayloadsBody) async throws + -> TSignRawPayloadsResponse + { + return try await activity( + "/public/v1/submit/sign_raw_payloads", body: input, + activityType: "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS", resultKey: "signRawPayloadsResult") + } + + /// Sign transaction + /// Sign a transaction. + public func signTransaction(_ input: TSignTransactionBody) async throws + -> TSignTransactionResponse + { + return try await activity( + "/public/v1/submit/sign_transaction", body: input, + activityType: "ACTIVITY_TYPE_SIGN_TRANSACTION_V2", resultKey: "signTransactionResult") + } + + /// Login with a stamp + /// Create a session for a user through stamping client side (API key, wallet client, or passkey client). + public func stampLogin(_ input: TStampLoginBody) async throws -> TStampLoginResponse { + return try await activity( + "/public/v1/submit/stamp_login", body: input, activityType: "ACTIVITY_TYPE_STAMP_LOGIN", + resultKey: "stampLoginResult") + } + + /// Update an OAuth 2.0 Credential + /// Update an OAuth 2.0 provider credential + public func updateOauth2Credential(_ input: TUpdateOauth2CredentialBody) async throws + -> TUpdateOauth2CredentialResponse + { + return try await activity( + "/public/v1/submit/update_oauth2_credential", body: input, + activityType: "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL", + resultKey: "updateOauth2CredentialResult") + } + + /// Update policy + /// Update an existing policy. + public func updatePolicy(_ input: TUpdatePolicyBody) async throws -> TUpdatePolicyResponse { + return try await activity( + "/public/v1/submit/update_policy", body: input, + activityType: "ACTIVITY_TYPE_UPDATE_POLICY_V2", resultKey: "updatePolicyResultV2") + } + + /// Update private key tag + /// Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. + public func updatePrivateKeyTag(_ input: TUpdatePrivateKeyTagBody) async throws + -> TUpdatePrivateKeyTagResponse + { + return try await activity( + "/public/v1/submit/update_private_key_tag", body: input, + activityType: "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG", resultKey: "updatePrivateKeyTagResult") + } + + /// Update root quorum + /// Set the threshold and members of the root quorum. This activity must be approved by the current root quorum. + public func updateRootQuorum(_ input: TUpdateRootQuorumBody) async throws + -> TUpdateRootQuorumResponse + { + return try await activity( + "/public/v1/submit/update_root_quorum", body: input, + activityType: "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM", resultKey: "updateRootQuorumResult") + } + + /// Update user + /// Update a user in an existing organization. + public func updateUser(_ input: TUpdateUserBody) async throws -> TUpdateUserResponse { + return try await activity( + "/public/v1/submit/update_user", body: input, activityType: "ACTIVITY_TYPE_UPDATE_USER", + resultKey: "updateUserResult") + } + + /// Update user's email + /// Update a user's email in an existing organization. + public func updateUserEmail(_ input: TUpdateUserEmailBody) async throws + -> TUpdateUserEmailResponse + { + return try await activity( + "/public/v1/submit/update_user_email", body: input, + activityType: "ACTIVITY_TYPE_UPDATE_USER_EMAIL", resultKey: "updateUserEmailResult") + } + + /// Update user's name + /// Update a user's name in an existing organization. + public func updateUserName(_ input: TUpdateUserNameBody) async throws -> TUpdateUserNameResponse { + return try await activity( + "/public/v1/submit/update_user_name", body: input, + activityType: "ACTIVITY_TYPE_UPDATE_USER_NAME", resultKey: "updateUserNameResult") + } + + /// Update user's phone number + /// Update a user's phone number in an existing organization. + public func updateUserPhoneNumber(_ input: TUpdateUserPhoneNumberBody) async throws + -> TUpdateUserPhoneNumberResponse + { + return try await activity( + "/public/v1/submit/update_user_phone_number", body: input, + activityType: "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER", + resultKey: "updateUserPhoneNumberResult") + } + + /// Update user tag + /// Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. + public func updateUserTag(_ input: TUpdateUserTagBody) async throws -> TUpdateUserTagResponse { + return try await activity( + "/public/v1/submit/update_user_tag", body: input, + activityType: "ACTIVITY_TYPE_UPDATE_USER_TAG", resultKey: "updateUserTagResult") + } + + /// Update wallet + /// Update a wallet for an organization. + public func updateWallet(_ input: TUpdateWalletBody) async throws -> TUpdateWalletResponse { + return try await activity( + "/public/v1/submit/update_wallet", body: input, activityType: "ACTIVITY_TYPE_UPDATE_WALLET", + resultKey: "updateWalletResult") + } + + /// Verify generic OTP + /// Verify a generic OTP. + public func verifyOtp(_ input: TVerifyOtpBody) async throws -> TVerifyOtpResponse { + return try await activity( + "/public/v1/submit/verify_otp", body: input, activityType: "ACTIVITY_TYPE_VERIFY_OTP", + resultKey: "verifyOtpResult") + } + + /// Test rate limit + /// Set a rate local rate limit just on the current endpoint, for purposes of testing with Vivosuite. + public func testRateLimits(_ input: TTestRateLimitsBody) async throws -> TTestRateLimitsResponse { + return try await request("/tkhq/api/v1/test_rate_limits", body: input) + } + +} diff --git a/Sources/TurnkeyHttp/Public/TurnkeyClient.swift b/Sources/TurnkeyHttp/Public/TurnkeyClient.swift index dfc431b2..c498b4ad 100644 --- a/Sources/TurnkeyHttp/Public/TurnkeyClient.swift +++ b/Sources/TurnkeyHttp/Public/TurnkeyClient.swift @@ -1,2078 +1,194 @@ -// Generated using Sourcery 2.2.7 — https://github.com/krzysztofzablocki/Sourcery -// DO NOT EDIT - import AuthenticationServices import CryptoKit import Foundation -import OpenAPIRuntime -import OpenAPIURLSession - -public struct TurnkeyClient { - public static let baseURLString = "https://api.turnkey.com" - - private let underlyingClient: any APIProtocol - - internal init(underlyingClient: any APIProtocol) { - self.underlyingClient = underlyingClient - } - public func getActivity(organizationId: String, activityId: String) async throws - -> Operations.GetActivity.Output.Ok - { - - // Create the GetActivityRequest - let getActivityRequest = Components.Schemas.GetActivityRequest( - organizationId: organizationId, activityId: activityId - ) - - let input = Operations.GetActivity.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getActivityRequest) - ) - - return try await call { try await underlyingClient.GetActivity(input) } - - } - public func getApiKey(organizationId: String, apiKeyId: String) async throws - -> Operations.GetApiKey.Output.Ok - { - - // Create the GetApiKeyRequest - let getApiKeyRequest = Components.Schemas.GetApiKeyRequest( - organizationId: organizationId, apiKeyId: apiKeyId - ) - - let input = Operations.GetApiKey.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getApiKeyRequest) - ) - - return try await call { try await underlyingClient.GetApiKey(input) } - - } - public func getApiKeys(organizationId: String, userId: String?) async throws - -> Operations.GetApiKeys.Output.Ok - { - - // Create the GetApiKeysRequest - let getApiKeysRequest = Components.Schemas.GetApiKeysRequest( - organizationId: organizationId, userId: userId - ) - - let input = Operations.GetApiKeys.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getApiKeysRequest) - ) - - return try await call { try await underlyingClient.GetApiKeys(input) } - - } - public func getAuthenticator(organizationId: String, authenticatorId: String) async throws - -> Operations.GetAuthenticator.Output.Ok - { - - // Create the GetAuthenticatorRequest - let getAuthenticatorRequest = Components.Schemas.GetAuthenticatorRequest( - organizationId: organizationId, authenticatorId: authenticatorId - ) - - let input = Operations.GetAuthenticator.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getAuthenticatorRequest) - ) - - return try await call { try await underlyingClient.GetAuthenticator(input) } - - } - public func getAuthenticators(organizationId: String, userId: String) async throws - -> Operations.GetAuthenticators.Output.Ok - { - - // Create the GetAuthenticatorsRequest - let getAuthenticatorsRequest = Components.Schemas.GetAuthenticatorsRequest( - organizationId: organizationId, userId: userId - ) - - let input = Operations.GetAuthenticators.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getAuthenticatorsRequest) - ) - - return try await call { try await underlyingClient.GetAuthenticators(input) } - - } - public func getOauthProviders(organizationId: String, userId: String?) async throws - -> Operations.GetOauthProviders.Output.Ok - { - - // Create the GetOauthProvidersRequest - let getOauthProvidersRequest = Components.Schemas.GetOauthProvidersRequest( - organizationId: organizationId, userId: userId - ) - - let input = Operations.GetOauthProviders.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getOauthProvidersRequest) - ) - - return try await call { try await underlyingClient.GetOauthProviders(input) } - - } - public func getOrganizationConfigs(organizationId: String) async throws - -> Operations.GetOrganizationConfigs.Output.Ok - { - - // Create the GetOrganizationConfigsRequest - let getOrganizationConfigsRequest = Components.Schemas.GetOrganizationConfigsRequest( - organizationId: organizationId - ) - - let input = Operations.GetOrganizationConfigs.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getOrganizationConfigsRequest) - ) - - return try await call { try await underlyingClient.GetOrganizationConfigs(input) } - - } - public func getPolicy(organizationId: String, policyId: String) async throws - -> Operations.GetPolicy.Output.Ok - { - - // Create the GetPolicyRequest - let getPolicyRequest = Components.Schemas.GetPolicyRequest( - organizationId: organizationId, policyId: policyId - ) - - let input = Operations.GetPolicy.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getPolicyRequest) - ) - - return try await call { try await underlyingClient.GetPolicy(input) } - - } - public func getPrivateKey(organizationId: String, privateKeyId: String) async throws - -> Operations.GetPrivateKey.Output.Ok - { - - // Create the GetPrivateKeyRequest - let getPrivateKeyRequest = Components.Schemas.GetPrivateKeyRequest( - organizationId: organizationId, privateKeyId: privateKeyId - ) - - let input = Operations.GetPrivateKey.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getPrivateKeyRequest) - ) - - return try await call { try await underlyingClient.GetPrivateKey(input) } - - } - public func getUser(organizationId: String, userId: String) async throws - -> Operations.GetUser.Output.Ok - { - - // Create the GetUserRequest - let getUserRequest = Components.Schemas.GetUserRequest( - organizationId: organizationId, userId: userId - ) - - let input = Operations.GetUser.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getUserRequest) - ) - - return try await call { try await underlyingClient.GetUser(input) } - - } - public func getWallet(organizationId: String, walletId: String) async throws - -> Operations.GetWallet.Output.Ok - { - - // Create the GetWalletRequest - let getWalletRequest = Components.Schemas.GetWalletRequest( - organizationId: organizationId, walletId: walletId - ) - - let input = Operations.GetWallet.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getWalletRequest) - ) - - return try await call { try await underlyingClient.GetWallet(input) } - - } - public func getWalletAccount( - organizationId: String, walletId: String, address: String?, path: String? - ) async throws -> Operations.GetWalletAccount.Output.Ok { - - // Create the GetWalletAccountRequest - let getWalletAccountRequest = Components.Schemas.GetWalletAccountRequest( - organizationId: organizationId, walletId: walletId, address: address, path: path - ) - - let input = Operations.GetWalletAccount.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getWalletAccountRequest) - ) - - return try await call { try await underlyingClient.GetWalletAccount(input) } - - } - public func getActivities( - organizationId: String, filterByStatus: [Components.Schemas.ActivityStatus]?, - paginationOptions: Components.Schemas.Pagination?, - filterByType: [Components.Schemas.ActivityType]? - ) async throws -> Operations.GetActivities.Output.Ok { - - // Create the GetActivitiesRequest - let getActivitiesRequest = Components.Schemas.GetActivitiesRequest( - organizationId: organizationId, filterByStatus: filterByStatus, - paginationOptions: paginationOptions, filterByType: filterByType - ) - - let input = Operations.GetActivities.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getActivitiesRequest) - ) - - return try await call { try await underlyingClient.GetActivities(input) } - - } - public func getPolicies(organizationId: String) async throws -> Operations.GetPolicies.Output.Ok { - - // Create the GetPoliciesRequest - let getPoliciesRequest = Components.Schemas.GetPoliciesRequest( - organizationId: organizationId - ) - - let input = Operations.GetPolicies.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getPoliciesRequest) - ) - - return try await call { try await underlyingClient.GetPolicies(input) } - - } - public func listPrivateKeyTags(organizationId: String) async throws - -> Operations.ListPrivateKeyTags.Output.Ok - { - - // Create the ListPrivateKeyTagsRequest - let listPrivateKeyTagsRequest = Components.Schemas.ListPrivateKeyTagsRequest( - organizationId: organizationId - ) - - let input = Operations.ListPrivateKeyTags.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(listPrivateKeyTagsRequest) - ) - - return try await call { try await underlyingClient.ListPrivateKeyTags(input) } - - } - public func getPrivateKeys(organizationId: String) async throws - -> Operations.GetPrivateKeys.Output.Ok - { - - // Create the GetPrivateKeysRequest - let getPrivateKeysRequest = Components.Schemas.GetPrivateKeysRequest( - organizationId: organizationId - ) - - let input = Operations.GetPrivateKeys.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getPrivateKeysRequest) - ) - - return try await call { try await underlyingClient.GetPrivateKeys(input) } - - } - public func getSubOrgIds( - organizationId: String, filterType: String?, filterValue: String?, - paginationOptions: Components.Schemas.Pagination? - ) async throws -> Operations.GetSubOrgIds.Output.Ok { - - // Create the GetSubOrgIdsRequest - let getSubOrgIdsRequest = Components.Schemas.GetSubOrgIdsRequest( - organizationId: organizationId, filterType: filterType, filterValue: filterValue, - paginationOptions: paginationOptions - ) - - let input = Operations.GetSubOrgIds.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getSubOrgIdsRequest) - ) - - return try await call { try await underlyingClient.GetSubOrgIds(input) } - - } - public func listUserTags(organizationId: String) async throws -> Operations.ListUserTags.Output.Ok - { - - // Create the ListUserTagsRequest - let listUserTagsRequest = Components.Schemas.ListUserTagsRequest( - organizationId: organizationId - ) +import TurnkeyStamper +import TurnkeyTypes - let input = Operations.ListUserTags.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(listUserTagsRequest) - ) - - return try await call { try await underlyingClient.ListUserTags(input) } - - } - public func getUsers(organizationId: String) async throws -> Operations.GetUsers.Output.Ok { - - // Create the GetUsersRequest - let getUsersRequest = Components.Schemas.GetUsersRequest( - organizationId: organizationId - ) - - let input = Operations.GetUsers.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getUsersRequest) - ) - - return try await call { try await underlyingClient.GetUsers(input) } - - } - public func getVerifiedSubOrgIds( - organizationId: String, filterType: String?, filterValue: String?, - paginationOptions: Components.Schemas.Pagination? - ) async throws -> Operations.GetVerifiedSubOrgIds.Output.Ok { - - // Create the GetVerifiedSubOrgIdsRequest - let getVerifiedSubOrgIdsRequest = Components.Schemas.GetVerifiedSubOrgIdsRequest( - organizationId: organizationId, filterType: filterType, filterValue: filterValue, - paginationOptions: paginationOptions - ) - - let input = Operations.GetVerifiedSubOrgIds.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getVerifiedSubOrgIdsRequest) - ) - - return try await call { try await underlyingClient.GetVerifiedSubOrgIds(input) } - - } - public func getWalletAccounts( - organizationId: String, walletId: String, paginationOptions: Components.Schemas.Pagination? - ) async throws -> Operations.GetWalletAccounts.Output.Ok { - - // Create the GetWalletAccountsRequest - let getWalletAccountsRequest = Components.Schemas.GetWalletAccountsRequest( - organizationId: organizationId, walletId: walletId, paginationOptions: paginationOptions - ) - - let input = Operations.GetWalletAccounts.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getWalletAccountsRequest) - ) - - return try await call { try await underlyingClient.GetWalletAccounts(input) } - - } - public func getWallets(organizationId: String) async throws -> Operations.GetWallets.Output.Ok { - - // Create the GetWalletsRequest - let getWalletsRequest = Components.Schemas.GetWalletsRequest( - organizationId: organizationId - ) - - let input = Operations.GetWallets.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getWalletsRequest) - ) - - return try await call { try await underlyingClient.GetWallets(input) } - - } - public func getWhoami(organizationId: String) async throws -> Operations.GetWhoami.Output.Ok { - - // Create the GetWhoamiRequest - let getWhoamiRequest = Components.Schemas.GetWhoamiRequest( - organizationId: organizationId - ) - - let input = Operations.GetWhoami.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(getWhoamiRequest) - ) - - return try await call { try await underlyingClient.GetWhoami(input) } - - } - - public func approveActivity( - organizationId: String, - fingerprint: String - ) async throws -> Operations.ApproveActivity.Output.Ok { - - // Create the ApproveActivityIntent - let approveActivityIntent = Components.Schemas.ApproveActivityIntent( - fingerprint: fingerprint) - - // Create the ApproveActivityRequest - let approveActivityRequest = Components.Schemas.ApproveActivityRequest( - _type: .ACTIVITY_TYPE_APPROVE_ACTIVITY, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: approveActivityIntent - ) - - // Create the input for the ApproveActivity method - let input = Operations.ApproveActivity.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(approveActivityRequest) - ) - - // Call the ApproveActivity method using the underlyingClient - return try await call { try await underlyingClient.ApproveActivity(input) } - } - - public func createApiKeys( - organizationId: String, - apiKeys: [Components.Schemas.ApiKeyParamsV2], userId: String - ) async throws -> Operations.CreateApiKeys.Output.Ok { - - // Create the CreateApiKeysIntentV2 - let createApiKeysIntent = Components.Schemas.CreateApiKeysIntentV2( - apiKeys: apiKeys, userId: userId) - - // Create the CreateApiKeysRequest - let createApiKeysRequest = Components.Schemas.CreateApiKeysRequest( - _type: .ACTIVITY_TYPE_CREATE_API_KEYS_V2, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createApiKeysIntent - ) - - // Create the input for the CreateApiKeys method - let input = Operations.CreateApiKeys.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createApiKeysRequest) - ) - - // Call the CreateApiKeys method using the underlyingClient - return try await call { try await underlyingClient.CreateApiKeys(input) } - } - - public func createAuthenticators( - organizationId: String, - authenticators: [Components.Schemas.AuthenticatorParamsV2], userId: String - ) async throws -> Operations.CreateAuthenticators.Output.Ok { - - // Create the CreateAuthenticatorsIntentV2 - let createAuthenticatorsIntent = Components.Schemas.CreateAuthenticatorsIntentV2( - authenticators: authenticators, userId: userId) - - // Create the CreateAuthenticatorsRequest - let createAuthenticatorsRequest = Components.Schemas.CreateAuthenticatorsRequest( - _type: .ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createAuthenticatorsIntent - ) - - // Create the input for the CreateAuthenticators method - let input = Operations.CreateAuthenticators.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createAuthenticatorsRequest) - ) - - // Call the CreateAuthenticators method using the underlyingClient - return try await call { try await underlyingClient.CreateAuthenticators(input) } - } - - public func createInvitations( - organizationId: String, - invitations: [Components.Schemas.InvitationParams] - ) async throws -> Operations.CreateInvitations.Output.Ok { +/// Configuration for activity polling +public struct ActivityPollerConfig { + /// Interval between poll attempts in milliseconds + public let intervalMs: Int + /// Maximum number of retry attempts + public let numRetries: Int - // Create the CreateInvitationsIntent - let createInvitationsIntent = Components.Schemas.CreateInvitationsIntent( - invitations: invitations) - - // Create the CreateInvitationsRequest - let createInvitationsRequest = Components.Schemas.CreateInvitationsRequest( - _type: .ACTIVITY_TYPE_CREATE_INVITATIONS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createInvitationsIntent - ) - - // Create the input for the CreateInvitations method - let input = Operations.CreateInvitations.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createInvitationsRequest) - ) - - // Call the CreateInvitations method using the underlyingClient - return try await call { try await underlyingClient.CreateInvitations(input) } - } - - public func createOauthProviders( - organizationId: String, - userId: String, oauthProviders: [Components.Schemas.OauthProviderParams] - ) async throws -> Operations.CreateOauthProviders.Output.Ok { - - // Create the CreateOauthProvidersIntent - let createOauthProvidersIntent = Components.Schemas.CreateOauthProvidersIntent( - userId: userId, oauthProviders: oauthProviders) - - // Create the CreateOauthProvidersRequest - let createOauthProvidersRequest = Components.Schemas.CreateOauthProvidersRequest( - _type: .ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createOauthProvidersIntent - ) - - // Create the input for the CreateOauthProviders method - let input = Operations.CreateOauthProviders.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createOauthProvidersRequest) - ) - - // Call the CreateOauthProviders method using the underlyingClient - return try await call { try await underlyingClient.CreateOauthProviders(input) } - } - - public func createPolicies( - organizationId: String, - policies: [Components.Schemas.CreatePolicyIntentV3] - ) async throws -> Operations.CreatePolicies.Output.Ok { - - // Create the CreatePoliciesIntent - let createPoliciesIntent = Components.Schemas.CreatePoliciesIntent( - policies: policies) - - // Create the CreatePoliciesRequest - let createPoliciesRequest = Components.Schemas.CreatePoliciesRequest( - _type: .ACTIVITY_TYPE_CREATE_POLICIES, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createPoliciesIntent - ) - - // Create the input for the CreatePolicies method - let input = Operations.CreatePolicies.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createPoliciesRequest) - ) - - // Call the CreatePolicies method using the underlyingClient - return try await call { try await underlyingClient.CreatePolicies(input) } - } - - public func createPolicy( - organizationId: String, - policyName: String, effect: Components.Schemas.Effect, condition: String?, consensus: String?, - notes: String? - ) async throws -> Operations.CreatePolicy.Output.Ok { - - // Create the CreatePolicyIntentV3 - let createPolicyIntent = Components.Schemas.CreatePolicyIntentV3( - policyName: policyName, effect: effect, condition: condition, consensus: consensus, - notes: notes) - - // Create the CreatePolicyRequest - let createPolicyRequest = Components.Schemas.CreatePolicyRequest( - _type: .ACTIVITY_TYPE_CREATE_POLICY_V3, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createPolicyIntent - ) - - // Create the input for the CreatePolicy method - let input = Operations.CreatePolicy.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createPolicyRequest) - ) - - // Call the CreatePolicy method using the underlyingClient - return try await call { try await underlyingClient.CreatePolicy(input) } - } - - public func createPrivateKeyTag( - organizationId: String, - privateKeyTagName: String, privateKeyIds: [String] - ) async throws -> Operations.CreatePrivateKeyTag.Output.Ok { - - // Create the CreatePrivateKeyTagIntent - let createPrivateKeyTagIntent = Components.Schemas.CreatePrivateKeyTagIntent( - privateKeyTagName: privateKeyTagName, privateKeyIds: privateKeyIds) - - // Create the CreatePrivateKeyTagRequest - let createPrivateKeyTagRequest = Components.Schemas.CreatePrivateKeyTagRequest( - _type: .ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createPrivateKeyTagIntent - ) - - // Create the input for the CreatePrivateKeyTag method - let input = Operations.CreatePrivateKeyTag.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createPrivateKeyTagRequest) - ) - - // Call the CreatePrivateKeyTag method using the underlyingClient - return try await call { try await underlyingClient.CreatePrivateKeyTag(input) } - } - - public func createPrivateKeys( - organizationId: String, - privateKeys: [Components.Schemas.PrivateKeyParams] - ) async throws -> Operations.CreatePrivateKeys.Output.Ok { - - // Create the CreatePrivateKeysIntentV2 - let createPrivateKeysIntent = Components.Schemas.CreatePrivateKeysIntentV2( - privateKeys: privateKeys) - - // Create the CreatePrivateKeysRequest - let createPrivateKeysRequest = Components.Schemas.CreatePrivateKeysRequest( - _type: .ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createPrivateKeysIntent - ) - - // Create the input for the CreatePrivateKeys method - let input = Operations.CreatePrivateKeys.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createPrivateKeysRequest) - ) - - // Call the CreatePrivateKeys method using the underlyingClient - return try await call { try await underlyingClient.CreatePrivateKeys(input) } - } - - public func createReadOnlySession( - organizationId: String - ) async throws -> Operations.CreateReadOnlySession.Output.Ok { - - // Create the CreateReadOnlySessionIntent - let createReadOnlySessionIntent = Components.Schemas.CreateReadOnlySessionIntent() - - // Create the CreateReadOnlySessionRequest - let createReadOnlySessionRequest = Components.Schemas.CreateReadOnlySessionRequest( - _type: .ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createReadOnlySessionIntent - ) - - // Create the input for the CreateReadOnlySession method - let input = Operations.CreateReadOnlySession.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createReadOnlySessionRequest) - ) - - // Call the CreateReadOnlySession method using the underlyingClient - return try await call { try await underlyingClient.CreateReadOnlySession(input) } + public init(intervalMs: Int = 1000, numRetries: Int = 3) { + self.intervalMs = intervalMs + self.numRetries = numRetries } +} - public func createReadWriteSession( - organizationId: String, - targetPublicKey: String, userId: String?, apiKeyName: String?, expirationSeconds: String?, - invalidateExisting: Bool? - ) async throws -> Operations.CreateReadWriteSession.Output.Ok { - - // Create the CreateReadWriteSessionIntentV2 - let createReadWriteSessionIntent = Components.Schemas.CreateReadWriteSessionIntentV2( - targetPublicKey: targetPublicKey, userId: userId, apiKeyName: apiKeyName, - expirationSeconds: expirationSeconds, invalidateExisting: invalidateExisting) - - // Create the CreateReadWriteSessionRequest - let createReadWriteSessionRequest = Components.Schemas.CreateReadWriteSessionRequest( - _type: .ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createReadWriteSessionIntent - ) - - // Create the input for the CreateReadWriteSession method - let input = Operations.CreateReadWriteSession.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createReadWriteSessionRequest) +public struct TurnkeyClient { + public static let baseURLString = "https://api.turnkey.com" + public static let authProxyBaseURLString = "https://authproxy.turnkey.com" + + // Configuration + internal let baseUrl: String + internal let authProxyUrl: String? + internal let authProxyConfigId: String? + internal let stamper: Stamper? + internal let activityPoller: ActivityPollerConfig + + internal init( + baseUrl: String = TurnkeyClient.baseURLString, + authProxyUrl: String? = nil, + authProxyConfigId: String? = nil, + stamper: Stamper? = nil, + activityPoller: ActivityPollerConfig = ActivityPollerConfig() + ) { + self.baseUrl = baseUrl + self.authProxyUrl = authProxyUrl + self.authProxyConfigId = authProxyConfigId + self.stamper = stamper + self.activityPoller = activityPoller + } + + /// Initializes a `TurnkeyClient` with an API key pair for stamping requests. + /// + /// - Parameters: + /// - apiPrivateKey: The hex-encoded API private key. + /// - apiPublicKey: The hex-encoded API public key. + /// - baseUrl: Optional base URL (defaults to Turnkey production). + /// - activityPoller: Optional activity polling configuration. + public init( + apiPrivateKey: String, + apiPublicKey: String, + baseUrl: String = TurnkeyClient.baseURLString, + activityPoller: ActivityPollerConfig = ActivityPollerConfig() + ) { + let stamper = Stamper(apiPublicKey: apiPublicKey, apiPrivateKey: apiPrivateKey) + self.init( + baseUrl: baseUrl, + stamper: stamper, + activityPoller: activityPoller + ) + } + + /// Initializes a `TurnkeyClient` using an API public key whose private key is stored on-device. + /// + /// This selects Secure Enclave if available, otherwise Secure Storage. It validates that the + /// private key corresponding to `apiPublicKey` is already present in the selected backend. + /// + /// - Parameters: + /// - apiPublicKey: The hex-encoded API public key (compressed) whose private key is stored on-device. + /// - baseUrl: Optional base URL (defaults to Turnkey production). + /// - activityPoller: Optional activity polling configuration. + public init( + apiPublicKey: String, + baseUrl: String = TurnkeyClient.baseURLString, + activityPoller: ActivityPollerConfig = ActivityPollerConfig() + ) throws { + let stamper = try Stamper(apiPublicKey: apiPublicKey) + self.init( + baseUrl: baseUrl, + stamper: stamper, + activityPoller: activityPoller + ) + } + + /// Initializes a `TurnkeyClient` with passkey authentication for stamping requests. + /// + /// - Parameters: + /// - rpId: The Relying Party ID (must match your app's associated domain config). + /// - presentationAnchor: The window or view used to present authentication prompts. + /// - baseUrl: Optional base URL (defaults to Turnkey production). + public init( + rpId: String, + presentationAnchor: ASPresentationAnchor, + baseUrl: String = TurnkeyClient.baseURLString + ) { + let stamper = Stamper(rpId: rpId, presentationAnchor: presentationAnchor) + self.init( + baseUrl: baseUrl, + stamper: stamper + ) + } + + /// Initializes a `TurnkeyClient` with Auth Proxy only. + /// + /// - Parameters: + /// - authProxyConfigId: The Auth Proxy config ID to include in requests. + /// - authProxyUrl: Optional Auth Proxy URL (defaults to Turnkey production). + public init( + authProxyConfigId: String, + authProxyUrl: String = TurnkeyClient.authProxyBaseURLString + ) { + self.init( + authProxyUrl: authProxyUrl, + authProxyConfigId: authProxyConfigId, + stamper: nil + ) + } + + /// Initializes a `TurnkeyClient` with both API key authentication and Auth Proxy. + /// + /// - Parameters: + /// - apiPrivateKey: The hex-encoded API private key. + /// - apiPublicKey: The hex-encoded API public key. + /// - authProxyConfigId: The Auth Proxy config ID to include in requests. + /// - baseUrl: Optional base URL (defaults to Turnkey production). + /// - authProxyUrl: Optional Auth Proxy URL (defaults to Turnkey production). + public init( + apiPrivateKey: String, + apiPublicKey: String, + authProxyConfigId: String, + baseUrl: String = TurnkeyClient.baseURLString, + authProxyUrl: String = TurnkeyClient.authProxyBaseURLString + ) { + let stamper = Stamper(apiPublicKey: apiPublicKey, apiPrivateKey: apiPrivateKey) + self.init( + baseUrl: baseUrl, + authProxyUrl: authProxyUrl, + authProxyConfigId: authProxyConfigId, + stamper: stamper + ) + } + + /// Initializes a `TurnkeyClient` with on-device private key (by public key) and Auth Proxy. + /// + /// This selects Secure Enclave if available, otherwise Secure Storage. It validates that the + /// private key corresponding to `apiPublicKey` is already present in the selected backend. + /// + /// - Parameters: + /// - apiPublicKey: The hex-encoded API public key (compressed) whose private key is stored on-device. + /// - authProxyConfigId: The Auth Proxy config ID to include in requests. + /// - baseUrl: Optional base URL (defaults to Turnkey production). + /// - authProxyUrl: Optional Auth Proxy URL (defaults to Turnkey production). + public init( + apiPublicKey: String, + authProxyConfigId: String, + baseUrl: String = TurnkeyClient.baseURLString, + authProxyUrl: String = TurnkeyClient.authProxyBaseURLString + ) throws { + let stamper = try Stamper(apiPublicKey: apiPublicKey) + self.init( + baseUrl: baseUrl, + authProxyUrl: authProxyUrl, + authProxyConfigId: authProxyConfigId, + stamper: stamper + ) + } + + /// Initializes a `TurnkeyClient` with both passkey authentication and Auth Proxy. + /// + /// - Parameters: + /// - rpId: The Relying Party ID (must match your app's associated domain config). + /// - presentationAnchor: The window or view used to present authentication prompts. + /// - authProxyConfigId: The Auth Proxy config ID to include in requests. + /// - baseUrl: Optional base URL (defaults to Turnkey production). + /// - authProxyUrl: Optional Auth Proxy URL (defaults to Turnkey production). + public init( + rpId: String, + presentationAnchor: ASPresentationAnchor, + authProxyConfigId: String, + baseUrl: String = TurnkeyClient.baseURLString, + authProxyUrl: String = TurnkeyClient.authProxyBaseURLString + ) { + let stamper = Stamper(rpId: rpId, presentationAnchor: presentationAnchor) + self.init( + baseUrl: baseUrl, + authProxyUrl: authProxyUrl, + authProxyConfigId: authProxyConfigId, + stamper: stamper ) - - // Call the CreateReadWriteSession method using the underlyingClient - return try await call { try await underlyingClient.CreateReadWriteSession(input) } - } - - public func createSubOrganization( - organizationId: String, - subOrganizationName: String, rootUsers: [Components.Schemas.RootUserParamsV4], - rootQuorumThreshold: Int32, wallet: Components.Schemas.WalletParams?, - disableEmailRecovery: Bool?, disableEmailAuth: Bool?, disableSmsAuth: Bool?, - disableOtpEmailAuth: Bool? - ) async throws -> Operations.CreateSubOrganization.Output.Ok { - - // Create the CreateSubOrganizationIntentV7 - let createSubOrganizationIntent = Components.Schemas.CreateSubOrganizationIntentV7( - subOrganizationName: subOrganizationName, rootUsers: rootUsers, - rootQuorumThreshold: rootQuorumThreshold, wallet: wallet, - disableEmailRecovery: disableEmailRecovery, disableEmailAuth: disableEmailAuth, - disableSmsAuth: disableSmsAuth, disableOtpEmailAuth: disableOtpEmailAuth) - - // Create the CreateSubOrganizationRequest - let createSubOrganizationRequest = Components.Schemas.CreateSubOrganizationRequest( - _type: .ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createSubOrganizationIntent - ) - - // Create the input for the CreateSubOrganization method - let input = Operations.CreateSubOrganization.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createSubOrganizationRequest) - ) - - // Call the CreateSubOrganization method using the underlyingClient - return try await call { try await underlyingClient.CreateSubOrganization(input) } - } - - public func createUserTag( - organizationId: String, - userTagName: String, userIds: [String] - ) async throws -> Operations.CreateUserTag.Output.Ok { - - // Create the CreateUserTagIntent - let createUserTagIntent = Components.Schemas.CreateUserTagIntent( - userTagName: userTagName, userIds: userIds) - - // Create the CreateUserTagRequest - let createUserTagRequest = Components.Schemas.CreateUserTagRequest( - _type: .ACTIVITY_TYPE_CREATE_USER_TAG, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createUserTagIntent - ) - - // Create the input for the CreateUserTag method - let input = Operations.CreateUserTag.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createUserTagRequest) - ) - - // Call the CreateUserTag method using the underlyingClient - return try await call { try await underlyingClient.CreateUserTag(input) } - } - - public func createUsers( - organizationId: String, - users: [Components.Schemas.UserParamsV3] - ) async throws -> Operations.CreateUsers.Output.Ok { - - // Create the CreateUsersIntentV3 - let createUsersIntent = Components.Schemas.CreateUsersIntentV3( - users: users) - - // Create the CreateUsersRequest - let createUsersRequest = Components.Schemas.CreateUsersRequest( - _type: .ACTIVITY_TYPE_CREATE_USERS_V3, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createUsersIntent - ) - - // Create the input for the CreateUsers method - let input = Operations.CreateUsers.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createUsersRequest) - ) - - // Call the CreateUsers method using the underlyingClient - return try await call { try await underlyingClient.CreateUsers(input) } - } - - public func createWallet( - organizationId: String, - walletName: String, accounts: [Components.Schemas.WalletAccountParams], mnemonicLength: Int32? - ) async throws -> Operations.CreateWallet.Output.Ok { - - // Create the CreateWalletIntent - let createWalletIntent = Components.Schemas.CreateWalletIntent( - walletName: walletName, accounts: accounts, mnemonicLength: mnemonicLength) - - // Create the CreateWalletRequest - let createWalletRequest = Components.Schemas.CreateWalletRequest( - _type: .ACTIVITY_TYPE_CREATE_WALLET, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createWalletIntent - ) - - // Create the input for the CreateWallet method - let input = Operations.CreateWallet.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createWalletRequest) - ) - - // Call the CreateWallet method using the underlyingClient - return try await call { try await underlyingClient.CreateWallet(input) } - } - - public func createWalletAccounts( - organizationId: String, - walletId: String, accounts: [Components.Schemas.WalletAccountParams] - ) async throws -> Operations.CreateWalletAccounts.Output.Ok { - - // Create the CreateWalletAccountsIntent - let createWalletAccountsIntent = Components.Schemas.CreateWalletAccountsIntent( - walletId: walletId, accounts: accounts) - - // Create the CreateWalletAccountsRequest - let createWalletAccountsRequest = Components.Schemas.CreateWalletAccountsRequest( - _type: .ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: createWalletAccountsIntent - ) - - // Create the input for the CreateWalletAccounts method - let input = Operations.CreateWalletAccounts.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(createWalletAccountsRequest) - ) - - // Call the CreateWalletAccounts method using the underlyingClient - return try await call { try await underlyingClient.CreateWalletAccounts(input) } - } - - public func deleteApiKeys( - organizationId: String, - userId: String, apiKeyIds: [String] - ) async throws -> Operations.DeleteApiKeys.Output.Ok { - - // Create the DeleteApiKeysIntent - let deleteApiKeysIntent = Components.Schemas.DeleteApiKeysIntent( - userId: userId, apiKeyIds: apiKeyIds) - - // Create the DeleteApiKeysRequest - let deleteApiKeysRequest = Components.Schemas.DeleteApiKeysRequest( - _type: .ACTIVITY_TYPE_DELETE_API_KEYS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: deleteApiKeysIntent - ) - - // Create the input for the DeleteApiKeys method - let input = Operations.DeleteApiKeys.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(deleteApiKeysRequest) - ) - - // Call the DeleteApiKeys method using the underlyingClient - return try await call { try await underlyingClient.DeleteApiKeys(input) } - } - - public func deleteAuthenticators( - organizationId: String, - userId: String, authenticatorIds: [String] - ) async throws -> Operations.DeleteAuthenticators.Output.Ok { - - // Create the DeleteAuthenticatorsIntent - let deleteAuthenticatorsIntent = Components.Schemas.DeleteAuthenticatorsIntent( - userId: userId, authenticatorIds: authenticatorIds) - - // Create the DeleteAuthenticatorsRequest - let deleteAuthenticatorsRequest = Components.Schemas.DeleteAuthenticatorsRequest( - _type: .ACTIVITY_TYPE_DELETE_AUTHENTICATORS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: deleteAuthenticatorsIntent - ) - - // Create the input for the DeleteAuthenticators method - let input = Operations.DeleteAuthenticators.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(deleteAuthenticatorsRequest) - ) - - // Call the DeleteAuthenticators method using the underlyingClient - return try await call { try await underlyingClient.DeleteAuthenticators(input) } - } - - public func deleteInvitation( - organizationId: String, - invitationId: String - ) async throws -> Operations.DeleteInvitation.Output.Ok { - - // Create the DeleteInvitationIntent - let deleteInvitationIntent = Components.Schemas.DeleteInvitationIntent( - invitationId: invitationId) - - // Create the DeleteInvitationRequest - let deleteInvitationRequest = Components.Schemas.DeleteInvitationRequest( - _type: .ACTIVITY_TYPE_DELETE_INVITATION, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: deleteInvitationIntent - ) - - // Create the input for the DeleteInvitation method - let input = Operations.DeleteInvitation.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(deleteInvitationRequest) - ) - - // Call the DeleteInvitation method using the underlyingClient - return try await call { try await underlyingClient.DeleteInvitation(input) } - } - - public func deleteOauthProviders( - organizationId: String, - userId: String, providerIds: [String] - ) async throws -> Operations.DeleteOauthProviders.Output.Ok { - - // Create the DeleteOauthProvidersIntent - let deleteOauthProvidersIntent = Components.Schemas.DeleteOauthProvidersIntent( - userId: userId, providerIds: providerIds) - - // Create the DeleteOauthProvidersRequest - let deleteOauthProvidersRequest = Components.Schemas.DeleteOauthProvidersRequest( - _type: .ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: deleteOauthProvidersIntent - ) - - // Create the input for the DeleteOauthProviders method - let input = Operations.DeleteOauthProviders.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(deleteOauthProvidersRequest) - ) - - // Call the DeleteOauthProviders method using the underlyingClient - return try await call { try await underlyingClient.DeleteOauthProviders(input) } - } - - public func deletePolicy( - organizationId: String, - policyId: String - ) async throws -> Operations.DeletePolicy.Output.Ok { - - // Create the DeletePolicyIntent - let deletePolicyIntent = Components.Schemas.DeletePolicyIntent( - policyId: policyId) - - // Create the DeletePolicyRequest - let deletePolicyRequest = Components.Schemas.DeletePolicyRequest( - _type: .ACTIVITY_TYPE_DELETE_POLICY, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: deletePolicyIntent - ) - - // Create the input for the DeletePolicy method - let input = Operations.DeletePolicy.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(deletePolicyRequest) - ) - - // Call the DeletePolicy method using the underlyingClient - return try await call { try await underlyingClient.DeletePolicy(input) } - } - - public func deletePrivateKeyTags( - organizationId: String, - privateKeyTagIds: [String] - ) async throws -> Operations.DeletePrivateKeyTags.Output.Ok { - - // Create the DeletePrivateKeyTagsIntent - let deletePrivateKeyTagsIntent = Components.Schemas.DeletePrivateKeyTagsIntent( - privateKeyTagIds: privateKeyTagIds) - - // Create the DeletePrivateKeyTagsRequest - let deletePrivateKeyTagsRequest = Components.Schemas.DeletePrivateKeyTagsRequest( - _type: .ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: deletePrivateKeyTagsIntent - ) - - // Create the input for the DeletePrivateKeyTags method - let input = Operations.DeletePrivateKeyTags.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(deletePrivateKeyTagsRequest) - ) - - // Call the DeletePrivateKeyTags method using the underlyingClient - return try await call { try await underlyingClient.DeletePrivateKeyTags(input) } - } - - public func deletePrivateKeys( - organizationId: String, - privateKeyIds: [String], deleteWithoutExport: Bool? - ) async throws -> Operations.DeletePrivateKeys.Output.Ok { - - // Create the DeletePrivateKeysIntent - let deletePrivateKeysIntent = Components.Schemas.DeletePrivateKeysIntent( - privateKeyIds: privateKeyIds, deleteWithoutExport: deleteWithoutExport) - - // Create the DeletePrivateKeysRequest - let deletePrivateKeysRequest = Components.Schemas.DeletePrivateKeysRequest( - _type: .ACTIVITY_TYPE_DELETE_PRIVATE_KEYS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: deletePrivateKeysIntent - ) - - // Create the input for the DeletePrivateKeys method - let input = Operations.DeletePrivateKeys.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(deletePrivateKeysRequest) - ) - - // Call the DeletePrivateKeys method using the underlyingClient - return try await call { try await underlyingClient.DeletePrivateKeys(input) } - } - - public func deleteSubOrganization( - organizationId: String, - deleteWithoutExport: Bool? - ) async throws -> Operations.DeleteSubOrganization.Output.Ok { - - // Create the DeleteSubOrganizationIntent - let deleteSubOrganizationIntent = Components.Schemas.DeleteSubOrganizationIntent( - deleteWithoutExport: deleteWithoutExport) - - // Create the DeleteSubOrganizationRequest - let deleteSubOrganizationRequest = Components.Schemas.DeleteSubOrganizationRequest( - _type: .ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: deleteSubOrganizationIntent - ) - - // Create the input for the DeleteSubOrganization method - let input = Operations.DeleteSubOrganization.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(deleteSubOrganizationRequest) - ) - - // Call the DeleteSubOrganization method using the underlyingClient - return try await call { try await underlyingClient.DeleteSubOrganization(input) } - } - - public func deleteUserTags( - organizationId: String, - userTagIds: [String] - ) async throws -> Operations.DeleteUserTags.Output.Ok { - - // Create the DeleteUserTagsIntent - let deleteUserTagsIntent = Components.Schemas.DeleteUserTagsIntent( - userTagIds: userTagIds) - - // Create the DeleteUserTagsRequest - let deleteUserTagsRequest = Components.Schemas.DeleteUserTagsRequest( - _type: .ACTIVITY_TYPE_DELETE_USER_TAGS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: deleteUserTagsIntent - ) - - // Create the input for the DeleteUserTags method - let input = Operations.DeleteUserTags.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(deleteUserTagsRequest) - ) - - // Call the DeleteUserTags method using the underlyingClient - return try await call { try await underlyingClient.DeleteUserTags(input) } - } - - public func deleteUsers( - organizationId: String, - userIds: [String] - ) async throws -> Operations.DeleteUsers.Output.Ok { - - // Create the DeleteUsersIntent - let deleteUsersIntent = Components.Schemas.DeleteUsersIntent( - userIds: userIds) - - // Create the DeleteUsersRequest - let deleteUsersRequest = Components.Schemas.DeleteUsersRequest( - _type: .ACTIVITY_TYPE_DELETE_USERS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: deleteUsersIntent - ) - - // Create the input for the DeleteUsers method - let input = Operations.DeleteUsers.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(deleteUsersRequest) - ) - - // Call the DeleteUsers method using the underlyingClient - return try await call { try await underlyingClient.DeleteUsers(input) } - } - - public func deleteWallets( - organizationId: String, - walletIds: [String], deleteWithoutExport: Bool? - ) async throws -> Operations.DeleteWallets.Output.Ok { - - // Create the DeleteWalletsIntent - let deleteWalletsIntent = Components.Schemas.DeleteWalletsIntent( - walletIds: walletIds, deleteWithoutExport: deleteWithoutExport) - - // Create the DeleteWalletsRequest - let deleteWalletsRequest = Components.Schemas.DeleteWalletsRequest( - _type: .ACTIVITY_TYPE_DELETE_WALLETS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: deleteWalletsIntent - ) - - // Create the input for the DeleteWallets method - let input = Operations.DeleteWallets.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(deleteWalletsRequest) - ) - - // Call the DeleteWallets method using the underlyingClient - return try await call { try await underlyingClient.DeleteWallets(input) } - } - - public func emailAuth( - organizationId: String, - email: String, targetPublicKey: String, apiKeyName: String?, expirationSeconds: String?, - emailCustomization: Components.Schemas.EmailCustomizationParams?, invalidateExisting: Bool?, - sendFromEmailAddress: String?, sendFromEmailSenderName: String?, replyToEmailAddress: String? - ) async throws -> Operations.EmailAuth.Output.Ok { - - // Create the EmailAuthIntentV2 - let emailAuthIntent = Components.Schemas.EmailAuthIntentV2( - email: email, targetPublicKey: targetPublicKey, apiKeyName: apiKeyName, - expirationSeconds: expirationSeconds, emailCustomization: emailCustomization, - invalidateExisting: invalidateExisting, sendFromEmailAddress: sendFromEmailAddress, - sendFromEmailSenderName: sendFromEmailSenderName, replyToEmailAddress: replyToEmailAddress) - - // Create the EmailAuthRequest - let emailAuthRequest = Components.Schemas.EmailAuthRequest( - _type: .ACTIVITY_TYPE_EMAIL_AUTH_V2, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: emailAuthIntent - ) - - // Create the input for the EmailAuth method - let input = Operations.EmailAuth.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(emailAuthRequest) - ) - - // Call the EmailAuth method using the underlyingClient - return try await call { try await underlyingClient.EmailAuth(input) } - } - - public func exportPrivateKey( - organizationId: String, - privateKeyId: String, targetPublicKey: String - ) async throws -> Operations.ExportPrivateKey.Output.Ok { - - // Create the ExportPrivateKeyIntent - let exportPrivateKeyIntent = Components.Schemas.ExportPrivateKeyIntent( - privateKeyId: privateKeyId, targetPublicKey: targetPublicKey) - - // Create the ExportPrivateKeyRequest - let exportPrivateKeyRequest = Components.Schemas.ExportPrivateKeyRequest( - _type: .ACTIVITY_TYPE_EXPORT_PRIVATE_KEY, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: exportPrivateKeyIntent - ) - - // Create the input for the ExportPrivateKey method - let input = Operations.ExportPrivateKey.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(exportPrivateKeyRequest) - ) - - // Call the ExportPrivateKey method using the underlyingClient - return try await call { try await underlyingClient.ExportPrivateKey(input) } - } - - public func exportWallet( - organizationId: String, - walletId: String, targetPublicKey: String, language: Components.Schemas.MnemonicLanguage? - ) async throws -> Operations.ExportWallet.Output.Ok { - - // Create the ExportWalletIntent - let exportWalletIntent = Components.Schemas.ExportWalletIntent( - walletId: walletId, targetPublicKey: targetPublicKey, language: language) - - // Create the ExportWalletRequest - let exportWalletRequest = Components.Schemas.ExportWalletRequest( - _type: .ACTIVITY_TYPE_EXPORT_WALLET, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: exportWalletIntent - ) - - // Create the input for the ExportWallet method - let input = Operations.ExportWallet.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(exportWalletRequest) - ) - - // Call the ExportWallet method using the underlyingClient - return try await call { try await underlyingClient.ExportWallet(input) } - } - - public func exportWalletAccount( - organizationId: String, - address: String, targetPublicKey: String - ) async throws -> Operations.ExportWalletAccount.Output.Ok { - - // Create the ExportWalletAccountIntent - let exportWalletAccountIntent = Components.Schemas.ExportWalletAccountIntent( - address: address, targetPublicKey: targetPublicKey) - - // Create the ExportWalletAccountRequest - let exportWalletAccountRequest = Components.Schemas.ExportWalletAccountRequest( - _type: .ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: exportWalletAccountIntent - ) - - // Create the input for the ExportWalletAccount method - let input = Operations.ExportWalletAccount.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(exportWalletAccountRequest) - ) - - // Call the ExportWalletAccount method using the underlyingClient - return try await call { try await underlyingClient.ExportWalletAccount(input) } - } - - public func importPrivateKey( - organizationId: String, - userId: String, privateKeyName: String, encryptedBundle: String, - curve: Components.Schemas.Curve, addressFormats: [Components.Schemas.AddressFormat] - ) async throws -> Operations.ImportPrivateKey.Output.Ok { - - // Create the ImportPrivateKeyIntent - let importPrivateKeyIntent = Components.Schemas.ImportPrivateKeyIntent( - userId: userId, privateKeyName: privateKeyName, encryptedBundle: encryptedBundle, - curve: curve, addressFormats: addressFormats) - - // Create the ImportPrivateKeyRequest - let importPrivateKeyRequest = Components.Schemas.ImportPrivateKeyRequest( - _type: .ACTIVITY_TYPE_IMPORT_PRIVATE_KEY, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: importPrivateKeyIntent - ) - - // Create the input for the ImportPrivateKey method - let input = Operations.ImportPrivateKey.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(importPrivateKeyRequest) - ) - - // Call the ImportPrivateKey method using the underlyingClient - return try await call { try await underlyingClient.ImportPrivateKey(input) } - } - - public func importWallet( - organizationId: String, - userId: String, walletName: String, encryptedBundle: String, - accounts: [Components.Schemas.WalletAccountParams] - ) async throws -> Operations.ImportWallet.Output.Ok { - - // Create the ImportWalletIntent - let importWalletIntent = Components.Schemas.ImportWalletIntent( - userId: userId, walletName: walletName, encryptedBundle: encryptedBundle, accounts: accounts) - - // Create the ImportWalletRequest - let importWalletRequest = Components.Schemas.ImportWalletRequest( - _type: .ACTIVITY_TYPE_IMPORT_WALLET, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: importWalletIntent - ) - - // Create the input for the ImportWallet method - let input = Operations.ImportWallet.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(importWalletRequest) - ) - - // Call the ImportWallet method using the underlyingClient - return try await call { try await underlyingClient.ImportWallet(input) } - } - - public func initImportPrivateKey( - organizationId: String, - userId: String - ) async throws -> Operations.InitImportPrivateKey.Output.Ok { - - // Create the InitImportPrivateKeyIntent - let initImportPrivateKeyIntent = Components.Schemas.InitImportPrivateKeyIntent( - userId: userId) - - // Create the InitImportPrivateKeyRequest - let initImportPrivateKeyRequest = Components.Schemas.InitImportPrivateKeyRequest( - _type: .ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: initImportPrivateKeyIntent - ) - - // Create the input for the InitImportPrivateKey method - let input = Operations.InitImportPrivateKey.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(initImportPrivateKeyRequest) - ) - - // Call the InitImportPrivateKey method using the underlyingClient - return try await call { try await underlyingClient.InitImportPrivateKey(input) } - } - - public func initImportWallet( - organizationId: String, - userId: String - ) async throws -> Operations.InitImportWallet.Output.Ok { - - // Create the InitImportWalletIntent - let initImportWalletIntent = Components.Schemas.InitImportWalletIntent( - userId: userId) - - // Create the InitImportWalletRequest - let initImportWalletRequest = Components.Schemas.InitImportWalletRequest( - _type: .ACTIVITY_TYPE_INIT_IMPORT_WALLET, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: initImportWalletIntent - ) - - // Create the input for the InitImportWallet method - let input = Operations.InitImportWallet.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(initImportWalletRequest) - ) - - // Call the InitImportWallet method using the underlyingClient - return try await call { try await underlyingClient.InitImportWallet(input) } - } - - public func initOtp( - organizationId: String, - otpType: String, contact: String, otpLength: Int32?, - emailCustomization: Components.Schemas.EmailCustomizationParams?, - smsCustomization: Components.Schemas.SmsCustomizationParams?, userIdentifier: String?, - sendFromEmailAddress: String?, alphanumeric: Bool?, sendFromEmailSenderName: String?, - expirationSeconds: String?, replyToEmailAddress: String? - ) async throws -> Operations.InitOtp.Output.Ok { - - // Create the InitOtpIntent - let initOtpIntent = Components.Schemas.InitOtpIntent( - otpType: otpType, contact: contact, otpLength: otpLength, - emailCustomization: emailCustomization, smsCustomization: smsCustomization, - userIdentifier: userIdentifier, sendFromEmailAddress: sendFromEmailAddress, - alphanumeric: alphanumeric, sendFromEmailSenderName: sendFromEmailSenderName, - expirationSeconds: expirationSeconds, replyToEmailAddress: replyToEmailAddress) - - // Create the InitOtpRequest - let initOtpRequest = Components.Schemas.InitOtpRequest( - _type: .ACTIVITY_TYPE_INIT_OTP, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: initOtpIntent - ) - - // Create the input for the InitOtp method - let input = Operations.InitOtp.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(initOtpRequest) - ) - - // Call the InitOtp method using the underlyingClient - return try await call { try await underlyingClient.InitOtp(input) } - } - - public func initOtpAuth( - organizationId: String, - otpType: String, contact: String, otpLength: Int32?, - emailCustomization: Components.Schemas.EmailCustomizationParams?, - smsCustomization: Components.Schemas.SmsCustomizationParams?, userIdentifier: String?, - sendFromEmailAddress: String?, alphanumeric: Bool?, sendFromEmailSenderName: String?, - replyToEmailAddress: String? - ) async throws -> Operations.InitOtpAuth.Output.Ok { - - // Create the InitOtpAuthIntentV2 - let initOtpAuthIntent = Components.Schemas.InitOtpAuthIntentV2( - otpType: otpType, contact: contact, otpLength: otpLength, - emailCustomization: emailCustomization, smsCustomization: smsCustomization, - userIdentifier: userIdentifier, sendFromEmailAddress: sendFromEmailAddress, - alphanumeric: alphanumeric, sendFromEmailSenderName: sendFromEmailSenderName, - replyToEmailAddress: replyToEmailAddress) - - // Create the InitOtpAuthRequest - let initOtpAuthRequest = Components.Schemas.InitOtpAuthRequest( - _type: .ACTIVITY_TYPE_INIT_OTP_AUTH_V2, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: initOtpAuthIntent - ) - - // Create the input for the InitOtpAuth method - let input = Operations.InitOtpAuth.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(initOtpAuthRequest) - ) - - // Call the InitOtpAuth method using the underlyingClient - return try await call { try await underlyingClient.InitOtpAuth(input) } - } - - public func initUserEmailRecovery( - organizationId: String, - email: String, targetPublicKey: String, expirationSeconds: String?, - emailCustomization: Components.Schemas.EmailCustomizationParams? - ) async throws -> Operations.InitUserEmailRecovery.Output.Ok { - - // Create the InitUserEmailRecoveryIntent - let initUserEmailRecoveryIntent = Components.Schemas.InitUserEmailRecoveryIntent( - email: email, targetPublicKey: targetPublicKey, expirationSeconds: expirationSeconds, - emailCustomization: emailCustomization) - - // Create the InitUserEmailRecoveryRequest - let initUserEmailRecoveryRequest = Components.Schemas.InitUserEmailRecoveryRequest( - _type: .ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: initUserEmailRecoveryIntent - ) - - // Create the input for the InitUserEmailRecovery method - let input = Operations.InitUserEmailRecovery.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(initUserEmailRecoveryRequest) - ) - - // Call the InitUserEmailRecovery method using the underlyingClient - return try await call { try await underlyingClient.InitUserEmailRecovery(input) } - } - - public func oauth( - organizationId: String, - oidcToken: String, targetPublicKey: String, apiKeyName: String?, expirationSeconds: String?, - invalidateExisting: Bool? - ) async throws -> Operations.Oauth.Output.Ok { - - // Create the OauthIntent - let oauthIntent = Components.Schemas.OauthIntent( - oidcToken: oidcToken, targetPublicKey: targetPublicKey, apiKeyName: apiKeyName, - expirationSeconds: expirationSeconds, invalidateExisting: invalidateExisting) - - // Create the OauthRequest - let oauthRequest = Components.Schemas.OauthRequest( - _type: .ACTIVITY_TYPE_OAUTH, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: oauthIntent - ) - - // Create the input for the Oauth method - let input = Operations.Oauth.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(oauthRequest) - ) - - // Call the Oauth method using the underlyingClient - return try await call { try await underlyingClient.Oauth(input) } - } - - public func oauthLogin( - organizationId: String, - oidcToken: String, publicKey: String, expirationSeconds: String?, invalidateExisting: Bool? - ) async throws -> Operations.OauthLogin.Output.Ok { - - // Create the OauthLoginIntent - let oauthLoginIntent = Components.Schemas.OauthLoginIntent( - oidcToken: oidcToken, publicKey: publicKey, expirationSeconds: expirationSeconds, - invalidateExisting: invalidateExisting) - - // Create the OauthLoginRequest - let oauthLoginRequest = Components.Schemas.OauthLoginRequest( - _type: .ACTIVITY_TYPE_OAUTH_LOGIN, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: oauthLoginIntent - ) - - // Create the input for the OauthLogin method - let input = Operations.OauthLogin.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(oauthLoginRequest) - ) - - // Call the OauthLogin method using the underlyingClient - return try await call { try await underlyingClient.OauthLogin(input) } - } - - public func otpAuth( - organizationId: String, - otpId: String, otpCode: String, targetPublicKey: String, apiKeyName: String?, - expirationSeconds: String?, invalidateExisting: Bool? - ) async throws -> Operations.OtpAuth.Output.Ok { - - // Create the OtpAuthIntent - let otpAuthIntent = Components.Schemas.OtpAuthIntent( - otpId: otpId, otpCode: otpCode, targetPublicKey: targetPublicKey, apiKeyName: apiKeyName, - expirationSeconds: expirationSeconds, invalidateExisting: invalidateExisting) - - // Create the OtpAuthRequest - let otpAuthRequest = Components.Schemas.OtpAuthRequest( - _type: .ACTIVITY_TYPE_OTP_AUTH, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: otpAuthIntent - ) - - // Create the input for the OtpAuth method - let input = Operations.OtpAuth.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(otpAuthRequest) - ) - - // Call the OtpAuth method using the underlyingClient - return try await call { try await underlyingClient.OtpAuth(input) } - } - - public func otpLogin( - organizationId: String, - verificationToken: String, publicKey: String, expirationSeconds: String?, - invalidateExisting: Bool? - ) async throws -> Operations.OtpLogin.Output.Ok { - - // Create the OtpLoginIntent - let otpLoginIntent = Components.Schemas.OtpLoginIntent( - verificationToken: verificationToken, publicKey: publicKey, - expirationSeconds: expirationSeconds, invalidateExisting: invalidateExisting) - - // Create the OtpLoginRequest - let otpLoginRequest = Components.Schemas.OtpLoginRequest( - _type: .ACTIVITY_TYPE_OTP_LOGIN, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: otpLoginIntent - ) - - // Create the input for the OtpLogin method - let input = Operations.OtpLogin.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(otpLoginRequest) - ) - - // Call the OtpLogin method using the underlyingClient - return try await call { try await underlyingClient.OtpLogin(input) } - } - - public func recoverUser( - organizationId: String, - authenticator: Components.Schemas.AuthenticatorParamsV2, userId: String - ) async throws -> Operations.RecoverUser.Output.Ok { - - // Create the RecoverUserIntent - let recoverUserIntent = Components.Schemas.RecoverUserIntent( - authenticator: authenticator, userId: userId) - - // Create the RecoverUserRequest - let recoverUserRequest = Components.Schemas.RecoverUserRequest( - _type: .ACTIVITY_TYPE_RECOVER_USER, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: recoverUserIntent - ) - - // Create the input for the RecoverUser method - let input = Operations.RecoverUser.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(recoverUserRequest) - ) - - // Call the RecoverUser method using the underlyingClient - return try await call { try await underlyingClient.RecoverUser(input) } - } - - public func rejectActivity( - organizationId: String, - fingerprint: String - ) async throws -> Operations.RejectActivity.Output.Ok { - - // Create the RejectActivityIntent - let rejectActivityIntent = Components.Schemas.RejectActivityIntent( - fingerprint: fingerprint) - - // Create the RejectActivityRequest - let rejectActivityRequest = Components.Schemas.RejectActivityRequest( - _type: .ACTIVITY_TYPE_REJECT_ACTIVITY, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: rejectActivityIntent - ) - - // Create the input for the RejectActivity method - let input = Operations.RejectActivity.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(rejectActivityRequest) - ) - - // Call the RejectActivity method using the underlyingClient - return try await call { try await underlyingClient.RejectActivity(input) } - } - - public func removeOrganizationFeature( - organizationId: String, - name: Components.Schemas.FeatureName - ) async throws -> Operations.RemoveOrganizationFeature.Output.Ok { - - // Create the RemoveOrganizationFeatureIntent - let removeOrganizationFeatureIntent = Components.Schemas.RemoveOrganizationFeatureIntent( - name: name) - - // Create the RemoveOrganizationFeatureRequest - let removeOrganizationFeatureRequest = Components.Schemas.RemoveOrganizationFeatureRequest( - _type: .ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: removeOrganizationFeatureIntent - ) - - // Create the input for the RemoveOrganizationFeature method - let input = Operations.RemoveOrganizationFeature.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(removeOrganizationFeatureRequest) - ) - - // Call the RemoveOrganizationFeature method using the underlyingClient - return try await call { try await underlyingClient.RemoveOrganizationFeature(input) } - } - - public func setOrganizationFeature( - organizationId: String, - name: Components.Schemas.FeatureName, value: String? - ) async throws -> Operations.SetOrganizationFeature.Output.Ok { - - // Create the SetOrganizationFeatureIntent - let setOrganizationFeatureIntent = Components.Schemas.SetOrganizationFeatureIntent( - name: name, value: value) - - // Create the SetOrganizationFeatureRequest - let setOrganizationFeatureRequest = Components.Schemas.SetOrganizationFeatureRequest( - _type: .ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: setOrganizationFeatureIntent - ) - - // Create the input for the SetOrganizationFeature method - let input = Operations.SetOrganizationFeature.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(setOrganizationFeatureRequest) - ) - - // Call the SetOrganizationFeature method using the underlyingClient - return try await call { try await underlyingClient.SetOrganizationFeature(input) } - } - - public func signRawPayload( - organizationId: String, - signWith: String, payload: String, encoding: Components.Schemas.PayloadEncoding, - hashFunction: Components.Schemas.HashFunction - ) async throws -> Operations.SignRawPayload.Output.Ok { - - // Create the SignRawPayloadIntentV2 - let signRawPayloadIntent = Components.Schemas.SignRawPayloadIntentV2( - signWith: signWith, payload: payload, encoding: encoding, hashFunction: hashFunction) - - // Create the SignRawPayloadRequest - let signRawPayloadRequest = Components.Schemas.SignRawPayloadRequest( - _type: .ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: signRawPayloadIntent - ) - - // Create the input for the SignRawPayload method - let input = Operations.SignRawPayload.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(signRawPayloadRequest) - ) - - // Call the SignRawPayload method using the underlyingClient - return try await call { try await underlyingClient.SignRawPayload(input) } - } - - public func signRawPayloads( - organizationId: String, - signWith: String, payloads: [String], encoding: Components.Schemas.PayloadEncoding, - hashFunction: Components.Schemas.HashFunction - ) async throws -> Operations.SignRawPayloads.Output.Ok { - - // Create the SignRawPayloadsIntent - let signRawPayloadsIntent = Components.Schemas.SignRawPayloadsIntent( - signWith: signWith, payloads: payloads, encoding: encoding, hashFunction: hashFunction) - - // Create the SignRawPayloadsRequest - let signRawPayloadsRequest = Components.Schemas.SignRawPayloadsRequest( - _type: .ACTIVITY_TYPE_SIGN_RAW_PAYLOADS, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: signRawPayloadsIntent - ) - - // Create the input for the SignRawPayloads method - let input = Operations.SignRawPayloads.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(signRawPayloadsRequest) - ) - - // Call the SignRawPayloads method using the underlyingClient - return try await call { try await underlyingClient.SignRawPayloads(input) } - } - - public func signTransaction( - organizationId: String, - signWith: String, unsignedTransaction: String, _type: Components.Schemas.TransactionType - ) async throws -> Operations.SignTransaction.Output.Ok { - - // Create the SignTransactionIntentV2 - let signTransactionIntent = Components.Schemas.SignTransactionIntentV2( - signWith: signWith, unsignedTransaction: unsignedTransaction, _type: _type) - - // Create the SignTransactionRequest - let signTransactionRequest = Components.Schemas.SignTransactionRequest( - _type: .ACTIVITY_TYPE_SIGN_TRANSACTION_V2, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: signTransactionIntent - ) - - // Create the input for the SignTransaction method - let input = Operations.SignTransaction.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(signTransactionRequest) - ) - - // Call the SignTransaction method using the underlyingClient - return try await call { try await underlyingClient.SignTransaction(input) } - } - - public func stampLogin( - organizationId: String, - publicKey: String, expirationSeconds: String?, invalidateExisting: Bool? - ) async throws -> Operations.StampLogin.Output.Ok { - - // Create the StampLoginIntent - let stampLoginIntent = Components.Schemas.StampLoginIntent( - publicKey: publicKey, expirationSeconds: expirationSeconds, - invalidateExisting: invalidateExisting) - - // Create the StampLoginRequest - let stampLoginRequest = Components.Schemas.StampLoginRequest( - _type: .ACTIVITY_TYPE_STAMP_LOGIN, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: stampLoginIntent - ) - - // Create the input for the StampLogin method - let input = Operations.StampLogin.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(stampLoginRequest) - ) - - // Call the StampLogin method using the underlyingClient - return try await call { try await underlyingClient.StampLogin(input) } - } - - public func updatePolicy( - organizationId: String, - policyId: String, policyName: String?, policyEffect: Components.Schemas.Effect?, - policyCondition: String?, policyConsensus: String?, policyNotes: String? - ) async throws -> Operations.UpdatePolicy.Output.Ok { - - // Create the UpdatePolicyIntentV2 - let updatePolicyIntent = Components.Schemas.UpdatePolicyIntentV2( - policyId: policyId, policyName: policyName, policyEffect: policyEffect, - policyCondition: policyCondition, policyConsensus: policyConsensus, policyNotes: policyNotes) - - // Create the UpdatePolicyRequest - let updatePolicyRequest = Components.Schemas.UpdatePolicyRequest( - _type: .ACTIVITY_TYPE_UPDATE_POLICY_V2, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: updatePolicyIntent - ) - - // Create the input for the UpdatePolicy method - let input = Operations.UpdatePolicy.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(updatePolicyRequest) - ) - - // Call the UpdatePolicy method using the underlyingClient - return try await call { try await underlyingClient.UpdatePolicy(input) } - } - - public func updatePrivateKeyTag( - organizationId: String, - privateKeyTagId: String, newPrivateKeyTagName: String?, addPrivateKeyIds: [String], - removePrivateKeyIds: [String] - ) async throws -> Operations.UpdatePrivateKeyTag.Output.Ok { - - // Create the UpdatePrivateKeyTagIntent - let updatePrivateKeyTagIntent = Components.Schemas.UpdatePrivateKeyTagIntent( - privateKeyTagId: privateKeyTagId, newPrivateKeyTagName: newPrivateKeyTagName, - addPrivateKeyIds: addPrivateKeyIds, removePrivateKeyIds: removePrivateKeyIds) - - // Create the UpdatePrivateKeyTagRequest - let updatePrivateKeyTagRequest = Components.Schemas.UpdatePrivateKeyTagRequest( - _type: .ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: updatePrivateKeyTagIntent - ) - - // Create the input for the UpdatePrivateKeyTag method - let input = Operations.UpdatePrivateKeyTag.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(updatePrivateKeyTagRequest) - ) - - // Call the UpdatePrivateKeyTag method using the underlyingClient - return try await call { try await underlyingClient.UpdatePrivateKeyTag(input) } - } - - public func updateRootQuorum( - organizationId: String, - threshold: Int32, userIds: [String] - ) async throws -> Operations.UpdateRootQuorum.Output.Ok { - - // Create the UpdateRootQuorumIntent - let updateRootQuorumIntent = Components.Schemas.UpdateRootQuorumIntent( - threshold: threshold, userIds: userIds) - - // Create the UpdateRootQuorumRequest - let updateRootQuorumRequest = Components.Schemas.UpdateRootQuorumRequest( - _type: .ACTIVITY_TYPE_UPDATE_ROOT_QUORUM, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: updateRootQuorumIntent - ) - - // Create the input for the UpdateRootQuorum method - let input = Operations.UpdateRootQuorum.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(updateRootQuorumRequest) - ) - - // Call the UpdateRootQuorum method using the underlyingClient - return try await call { try await underlyingClient.UpdateRootQuorum(input) } - } - - public func updateUser( - organizationId: String, - userId: String, userName: String?, userEmail: String?, userTagIds: [String]?, - userPhoneNumber: String? - ) async throws -> Operations.UpdateUser.Output.Ok { - - // Create the UpdateUserIntent - let updateUserIntent = Components.Schemas.UpdateUserIntent( - userId: userId, userName: userName, userEmail: userEmail, userTagIds: userTagIds, - userPhoneNumber: userPhoneNumber) - - // Create the UpdateUserRequest - let updateUserRequest = Components.Schemas.UpdateUserRequest( - _type: .ACTIVITY_TYPE_UPDATE_USER, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: updateUserIntent - ) - - // Create the input for the UpdateUser method - let input = Operations.UpdateUser.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(updateUserRequest) - ) - - // Call the UpdateUser method using the underlyingClient - return try await call { try await underlyingClient.UpdateUser(input) } - } - - public func updateUserEmail( - organizationId: String, - userId: String, userEmail: String, verificationToken: String? - ) async throws -> Operations.UpdateUserEmail.Output.Ok { - - // Create the UpdateUserEmailIntent - let updateUserEmailIntent = Components.Schemas.UpdateUserEmailIntent( - userId: userId, userEmail: userEmail, verificationToken: verificationToken) - - // Create the UpdateUserEmailRequest - let updateUserEmailRequest = Components.Schemas.UpdateUserEmailRequest( - _type: .ACTIVITY_TYPE_UPDATE_USER_EMAIL, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: updateUserEmailIntent - ) - - // Create the input for the UpdateUserEmail method - let input = Operations.UpdateUserEmail.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(updateUserEmailRequest) - ) - - // Call the UpdateUserEmail method using the underlyingClient - return try await call { try await underlyingClient.UpdateUserEmail(input) } - } - - public func updateUserName( - organizationId: String, - userId: String, userName: String - ) async throws -> Operations.UpdateUserName.Output.Ok { - - // Create the UpdateUserNameIntent - let updateUserNameIntent = Components.Schemas.UpdateUserNameIntent( - userId: userId, userName: userName) - - // Create the UpdateUserNameRequest - let updateUserNameRequest = Components.Schemas.UpdateUserNameRequest( - _type: .ACTIVITY_TYPE_UPDATE_USER_NAME, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: updateUserNameIntent - ) - - // Create the input for the UpdateUserName method - let input = Operations.UpdateUserName.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(updateUserNameRequest) - ) - - // Call the UpdateUserName method using the underlyingClient - return try await call { try await underlyingClient.UpdateUserName(input) } - } - - public func updateUserPhoneNumber( - organizationId: String, - userId: String, userPhoneNumber: String, verificationToken: String? - ) async throws -> Operations.UpdateUserPhoneNumber.Output.Ok { - - // Create the UpdateUserPhoneNumberIntent - let updateUserPhoneNumberIntent = Components.Schemas.UpdateUserPhoneNumberIntent( - userId: userId, userPhoneNumber: userPhoneNumber, verificationToken: verificationToken) - - // Create the UpdateUserPhoneNumberRequest - let updateUserPhoneNumberRequest = Components.Schemas.UpdateUserPhoneNumberRequest( - _type: .ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: updateUserPhoneNumberIntent - ) - - // Create the input for the UpdateUserPhoneNumber method - let input = Operations.UpdateUserPhoneNumber.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(updateUserPhoneNumberRequest) - ) - - // Call the UpdateUserPhoneNumber method using the underlyingClient - return try await call { try await underlyingClient.UpdateUserPhoneNumber(input) } - } - - public func updateUserTag( - organizationId: String, - userTagId: String, newUserTagName: String?, addUserIds: [String], removeUserIds: [String] - ) async throws -> Operations.UpdateUserTag.Output.Ok { - - // Create the UpdateUserTagIntent - let updateUserTagIntent = Components.Schemas.UpdateUserTagIntent( - userTagId: userTagId, newUserTagName: newUserTagName, addUserIds: addUserIds, - removeUserIds: removeUserIds) - - // Create the UpdateUserTagRequest - let updateUserTagRequest = Components.Schemas.UpdateUserTagRequest( - _type: .ACTIVITY_TYPE_UPDATE_USER_TAG, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: updateUserTagIntent - ) - - // Create the input for the UpdateUserTag method - let input = Operations.UpdateUserTag.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(updateUserTagRequest) - ) - - // Call the UpdateUserTag method using the underlyingClient - return try await call { try await underlyingClient.UpdateUserTag(input) } - } - - public func updateWallet( - organizationId: String, - walletId: String, walletName: String? - ) async throws -> Operations.UpdateWallet.Output.Ok { - - // Create the UpdateWalletIntent - let updateWalletIntent = Components.Schemas.UpdateWalletIntent( - walletId: walletId, walletName: walletName) - - // Create the UpdateWalletRequest - let updateWalletRequest = Components.Schemas.UpdateWalletRequest( - _type: .ACTIVITY_TYPE_UPDATE_WALLET, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: updateWalletIntent - ) - - // Create the input for the UpdateWallet method - let input = Operations.UpdateWallet.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(updateWalletRequest) - ) - - // Call the UpdateWallet method using the underlyingClient - return try await call { try await underlyingClient.UpdateWallet(input) } - } - - public func verifyOtp( - organizationId: String, - otpId: String, otpCode: String, expirationSeconds: String? - ) async throws -> Operations.VerifyOtp.Output.Ok { - - // Create the VerifyOtpIntent - let verifyOtpIntent = Components.Schemas.VerifyOtpIntent( - otpId: otpId, otpCode: otpCode, expirationSeconds: expirationSeconds) - - // Create the VerifyOtpRequest - let verifyOtpRequest = Components.Schemas.VerifyOtpRequest( - _type: .ACTIVITY_TYPE_VERIFY_OTP, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - organizationId: organizationId, - parameters: verifyOtpIntent - ) - - // Create the input for the VerifyOtp method - let input = Operations.VerifyOtp.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json(verifyOtpRequest) - ) - - // Call the VerifyOtp method using the underlyingClient - return try await call { try await underlyingClient.VerifyOtp(input) } } } diff --git a/Sources/TurnkeyHttp/README.md b/Sources/TurnkeyHttp/README.md index cc74ee97..a9283b62 100644 --- a/Sources/TurnkeyHttp/README.md +++ b/Sources/TurnkeyHttp/README.md @@ -50,37 +50,13 @@ let proxyClient = TurnkeyClient(proxyURL: "http://localhost:3000/proxy") ## Code Generation -This project uses `swift-openapi-generator` and [Sourcery](https://github.com/krzysztofzablocki/Sourcery) with Stencil templates to generate code based on Turnkey's OpenAPI schema. - -With the provided `Makefile`, you can: - -* Generate updated HTTP fetchers from the OpenAPI spec: - -```bash -make turnkey_client_types -``` -* Regenerate the `TurnkeyClient` using Sourcery templates: - -```bash -make turnkey_client -``` -* Run the full code generation flow (types + client + format): - -```bash -make generate -``` -* Format Swift code recursively: - -```bash -make format -``` -* Clean generated files: +Client methods are auto-generated from Swagger specifications. To regenerate: ```bash -make clean +cd Scripts && make generate ``` -> Curious how our Stencil templates work? Check out [`Resources/Templates/README.md`](Resources/Templates/README.md) for a deeper dive into how we generate the Swift client using macros and template composition. +See [Scripts README](../../Scripts/README.md) for details. --- diff --git a/Sources/TurnkeyHttp/Resources/Templates/README.md b/Sources/TurnkeyHttp/Resources/Templates/README.md deleted file mode 100644 index aa87704a..00000000 --- a/Sources/TurnkeyHttp/Resources/Templates/README.md +++ /dev/null @@ -1,119 +0,0 @@ -# Stencil Templates - -This document explains how we use [Sourcery](https://github.com/krzysztofzablocki/Sourcery) and [Stencil](https://stencil.fuller.li) templates to generate Swift code in the Turnkey SDK. - ---- - -## What is Stencil? - - [Stencil](https://stencil.fuller.li/) is a Swift-based templating language inspired by Django and Jinja. It’s commonly used for generating code. When combined with [Sourcery](https://github.com/krzysztofzablocki/Sourcery), it can introspect your Swift types and auto-generate boilerplate code based on customizable templates. - -## What We Use It For - -We use Stencil and Sourcery to generate our `TurnkeyClient.swift`, which provides typed methods for interacting with the Turnkey API. This prevents us from having to hand-write dozens of repetitive request wrappers. - -## Template Files - -The templates live in `Resources/Templates`. There are two main files: - -* `TurnkeyClient.stencil`: The primary template that renders the full client file. -* `macros.stencil`: A collection of reusable helper macros used by `TurnkeyClient.stencil`. - -## How It Works - -1. `swift-openapi-generator` creates all the base request/response types under `Generated/`. -2. Sourcery reads those types and passes them into the Stencil templates. -3. `TurnkeyClient.stencil` uses logic and macros to emit Swift methods. -4. The result is saved to `Public/TurnkeyClient.swift`. - -To trigger this process, run: - -```bash -make turnkey_client -``` - ---- - -## Macro Overview (`macros.stencil`) - -Each macro is a reusable logic block that simplifies the generation process. - -### `addMethodParams` - -Generates Swift method parameters based on a `Request` struct. - -```stencil -foo: String, bar: Int -``` - -### `addRequestBody` - -Constructs an instance of a `Request` struct from the method parameters. - -```swift -MyRequest(foo: foo, bar: bar) -``` - -### `addActivityMethodParams` - -Special logic for activity requests. It flattens parameters inside a nested `parameters` object, and skips `_type` and `timestampMs`. - -### `getActivityType` - -Looks up the first enum case value for `_type` inside the request struct. - -```swift -.typeName -``` - -### `getIntentParams` - -Generates Swift-style initializers for a Turnkey "intent" object (used inside activity requests). - -### `generateActivityMethod` - -Composes an entire method including: - -* Creating the intent struct -* Creating the request struct -* Constructing the operation input -* Making the API call - ---- - -## Template Flow - -In `TurnkeyClient.stencil`, we: - -1. Import `macros.stencil`: - -```stencil -{% import "macros.stencil" %} -``` - -2. Loop through every API method: - -```stencil -{% for method in class.instanceMethods %} -``` - -3. If it's an activity request (contains `_type`), we call: - -```stencil -{% call generateActivityMethod method.callName %} -``` - -4. Otherwise, we: - -* Use `addMethodParams` to generate parameters -* Construct a request struct -* Call the endpoint -* Handle responses - ---- - -## Powered By StencilSwiftKit - -We use [StencilSwiftKit](https://github.com/SwiftGen/StencilSwiftKit), a powerful Stencil extension that adds filters and tags tailored for Swift code generation. - ---- diff --git a/Sources/TurnkeyHttp/Resources/Templates/TurnkeyClient.stencil b/Sources/TurnkeyHttp/Resources/Templates/TurnkeyClient.stencil deleted file mode 100644 index d65f7c09..00000000 --- a/Sources/TurnkeyHttp/Resources/Templates/TurnkeyClient.stencil +++ /dev/null @@ -1,50 +0,0 @@ -import AuthenticationServices -import CryptoKit -import Foundation -import OpenAPIRuntime -import OpenAPIURLSession - -public struct TurnkeyClient { - public static let baseURLString = "https://api.turnkey.com" - - private let underlyingClient: any APIProtocol - - internal init(underlyingClient: any APIProtocol) { - self.underlyingClient = underlyingClient - } - - {% import "macros.stencil" %} - {% for class in types.implementing.APIProtocol %} - {% for method in class.instanceMethods %} - {% set bodyInput method.parameters.0.typeName %} - {% set requestStructName %}{{method.callName}}Request{% endset %} - {% set isActivityRequest %} - {% for struct in types.structs where struct.name|hasSuffix:requestStructName and struct.methods.0.parameters.0.name == "_type" -%}true{%- endfor %} - {% endset %} - {% if isActivityRequest|contains:"true" -%} - {% call generateActivityMethod method.callName -%} - {% else -%} - {% set okStructType %}Operations.{{method.callName}}.Output.Ok{% endset %} - public func {{ method.callName|lowerFirstLetter }}({% call addMethodParams method.callName %}) async throws -> {{ okStructType }} { - - // Create the {{ requestStructName }} - let {{ method.callName|lowerFirstLetter }}Request = Components.Schemas.{{ requestStructName }}( - {% for struct in types.structs where struct.name|hasSuffix:requestStructName -%} - {% for var in struct.variables -%} - {{ var.name }}: {{ var.name }}{% if not forloop.last %}, {% endif %} - {%- endfor %} - {%- endfor %} - ) - - let input = {{ bodyInput }}( - headers: .init(accept: [.init(contentType: .json)]), - body: .json({{ requestStructName|lowerFirstLetter }}) - ) - - return try await call { try await underlyingClient.{{ method.callName }}(input) } - - } - {% endif -%} - {% endfor %} - {% endfor %} -} diff --git a/Sources/TurnkeyHttp/Resources/Templates/macros.stencil b/Sources/TurnkeyHttp/Resources/Templates/macros.stencil deleted file mode 100644 index 50fe1a87..00000000 --- a/Sources/TurnkeyHttp/Resources/Templates/macros.stencil +++ /dev/null @@ -1,102 +0,0 @@ -{# Uses '-' to trim newlines/whitespace #} -{% macro addMethodParams methodName -%} - {% for struct in types.structs where struct.localName|split:"Request"|join == methodName -%} - {% for method in struct.methods -%} - {% for param in method.parameters -%} - {{ param.name }}: {{ param.typeName|replace:"Swift.","" }}{% if not forloop.last %}, {% endif %} - {%- endfor %} - {%- endfor %} - {%- endfor %} -{%- endmacro %} - -{% macro addRequestBody methodName -%} - {% for struct in types.structs where struct.localName|split:"Request"|join == methodName -%} - {% for method in struct.methods -%} - {% for param in method.parameters -%} - {{struct.name}}({{ param.name }}: {{ param.name }}){% if not forloop.last %}, {% endif %} - {%- endfor %} - {%- endfor %} - {%- endfor %} -{%- endmacro %} - - -{% macro addActivityMethodParams methodName -%} - {% for struct in types.structs where struct.localName|split:"Request"|join == methodName -%} - {% for method in struct.methods -%} - {# First handle non-parameters fields #} - {% for param in method.parameters where param.name != "_type" and param.name != "timestampMs" and param.name != "parameters" -%} - {{ param.name }}: {{ param.typeName|replace:"Swift.","" }} - {%- endfor %} - {# Then handle parameters fields if they exist #} - {% for param in method.parameters where param.name == "parameters" -%} - {% if param.type.variables.count > 0 %}, {% endif %} - {% for var in param.type.variables -%} - {{ var.name }}: {{ var.typeName|replace:"Swift.","" }}{% if not forloop.last %}, {% endif %} - {%- endfor %} - {%- endfor %} - {%- endfor %} - {%- endfor %} -{%- endmacro %} - -{% macro getActivityType methodName -%} - {% for struct in types.structs where struct.localName|split:"Request"|join == methodName -%} - {% for method in struct.methods -%} - {% for param in method.parameters where param.name == "_type" -%} - .{{ param.type.cases.0.rawValue }} - {%- endfor %} - {%- endfor %} - {%- endfor %} -{%- endmacro %} - -{% macro getIntentParams intentStructName -%} - {% for struct in types.structs where struct.localName == intentStructName -%} - {% map struct.variables into params -%}{{ maploop.item.name }}: {{ maploop.item.name }}{%- endmap %} - {{ params|join:", " }} - {%- endfor %} -{%- endmacro %} - -{% macro generateActivityMethod methodName -%} - {% set bodyInput method.parameters.0.typeName %} - {% set returnType method.returnType.name %} - {# e.g. GetWhoamiRequest #} - {% set requestStruct %}{{methodName}}Request{% endset %} - {% set intentStructName -%} - {% for struct in types.structs where struct.localName == requestStruct -%} - {% for var in struct.variables where var.name == "parameters" -%} - {{ var.typeName|replace:"Components.Schemas.","" }} - {%- endfor %} - {%- endfor %} - {%- endset %} - - public func {{ method.callName|lowerFirstLetter }}({% call addActivityMethodParams method.callName %}) async throws -> Operations.{{method.callName}}.Output.Ok { - - // Create the {{ intentStructName }} - let {{ method.callName|lowerFirstLetter }}Intent = Components.Schemas.{{ intentStructName }}({% call getIntentParams intentStructName %}) - - - // Create the {{ requestStruct }} - let {{ method.callName|lowerFirstLetter }}Request = Components.Schemas.{{ requestStruct }}( - _type: {% call getActivityType method.callName %}, - timestampMs: String(Int(Date().timeIntervalSince1970 * 1000)), - {% for struct in types.structs where struct.name|hasSuffix:requestStruct -%} - {% for type in struct.containedTypes where type.parentName|replace:"Components.Schemas.","" == requestStruct and type.localName == "CodingKeys" -%} - {% for case in type.cases where case.name != "_type" and case.name != "timestampMs" and case.name != "parameters" -%} - {{ case.name }}: {{ case.name }}, - {%- endfor %} - {%- endfor %} - {%- endfor %} - parameters: {{ method.callName|lowerFirstLetter }}Intent - ) - - - // Create the input for the {{ method.callName }} method - let input = Operations.{{method.callName}}.Input( - headers: .init(accept: [.init(contentType: .json)]), - body: .json({{ requestStruct|lowerFirstLetter }}) - ) - - - // Call the {{ method.callName }} method using the underlyingClient - return try await call { try await underlyingClient.{{ methodName }}(input) } - } -{%- endmacro %} diff --git a/Sources/TurnkeyHttp/Resources/openapi-generator-config.yaml b/Sources/TurnkeyHttp/Resources/openapi-generator-config.yaml deleted file mode 100644 index 736542d0..00000000 --- a/Sources/TurnkeyHttp/Resources/openapi-generator-config.yaml +++ /dev/null @@ -1,4 +0,0 @@ -generate: - - types - - client -accessModifier: public diff --git a/Sources/TurnkeyHttp/Resources/openapi.yaml b/Sources/TurnkeyHttp/Resources/openapi.yaml deleted file mode 100644 index ab072368..00000000 --- a/Sources/TurnkeyHttp/Resources/openapi.yaml +++ /dev/null @@ -1,7804 +0,0 @@ -openapi: 3.0.1 -info: - title: API Reference - description: "Review our [API Introduction](../api-introduction) to get started." - contact: {} - version: "1.0" -servers: -- url: https://api.turnkey.com/ -security: -- ApiKeyAuth: [] -- AuthenticatorAuth: [] -tags: -- name: Organizations - description: |- - An Organization is the highest level of hierarchy in Turnkey. It can contain many Users, Private Keys, and Policies managed by a Root Quorum. The Root Quorum consists of a set of Users with a consensus threshold. This consensus threshold must be reached by Quorum members in order for any actions to take place. - - See [Root Quorum](../concepts/users/root-quorum) for more information -- name: Invitations - description: |- - Invitations allow you to invite Users into your Organization via email. Alternatively, Users can be added directly without an Invitation if their ApiKey or Authenticator credentials are known ahead of time. - - See [Users](./api#tag/Users) for more information -- name: Policies - description: |- - Policies allow for deep customization of the security of your Organization. They can be used to grant permissions or restrict usage of Users and Private Keys. The Policy Engine analyzes all of your Policies on each request to determine whether an Activity is allowed. - - See [Policy Overview](../managing-policies/overview) for more information -- name: Wallets - description: |- - Wallets contain collections of deterministically generated cryptographic public / private key pairs that share a common seed. Turnkey securely holds the common seed, but only you can access it. In most cases, Wallets should be preferred over Private Keys since they can be represented by a mnemonic phrase, used across a variety of cryptographic curves, and can derive many addresses. - - Derived addresses can be used to create digital signatures using the corresponding underlying private key. See [Signing](./api#tag/Signing) for more information -- name: Signing - description: "Signers allow you to create digital signatures. Signatures are used\ - \ to validate the authenticity and integrity of a digital message. Turnkey makes\ - \ it easy to produce signatures by allowing you to sign with an address. If Turnkey\ - \ doesn't yet support an address format you need, you can generate and sign with\ - \ the public key instead by using the address format `ADDRESS_FORMAT_COMPRESSED`." -- name: Private Keys - description: |- - Private Keys are cryptographic public / private key pairs that can be used for cryptocurrency needs or more generalized encryption. Turnkey securely holds all private key materials for you, but only you can access them. - - The Private Key ID or any derived address can be used to create digital signatures. See [Signing](./api#tag/Signing) for more information -- name: Private Key Tags - description: Private Key Tags allow you to easily group and permission Private Keys - through Policies. -- name: Users - description: "Users are responsible for any action taken within an Organization.\ - \ They can have ApiKey or Auuthenticator credentials, allowing you to onboard\ - \ teammates to the Organization, or create API-only Users to run as part of your\ - \ infrastructure." -- name: User Tags - description: User Key Tags allow you to easily group and permission Users through - Policies. -- name: Authenticators - description: "Authenticators are WebAuthN hardware devices, such as a Macbook TouchID\ - \ or Yubikey, that can be used to authenticate requests." -- name: API Keys - description: |- - API Keys are used to authenticate requests - - See our [CLI](https://github.com/tkhq/tkcli) for instructions on generating API Keys -- name: Activities - description: |- - Activities encapsulate all the possible actions that can be taken with Turnkey. Some examples include adding a new user, creating a private key, and signing a transaction. - - Activities that modify your Organization are processed asynchronously. To confirm processing is complete and retrieve the Activity results, these activities must be polled until that status has been updated to a finalized state: `COMPLETED` when the activity is successful or `FAILED` when the activity has failed -- name: Consensus - description: |- - Policies can enforce consensus requirements for Activities. For example, adding a new user requires two admins to approve the request. - - Activities that have been proposed, but don't yet meet the Consesnsus requirements will have the status: `REQUIRES_CONSENSUS`. Activities in this state can be approved or rejected using the unique fingerprint generated when an Activity is created. -paths: - /public/v1/query/get_activity: - post: - tags: - - Activities - summary: Get Activity - description: Get details about an Activity - operationId: GetActivity - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetActivityRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/query/get_api_key: - post: - tags: - - API keys - summary: Get API key - description: Get details about an API key - operationId: GetApiKey - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetApiKeyRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetApiKeyResponse' - x-codegen-request-body-name: body - /public/v1/query/get_api_keys: - post: - tags: - - API keys - summary: Get API keys - description: Get details about API keys for a user - operationId: GetApiKeys - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetApiKeysRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetApiKeysResponse' - x-codegen-request-body-name: body - /public/v1/query/get_authenticator: - post: - tags: - - Authenticators - summary: Get Authenticator - description: Get details about an authenticator - operationId: GetAuthenticator - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetAuthenticatorRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetAuthenticatorResponse' - x-codegen-request-body-name: body - /public/v1/query/get_authenticators: - post: - tags: - - Authenticators - summary: Get Authenticators - description: Get details about authenticators for a user - operationId: GetAuthenticators - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetAuthenticatorsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetAuthenticatorsResponse' - x-codegen-request-body-name: body - /public/v1/query/get_oauth_providers: - post: - tags: - - User Auth - summary: Get Oauth providers - description: Get details about Oauth providers for a user - operationId: GetOauthProviders - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetOauthProvidersRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetOauthProvidersResponse' - x-codegen-request-body-name: body - /public/v1/query/get_organization_configs: - post: - tags: - - Organizations - summary: Get Configs - description: Get quorum settings and features for an organization - operationId: GetOrganizationConfigs - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetOrganizationConfigsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetOrganizationConfigsResponse' - x-codegen-request-body-name: body - /public/v1/query/get_policy: - post: - tags: - - Policies - summary: Get Policy - description: Get details about a Policy - operationId: GetPolicy - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetPolicyRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetPolicyResponse' - x-codegen-request-body-name: body - /public/v1/query/get_private_key: - post: - tags: - - Private Keys - summary: Get Private Key - description: Get details about a Private Key - operationId: GetPrivateKey - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetPrivateKeyRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetPrivateKeyResponse' - x-codegen-request-body-name: body - /public/v1/query/get_user: - post: - tags: - - Users - summary: Get User - description: Get details about a User - operationId: GetUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetUserRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetUserResponse' - x-codegen-request-body-name: body - /public/v1/query/get_wallet: - post: - tags: - - Wallets - summary: Get Wallet - description: Get details about a Wallet - operationId: GetWallet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetWalletRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetWalletResponse' - x-codegen-request-body-name: body - /public/v1/query/get_wallet_account: - post: - tags: - - Wallets - summary: Get Wallet Account - description: Get a single wallet account - operationId: GetWalletAccount - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetWalletAccountRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetWalletAccountResponse' - x-codegen-request-body-name: body - /public/v1/query/list_activities: - post: - tags: - - Activities - summary: List Activities - description: List all Activities within an Organization - operationId: GetActivities - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetActivitiesRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetActivitiesResponse' - x-codegen-request-body-name: body - /public/v1/query/list_policies: - post: - tags: - - Policies - summary: List Policies - description: List all Policies within an Organization - operationId: GetPolicies - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetPoliciesRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetPoliciesResponse' - x-codegen-request-body-name: body - /public/v1/query/list_private_key_tags: - post: - tags: - - Private Key Tags - summary: List Private Key Tags - description: List all Private Key Tags within an Organization - operationId: ListPrivateKeyTags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ListPrivateKeyTagsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ListPrivateKeyTagsResponse' - x-codegen-request-body-name: body - /public/v1/query/list_private_keys: - post: - tags: - - Private Keys - summary: List Private Keys - description: List all Private Keys within an Organization - operationId: GetPrivateKeys - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetPrivateKeysRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetPrivateKeysResponse' - x-codegen-request-body-name: body - /public/v1/query/list_suborgs: - post: - tags: - - Organizations - summary: Get Suborgs - description: Get all suborg IDs associated given a parent org ID and an optional - filter. - operationId: GetSubOrgIds - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetSubOrgIdsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetSubOrgIdsResponse' - x-codegen-request-body-name: body - /public/v1/query/list_user_tags: - post: - tags: - - User Tags - summary: List User Tags - description: List all User Tags within an Organization - operationId: ListUserTags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ListUserTagsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ListUserTagsResponse' - x-codegen-request-body-name: body - /public/v1/query/list_users: - post: - tags: - - Users - summary: List Users - description: List all Users within an Organization - operationId: GetUsers - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetUsersRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetUsersResponse' - x-codegen-request-body-name: body - /public/v1/query/list_verified_suborgs: - post: - tags: - - Organizations - summary: Get Verified Suborgs - description: Get all email or phone verified suborg IDs associated given a parent - org ID. - operationId: GetVerifiedSubOrgIds - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetVerifiedSubOrgIdsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetVerifiedSubOrgIdsResponse' - x-codegen-request-body-name: body - /public/v1/query/list_wallet_accounts: - post: - tags: - - Wallets - summary: List Wallets Accounts - description: List all Accounts within a Wallet - operationId: GetWalletAccounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetWalletAccountsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetWalletAccountsResponse' - x-codegen-request-body-name: body - /public/v1/query/list_wallets: - post: - tags: - - Wallets - summary: List Wallets - description: List all Wallets within an Organization - operationId: GetWallets - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetWalletsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetWalletsResponse' - x-codegen-request-body-name: body - /public/v1/query/whoami: - post: - tags: - - Sessions - summary: Who am I? - description: Get basic information about your current API or WebAuthN user and - their organization. Affords Sub-Organization look ups via Parent Organization - for WebAuthN or API key users. - operationId: GetWhoami - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetWhoamiRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/GetWhoamiResponse' - x-codegen-request-body-name: body - /public/v1/submit/approve_activity: - post: - tags: - - Consensus - summary: Approve Activity - description: Approve an Activity - operationId: ApproveActivity - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ApproveActivityRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_api_keys: - post: - tags: - - API Keys - summary: Create API Keys - description: Add api keys to an existing User - operationId: CreateApiKeys - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateApiKeysRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_authenticators: - post: - tags: - - Authenticators - summary: Create Authenticators - description: Create Authenticators to authenticate requests to Turnkey - operationId: CreateAuthenticators - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateAuthenticatorsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_invitations: - post: - tags: - - Invitations - summary: Create Invitations - description: Create Invitations to join an existing Organization - operationId: CreateInvitations - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateInvitationsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_oauth_providers: - post: - tags: - - User Auth - summary: Create Oauth Providers - description: Creates Oauth providers for a specified user - BETA - operationId: CreateOauthProviders - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateOauthProvidersRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_policies: - post: - tags: - - Policies - summary: Create Policies - description: Create new Policies - operationId: CreatePolicies - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreatePoliciesRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_policy: - post: - tags: - - Policies - summary: Create Policy - description: Create a new Policy - operationId: CreatePolicy - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreatePolicyRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_private_key_tag: - post: - tags: - - Private Key Tags - summary: Create Private Key Tag - description: Create a private key tag and add it to private keys. - operationId: CreatePrivateKeyTag - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreatePrivateKeyTagRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_private_keys: - post: - tags: - - Private Keys - summary: Create Private Keys - description: Create new Private Keys - operationId: CreatePrivateKeys - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreatePrivateKeysRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_read_only_session: - post: - tags: - - Sessions - summary: Create Read Only Session - description: Create a read only session for a user (valid for 1 hour) - operationId: CreateReadOnlySession - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateReadOnlySessionRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_read_write_session: - post: - tags: - - Sessions - summary: Create Read Write Session - description: Create a read write session for a user - operationId: CreateReadWriteSession - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateReadWriteSessionRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_sub_organization: - post: - tags: - - Organizations - summary: Create Sub-Organization - description: Create a new Sub-Organization - operationId: CreateSubOrganization - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateSubOrganizationRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_user_tag: - post: - tags: - - User Tags - summary: Create User Tag - description: Create a user tag and add it to users. - operationId: CreateUserTag - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateUserTagRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_users: - post: - tags: - - Users - summary: Create Users - description: Create Users in an existing Organization - operationId: CreateUsers - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateUsersRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_wallet: - post: - tags: - - Wallets - summary: Create Wallet - description: Create a Wallet and derive addresses - operationId: CreateWallet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateWalletRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/create_wallet_accounts: - post: - tags: - - Wallets - summary: Create Wallet Accounts - description: Derive additional addresses using an existing wallet - operationId: CreateWalletAccounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateWalletAccountsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/delete_api_keys: - post: - tags: - - API Keys - summary: Delete API Keys - description: Remove api keys from a User - operationId: DeleteApiKeys - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteApiKeysRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/delete_authenticators: - post: - tags: - - Authenticators - summary: Delete Authenticators - description: Remove authenticators from a User - operationId: DeleteAuthenticators - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteAuthenticatorsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/delete_invitation: - post: - tags: - - Invitations - summary: Delete Invitation - description: Delete an existing Invitation - operationId: DeleteInvitation - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteInvitationRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/delete_oauth_providers: - post: - tags: - - User Auth - summary: Delete Oauth Providers - description: Removes Oauth providers for a specified user - BETA - operationId: DeleteOauthProviders - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteOauthProvidersRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/delete_policy: - post: - tags: - - Policies - summary: Delete Policy - description: Delete an existing Policy - operationId: DeletePolicy - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeletePolicyRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/delete_private_key_tags: - post: - tags: - - Private Key Tags - summary: Delete Private Key Tags - description: Delete Private Key Tags within an Organization - operationId: DeletePrivateKeyTags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeletePrivateKeyTagsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/delete_private_keys: - post: - tags: - - Private Keys - summary: Delete Private Keys - description: Deletes private keys for an organization - operationId: DeletePrivateKeys - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeletePrivateKeysRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/delete_sub_organization: - post: - tags: - - Organizations - summary: Delete Sub Organization - description: Deletes a sub organization - operationId: DeleteSubOrganization - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteSubOrganizationRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/delete_user_tags: - post: - tags: - - User Tags - summary: Delete User Tags - description: Delete User Tags within an Organization - operationId: DeleteUserTags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteUserTagsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/delete_users: - post: - tags: - - Users - summary: Delete Users - description: Delete Users within an Organization - operationId: DeleteUsers - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteUsersRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/delete_wallets: - post: - tags: - - Wallets - summary: Delete Wallets - description: Deletes wallets for an organization - operationId: DeleteWallets - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteWalletsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/email_auth: - post: - tags: - - User Auth - summary: Perform Email Auth - description: Authenticate a user via Email - operationId: EmailAuth - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EmailAuthRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/export_private_key: - post: - tags: - - Private Keys - summary: Export Private Key - description: Exports a Private Key - operationId: ExportPrivateKey - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ExportPrivateKeyRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/export_wallet: - post: - tags: - - Wallets - summary: Export Wallet - description: Exports a Wallet - operationId: ExportWallet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ExportWalletRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/export_wallet_account: - post: - tags: - - Wallets - summary: Export Wallet Account - description: Exports a Wallet Account - operationId: ExportWalletAccount - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ExportWalletAccountRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/import_private_key: - post: - tags: - - Private Keys - summary: Import Private Key - description: Imports a private key - operationId: ImportPrivateKey - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ImportPrivateKeyRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/import_wallet: - post: - tags: - - Wallets - summary: Import Wallet - description: Imports a wallet - operationId: ImportWallet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ImportWalletRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/init_import_private_key: - post: - tags: - - Private Keys - summary: Init Import Private Key - description: Initializes a new private key import - operationId: InitImportPrivateKey - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InitImportPrivateKeyRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/init_import_wallet: - post: - tags: - - Wallets - summary: Init Import Wallet - description: Initializes a new wallet import - operationId: InitImportWallet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InitImportWalletRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/init_otp: - post: - tags: - - User Verification - summary: Init Generic OTP - description: Initiate a Generic OTP activity - operationId: InitOtp - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InitOtpRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/init_otp_auth: - post: - tags: - - User Auth - summary: Init OTP auth - description: Initiate an OTP auth activity - operationId: InitOtpAuth - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InitOtpAuthRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/init_user_email_recovery: - post: - tags: - - User Recovery - summary: Init Email Recovery - description: Initializes a new email recovery - operationId: InitUserEmailRecovery - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InitUserEmailRecoveryRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/oauth: - post: - tags: - - User Auth - summary: Oauth - description: Authenticate a user with an Oidc token (Oauth) - BETA - operationId: Oauth - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OauthRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/oauth_login: - post: - tags: - - Sessions - summary: Login with Oauth - description: Create an Oauth session for a user - operationId: OauthLogin - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OauthLoginRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/otp_auth: - post: - tags: - - User Auth - summary: OTP auth - description: Authenticate a user with an OTP code sent via email or SMS - operationId: OtpAuth - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OtpAuthRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/otp_login: - post: - tags: - - Sessions - summary: Login with OTP - description: Create an OTP session for a user - operationId: OtpLogin - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OtpLoginRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/recover_user: - post: - tags: - - User Recovery - summary: Recover a user - description: Completes the process of recovering a user by adding an authenticator - operationId: RecoverUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RecoverUserRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/reject_activity: - post: - tags: - - Consensus - summary: Reject Activity - description: Reject an Activity - operationId: RejectActivity - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RejectActivityRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/remove_organization_feature: - post: - tags: - - Features - summary: Remove Organization Feature - description: Removes an organization feature. This activity must be approved - by the current root quorum. - operationId: RemoveOrganizationFeature - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RemoveOrganizationFeatureRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/set_organization_feature: - post: - tags: - - Features - summary: Set Organization Feature - description: Sets an organization feature. This activity must be approved by - the current root quorum. - operationId: SetOrganizationFeature - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetOrganizationFeatureRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/sign_raw_payload: - post: - tags: - - Signing - summary: Sign Raw Payload - description: Sign a raw payload - operationId: SignRawPayload - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SignRawPayloadRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/sign_raw_payloads: - post: - tags: - - Signing - summary: Sign Raw Payloads - description: Sign multiple raw payloads with the same signing parameters - operationId: SignRawPayloads - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SignRawPayloadsRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/sign_transaction: - post: - tags: - - Signing - summary: Sign Transaction - description: Sign a transaction - operationId: SignTransaction - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SignTransactionRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/stamp_login: - post: - tags: - - Sessions - summary: Login with a Stamp - description: "Create a session for a user through stamping client side (api\ - \ key, wallet client, or passkey client)" - operationId: StampLogin - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/StampLoginRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/update_policy: - post: - tags: - - Policies - summary: Update Policy - description: Update an existing Policy - operationId: UpdatePolicy - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePolicyRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/update_private_key_tag: - post: - tags: - - Private Key Tags - summary: Update Private Key Tag - description: "Update human-readable name or associated private keys. Note that\ - \ this activity is atomic: all of the updates will succeed at once, or all\ - \ of them will fail." - operationId: UpdatePrivateKeyTag - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePrivateKeyTagRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/update_root_quorum: - post: - tags: - - Organizations - summary: Update Root Quorum - description: Set the threshold and members of the root quorum. This activity - must be approved by the current root quorum. - operationId: UpdateRootQuorum - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateRootQuorumRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/update_user: - post: - tags: - - Users - summary: Update User - description: Update a User in an existing Organization - operationId: UpdateUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/update_user_email: - post: - tags: - - Users - summary: Update User's Email - description: Update a User's email in an existing Organization - operationId: UpdateUserEmail - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserEmailRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/update_user_name: - post: - tags: - - Users - summary: Update User's Name - description: Update a User's name in an existing Organization - operationId: UpdateUserName - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserNameRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/update_user_phone_number: - post: - tags: - - Users - summary: Update User's Phone Number - description: Update a User's phone number in an existing Organization - operationId: UpdateUserPhoneNumber - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserPhoneNumberRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/update_user_tag: - post: - tags: - - User Tags - summary: Update User Tag - description: "Update human-readable name or associated users. Note that this\ - \ activity is atomic: all of the updates will succeed at once, or all of them\ - \ will fail." - operationId: UpdateUserTag - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserTagRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/update_wallet: - post: - tags: - - Wallets - summary: Update Wallet - description: Update a wallet for an organization - operationId: UpdateWallet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateWalletRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body - /public/v1/submit/verify_otp: - post: - tags: - - User Verification - summary: Verify Generic OTP - description: Verify a Generic OTP - operationId: VerifyOtp - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/VerifyOtpRequest' - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - x-codegen-request-body-name: body -components: - schemas: - AcceptInvitationIntent: - required: - - authenticator - - invitationId - - userId - type: object - properties: - invitationId: - type: string - description: Unique identifier for a given Invitation object. - userId: - type: string - description: Unique identifier for a given User. - authenticator: - $ref: '#/components/schemas/AuthenticatorParams' - AcceptInvitationIntentV2: - required: - - authenticator - - invitationId - - userId - type: object - properties: - invitationId: - type: string - description: Unique identifier for a given Invitation object. - userId: - type: string - description: Unique identifier for a given User. - authenticator: - $ref: '#/components/schemas/AuthenticatorParamsV2' - AcceptInvitationResult: - required: - - invitationId - - userId - type: object - properties: - invitationId: - type: string - description: Unique identifier for a given Invitation. - userId: - type: string - description: Unique identifier for a given User. - AccessType: - type: string - enum: - - ACCESS_TYPE_WEB - - ACCESS_TYPE_API - - ACCESS_TYPE_ALL - ActivateBillingTierIntent: - required: - - productId - type: object - properties: - productId: - type: string - description: The product that the customer wants to subscribe to. - ActivateBillingTierResult: - required: - - productId - type: object - properties: - productId: - type: string - description: The id of the product being subscribed to. - Activity: - required: - - canApprove - - canReject - - createdAt - - fingerprint - - id - - intent - - organizationId - - result - - status - - type - - updatedAt - - votes - type: object - properties: - id: - type: string - description: Unique identifier for a given Activity object. - organizationId: - type: string - description: Unique identifier for a given Organization. - status: - $ref: '#/components/schemas/ActivityStatus' - type: - $ref: '#/components/schemas/ActivityType' - intent: - $ref: '#/components/schemas/Intent' - result: - $ref: '#/components/schemas/Result' - votes: - type: array - description: "A list of objects representing a particular User's approval\ - \ or rejection of a Consensus request, including all relevant metadata." - items: - $ref: '#/components/schemas/Vote' - fingerprint: - type: string - description: An artifact verifying a User's action. - canApprove: - type: boolean - canReject: - type: boolean - createdAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - updatedAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - failure: - $ref: '#/components/schemas/Status' - ActivityResponse: - required: - - activity - type: object - properties: - activity: - $ref: '#/components/schemas/Activity' - ActivityStatus: - type: string - enum: - - ACTIVITY_STATUS_CREATED - - ACTIVITY_STATUS_PENDING - - ACTIVITY_STATUS_COMPLETED - - ACTIVITY_STATUS_FAILED - - ACTIVITY_STATUS_CONSENSUS_NEEDED - - ACTIVITY_STATUS_REJECTED - ActivityType: - type: string - enum: - - ACTIVITY_TYPE_CREATE_API_KEYS - - ACTIVITY_TYPE_CREATE_USERS - - ACTIVITY_TYPE_CREATE_PRIVATE_KEYS - - ACTIVITY_TYPE_SIGN_RAW_PAYLOAD - - ACTIVITY_TYPE_CREATE_INVITATIONS - - ACTIVITY_TYPE_ACCEPT_INVITATION - - ACTIVITY_TYPE_CREATE_POLICY - - ACTIVITY_TYPE_DISABLE_PRIVATE_KEY - - ACTIVITY_TYPE_DELETE_USERS - - ACTIVITY_TYPE_DELETE_API_KEYS - - ACTIVITY_TYPE_DELETE_INVITATION - - ACTIVITY_TYPE_DELETE_ORGANIZATION - - ACTIVITY_TYPE_DELETE_POLICY - - ACTIVITY_TYPE_CREATE_USER_TAG - - ACTIVITY_TYPE_DELETE_USER_TAGS - - ACTIVITY_TYPE_CREATE_ORGANIZATION - - ACTIVITY_TYPE_SIGN_TRANSACTION - - ACTIVITY_TYPE_APPROVE_ACTIVITY - - ACTIVITY_TYPE_REJECT_ACTIVITY - - ACTIVITY_TYPE_DELETE_AUTHENTICATORS - - ACTIVITY_TYPE_CREATE_AUTHENTICATORS - - ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG - - ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS - - ACTIVITY_TYPE_SET_PAYMENT_METHOD - - ACTIVITY_TYPE_ACTIVATE_BILLING_TIER - - ACTIVITY_TYPE_DELETE_PAYMENT_METHOD - - ACTIVITY_TYPE_CREATE_POLICY_V2 - - ACTIVITY_TYPE_CREATE_POLICY_V3 - - ACTIVITY_TYPE_CREATE_API_ONLY_USERS - - ACTIVITY_TYPE_UPDATE_ROOT_QUORUM - - ACTIVITY_TYPE_UPDATE_USER_TAG - - ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG - - ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2 - - ACTIVITY_TYPE_CREATE_ORGANIZATION_V2 - - ACTIVITY_TYPE_CREATE_USERS_V2 - - ACTIVITY_TYPE_ACCEPT_INVITATION_V2 - - ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION - - ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2 - - ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS - - ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2 - - ACTIVITY_TYPE_UPDATE_USER - - ACTIVITY_TYPE_UPDATE_POLICY - - ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2 - - ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3 - - ACTIVITY_TYPE_CREATE_WALLET - - ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS - - ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY - - ACTIVITY_TYPE_RECOVER_USER - - ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE - - ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE - - ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2 - - ACTIVITY_TYPE_SIGN_TRANSACTION_V2 - - ACTIVITY_TYPE_EXPORT_PRIVATE_KEY - - ACTIVITY_TYPE_EXPORT_WALLET - - ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4 - - ACTIVITY_TYPE_EMAIL_AUTH - - ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT - - ACTIVITY_TYPE_INIT_IMPORT_WALLET - - ACTIVITY_TYPE_IMPORT_WALLET - - ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY - - ACTIVITY_TYPE_IMPORT_PRIVATE_KEY - - ACTIVITY_TYPE_CREATE_POLICIES - - ACTIVITY_TYPE_SIGN_RAW_PAYLOADS - - ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION - - ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS - - ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS - - ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5 - - ACTIVITY_TYPE_OAUTH - - ACTIVITY_TYPE_CREATE_API_KEYS_V2 - - ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION - - ACTIVITY_TYPE_EMAIL_AUTH_V2 - - ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6 - - ACTIVITY_TYPE_DELETE_PRIVATE_KEYS - - ACTIVITY_TYPE_DELETE_WALLETS - - ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2 - - ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION - - ACTIVITY_TYPE_INIT_OTP_AUTH - - ACTIVITY_TYPE_OTP_AUTH - - ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7 - - ACTIVITY_TYPE_UPDATE_WALLET - - ACTIVITY_TYPE_UPDATE_POLICY_V2 - - ACTIVITY_TYPE_CREATE_USERS_V3 - - ACTIVITY_TYPE_INIT_OTP_AUTH_V2 - - ACTIVITY_TYPE_INIT_OTP - - ACTIVITY_TYPE_VERIFY_OTP - - ACTIVITY_TYPE_OTP_LOGIN - - ACTIVITY_TYPE_STAMP_LOGIN - - ACTIVITY_TYPE_OAUTH_LOGIN - - ACTIVITY_TYPE_UPDATE_USER_NAME - - ACTIVITY_TYPE_UPDATE_USER_EMAIL - - ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER - AddressFormat: - type: string - enum: - - ADDRESS_FORMAT_UNCOMPRESSED - - ADDRESS_FORMAT_COMPRESSED - - ADDRESS_FORMAT_ETHEREUM - - ADDRESS_FORMAT_SOLANA - - ADDRESS_FORMAT_COSMOS - - ADDRESS_FORMAT_TRON - - ADDRESS_FORMAT_SUI - - ADDRESS_FORMAT_APTOS - - ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH - - ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH - - ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH - - ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH - - ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR - - ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH - - ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH - - ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH - - ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH - - ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR - - ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH - - ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH - - ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH - - ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH - - ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR - - ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH - - ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH - - ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH - - ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH - - ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR - - ADDRESS_FORMAT_SEI - - ADDRESS_FORMAT_XLM - - ADDRESS_FORMAT_DOGE_MAINNET - - ADDRESS_FORMAT_DOGE_TESTNET - - ADDRESS_FORMAT_TON_V3R2 - - ADDRESS_FORMAT_TON_V4R2 - - ADDRESS_FORMAT_TON_V5R1 - - ADDRESS_FORMAT_XRP - Any: - type: object - properties: - '@type': - type: string - additionalProperties: - type: object - ApiKey: - required: - - apiKeyId - - apiKeyName - - createdAt - - credential - - updatedAt - type: object - properties: - credential: - $ref: '#/components/schemas/external.data.v1.Credential' - apiKeyId: - type: string - description: Unique identifier for a given API Key. - apiKeyName: - type: string - description: Human-readable name for an API Key. - createdAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - updatedAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - expirationSeconds: - type: string - description: Optional window (in seconds) indicating how long the API Key - should last. - format: uint64 - nullable: true - ApiKeyCurve: - type: string - enum: - - API_KEY_CURVE_P256 - - API_KEY_CURVE_SECP256K1 - - API_KEY_CURVE_ED25519 - ApiKeyParams: - required: - - apiKeyName - - publicKey - type: object - properties: - apiKeyName: - type: string - description: Human-readable name for an API Key. - publicKey: - type: string - description: The public component of a cryptographic key pair used to sign - messages and transactions. - expirationSeconds: - type: string - description: Optional window (in seconds) indicating how long the API Key - should last. - nullable: true - ApiKeyParamsV2: - required: - - apiKeyName - - curveType - - publicKey - type: object - properties: - apiKeyName: - type: string - description: Human-readable name for an API Key. - publicKey: - type: string - description: The public component of a cryptographic key pair used to sign - messages and transactions. - curveType: - $ref: '#/components/schemas/ApiKeyCurve' - expirationSeconds: - type: string - description: Optional window (in seconds) indicating how long the API Key - should last. - nullable: true - ApiOnlyUserParams: - required: - - apiKeys - - userName - - userTags - type: object - properties: - userName: - type: string - description: The name of the new API-only User. - userEmail: - type: string - description: The email address for this API-only User (optional). - nullable: true - userTags: - type: array - description: "A list of tags assigned to the new API-only User. This field,\ - \ if not needed, should be an empty array in your request body." - items: - type: string - apiKeys: - type: array - description: "A list of API Key parameters. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/ApiKeyParams' - ApproveActivityIntent: - required: - - fingerprint - type: object - properties: - fingerprint: - type: string - description: An artifact verifying a User's action. - ApproveActivityRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_APPROVE_ACTIVITY - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/ApproveActivityIntent' - Attestation: - required: - - attestationObject - - clientDataJson - - credentialId - - transports - type: object - properties: - credentialId: - type: string - description: The cbor encoded then base64 url encoded id of the credential. - clientDataJson: - type: string - description: A base64 url encoded payload containing metadata about the - signing context and the challenge. - attestationObject: - type: string - description: A base64 url encoded payload containing authenticator data - and any attestation the webauthn provider chooses. - transports: - type: array - description: The type of authenticator transports. - items: - $ref: '#/components/schemas/AuthenticatorTransport' - Authenticator: - required: - - aaguid - - attestationType - - authenticatorId - - authenticatorName - - createdAt - - credential - - credentialId - - model - - transports - - updatedAt - type: object - properties: - transports: - type: array - description: "Types of transports that may be used by an Authenticator (e.g.,\ - \ USB, NFC, BLE)." - items: - $ref: '#/components/schemas/AuthenticatorTransport' - attestationType: - type: string - aaguid: - type: string - description: Identifier indicating the type of the Security Key. - credentialId: - type: string - description: Unique identifier for a WebAuthn credential. - model: - type: string - description: The type of Authenticator device. - credential: - $ref: '#/components/schemas/external.data.v1.Credential' - authenticatorId: - type: string - description: Unique identifier for a given Authenticator. - authenticatorName: - type: string - description: Human-readable name for an Authenticator. - createdAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - updatedAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - AuthenticatorAttestationResponse: - required: - - attestationObject - - clientDataJson - type: object - properties: - clientDataJson: - type: string - attestationObject: - type: string - transports: - type: array - items: - $ref: '#/components/schemas/AuthenticatorTransport' - authenticatorAttachment: - type: string - nullable: true - enum: - - cross-platform - - platform - AuthenticatorParams: - required: - - attestation - - authenticatorName - - challenge - - userId - type: object - properties: - authenticatorName: - type: string - description: Human-readable name for an Authenticator. - userId: - type: string - description: Unique identifier for a given User. - attestation: - $ref: '#/components/schemas/PublicKeyCredentialWithAttestation' - challenge: - type: string - description: Challenge presented for authentication purposes. - AuthenticatorParamsV2: - required: - - attestation - - authenticatorName - - challenge - type: object - properties: - authenticatorName: - type: string - description: Human-readable name for an Authenticator. - challenge: - type: string - description: Challenge presented for authentication purposes. - attestation: - $ref: '#/components/schemas/Attestation' - AuthenticatorTransport: - type: string - enum: - - AUTHENTICATOR_TRANSPORT_BLE - - AUTHENTICATOR_TRANSPORT_INTERNAL - - AUTHENTICATOR_TRANSPORT_NFC - - AUTHENTICATOR_TRANSPORT_USB - - AUTHENTICATOR_TRANSPORT_HYBRID - Config: - type: object - properties: - features: - type: array - items: - $ref: '#/components/schemas/Feature' - quorum: - $ref: '#/components/schemas/external.data.v1.Quorum' - CreateApiKeysIntent: - required: - - apiKeys - - userId - type: object - properties: - apiKeys: - type: array - description: A list of API Keys. - items: - $ref: '#/components/schemas/ApiKeyParams' - userId: - type: string - description: Unique identifier for a given User. - CreateApiKeysIntentV2: - required: - - apiKeys - - userId - type: object - properties: - apiKeys: - type: array - description: A list of API Keys. - items: - $ref: '#/components/schemas/ApiKeyParamsV2' - userId: - type: string - description: Unique identifier for a given User. - CreateApiKeysRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_API_KEYS_V2 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreateApiKeysIntentV2' - CreateApiKeysResult: - required: - - apiKeyIds - type: object - properties: - apiKeyIds: - type: array - description: A list of API Key IDs. - items: - type: string - CreateApiOnlyUsersIntent: - required: - - apiOnlyUsers - type: object - properties: - apiOnlyUsers: - type: array - description: A list of API-only Users to create. - items: - $ref: '#/components/schemas/ApiOnlyUserParams' - CreateApiOnlyUsersResult: - required: - - userIds - type: object - properties: - userIds: - type: array - description: A list of API-only User IDs. - items: - type: string - CreateAuthenticatorsIntent: - required: - - authenticators - - userId - type: object - properties: - authenticators: - type: array - description: A list of Authenticators. - items: - $ref: '#/components/schemas/AuthenticatorParams' - userId: - type: string - description: Unique identifier for a given User. - CreateAuthenticatorsIntentV2: - required: - - authenticators - - userId - type: object - properties: - authenticators: - type: array - description: A list of Authenticators. - items: - $ref: '#/components/schemas/AuthenticatorParamsV2' - userId: - type: string - description: Unique identifier for a given User. - CreateAuthenticatorsRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreateAuthenticatorsIntentV2' - CreateAuthenticatorsResult: - required: - - authenticatorIds - type: object - properties: - authenticatorIds: - type: array - description: A list of Authenticator IDs. - items: - type: string - CreateInvitationsIntent: - required: - - invitations - type: object - properties: - invitations: - type: array - description: A list of Invitations. - items: - $ref: '#/components/schemas/InvitationParams' - CreateInvitationsRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_INVITATIONS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreateInvitationsIntent' - CreateInvitationsResult: - required: - - invitationIds - type: object - properties: - invitationIds: - type: array - description: A list of Invitation IDs - items: - type: string - CreateOauthProvidersIntent: - required: - - oauthProviders - - userId - type: object - properties: - userId: - type: string - description: The ID of the User to add an Oauth provider to - oauthProviders: - type: array - description: A list of Oauth providers. - items: - $ref: '#/components/schemas/OauthProviderParams' - CreateOauthProvidersRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreateOauthProvidersIntent' - CreateOauthProvidersResult: - required: - - providerIds - type: object - properties: - providerIds: - type: array - description: A list of unique identifiers for Oauth Providers - items: - type: string - CreateOrganizationIntent: - required: - - organizationName - - rootAuthenticator - - rootEmail - type: object - properties: - organizationName: - type: string - description: Human-readable name for an Organization. - rootEmail: - type: string - description: The root user's email address. - rootAuthenticator: - $ref: '#/components/schemas/AuthenticatorParams' - rootUserId: - type: string - description: Unique identifier for the root user object. - nullable: true - CreateOrganizationIntentV2: - required: - - organizationName - - rootAuthenticator - - rootEmail - type: object - properties: - organizationName: - type: string - description: Human-readable name for an Organization. - rootEmail: - type: string - description: The root user's email address. - rootAuthenticator: - $ref: '#/components/schemas/AuthenticatorParamsV2' - rootUserId: - type: string - description: Unique identifier for the root user object. - nullable: true - CreateOrganizationResult: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - CreatePoliciesIntent: - required: - - policies - type: object - properties: - policies: - type: array - description: An array of policy intents to be created. - items: - $ref: '#/components/schemas/CreatePolicyIntentV3' - CreatePoliciesRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_POLICIES - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreatePoliciesIntent' - CreatePoliciesResult: - required: - - policyIds - type: object - properties: - policyIds: - type: array - description: A list of unique identifiers for the created policies. - items: - type: string - CreatePolicyIntent: - required: - - effect - - policyName - - selectors - type: object - properties: - policyName: - type: string - description: Human-readable name for a Policy. - selectors: - type: array - description: "A list of simple functions each including a subject, target\ - \ and boolean. See Policy Engine Language section for additional details." - items: - $ref: '#/components/schemas/Selector' - effect: - $ref: '#/components/schemas/Effect' - notes: - type: string - CreatePolicyIntentV2: - required: - - effect - - policyName - - selectors - type: object - properties: - policyName: - type: string - description: Human-readable name for a Policy. - selectors: - type: array - description: "A list of simple functions each including a subject, target\ - \ and boolean. See Policy Engine Language section for additional details." - items: - $ref: '#/components/schemas/SelectorV2' - effect: - $ref: '#/components/schemas/Effect' - notes: - type: string - CreatePolicyIntentV3: - required: - - effect - - policyName - type: object - properties: - policyName: - type: string - description: Human-readable name for a Policy. - effect: - $ref: '#/components/schemas/Effect' - condition: - type: string - description: The condition expression that triggers the Effect - nullable: true - consensus: - type: string - description: The consensus expression that triggers the Effect - nullable: true - notes: - type: string - CreatePolicyRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_POLICY_V3 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreatePolicyIntentV3' - CreatePolicyResult: - required: - - policyId - type: object - properties: - policyId: - type: string - description: Unique identifier for a given Policy. - CreatePrivateKeyTagIntent: - required: - - privateKeyIds - - privateKeyTagName - type: object - properties: - privateKeyTagName: - type: string - description: Human-readable name for a Private Key Tag. - privateKeyIds: - type: array - description: A list of Private Key IDs. - items: - type: string - CreatePrivateKeyTagRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreatePrivateKeyTagIntent' - CreatePrivateKeyTagResult: - required: - - privateKeyIds - - privateKeyTagId - type: object - properties: - privateKeyTagId: - type: string - description: Unique identifier for a given Private Key Tag. - privateKeyIds: - type: array - description: A list of Private Key IDs. - items: - type: string - CreatePrivateKeysIntent: - required: - - privateKeys - type: object - properties: - privateKeys: - type: array - description: A list of Private Keys. - items: - $ref: '#/components/schemas/PrivateKeyParams' - CreatePrivateKeysIntentV2: - required: - - privateKeys - type: object - properties: - privateKeys: - type: array - description: A list of Private Keys. - items: - $ref: '#/components/schemas/PrivateKeyParams' - CreatePrivateKeysRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreatePrivateKeysIntentV2' - CreatePrivateKeysResult: - required: - - privateKeyIds - type: object - properties: - privateKeyIds: - type: array - description: A list of Private Key IDs. - items: - type: string - CreatePrivateKeysResultV2: - required: - - privateKeys - type: object - properties: - privateKeys: - type: array - description: A list of Private Key IDs and addresses. - items: - $ref: '#/components/schemas/PrivateKeyResult' - CreateReadOnlySessionIntent: - type: object - CreateReadOnlySessionRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreateReadOnlySessionIntent' - CreateReadOnlySessionResult: - required: - - organizationId - - organizationName - - session - - sessionExpiry - - userId - - username - type: object - properties: - organizationId: - type: string - description: "Unique identifier for a given Organization. If the request\ - \ is being made by a user and their Sub-Organization ID is unknown, this\ - \ can be the Parent Organization ID. However, using the Sub-Organization\ - \ ID is preferred due to performance reasons." - organizationName: - type: string - description: Human-readable name for an Organization. - userId: - type: string - description: Unique identifier for a given User. - username: - type: string - description: Human-readable name for a User. - session: - type: string - description: String representing a read only session - sessionExpiry: - type: string - description: UTC timestamp in seconds representing the expiry time for the - read only session. - format: uint64 - CreateReadWriteSessionIntent: - required: - - email - - targetPublicKey - type: object - properties: - targetPublicKey: - type: string - description: "Client-side public key generated by the user, to which the\ - \ read write session bundle (credentials) will be encrypted." - email: - type: string - description: Email of the user to create a read write session for - apiKeyName: - type: string - description: "Optional human-readable name for an API Key. If none provided,\ - \ default to Read Write Session - " - nullable: true - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the API\ - \ key is valid for. If not provided, a default of 15 minutes will be used." - nullable: true - CreateReadWriteSessionIntentV2: - required: - - targetPublicKey - type: object - properties: - targetPublicKey: - type: string - description: "Client-side public key generated by the user, to which the\ - \ read write session bundle (credentials) will be encrypted." - userId: - type: string - description: Unique identifier for a given User. - nullable: true - apiKeyName: - type: string - description: "Optional human-readable name for an API Key. If none provided,\ - \ default to Read Write Session - " - nullable: true - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the API\ - \ key is valid for. If not provided, a default of 15 minutes will be used." - nullable: true - invalidateExisting: - type: boolean - description: Invalidate all other previously generated ReadWriteSession - API keys - nullable: true - CreateReadWriteSessionRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreateReadWriteSessionIntentV2' - CreateReadWriteSessionResult: - required: - - apiKeyId - - credentialBundle - - organizationId - - organizationName - - userId - - username - type: object - properties: - organizationId: - type: string - description: "Unique identifier for a given Organization. If the request\ - \ is being made by a user and their Sub-Organization ID is unknown, this\ - \ can be the Parent Organization ID. However, using the Sub-Organization\ - \ ID is preferred due to performance reasons." - organizationName: - type: string - description: Human-readable name for an Organization. - userId: - type: string - description: Unique identifier for a given User. - username: - type: string - description: Human-readable name for a User. - apiKeyId: - type: string - description: Unique identifier for the created API key. - credentialBundle: - type: string - description: HPKE encrypted credential bundle - CreateReadWriteSessionResultV2: - required: - - apiKeyId - - credentialBundle - - organizationId - - organizationName - - userId - - username - type: object - properties: - organizationId: - type: string - description: "Unique identifier for a given Organization. If the request\ - \ is being made by a user and their Sub-Organization ID is unknown, this\ - \ can be the Parent Organization ID. However, using the Sub-Organization\ - \ ID is preferred due to performance reasons." - organizationName: - type: string - description: Human-readable name for an Organization. - userId: - type: string - description: Unique identifier for a given User. - username: - type: string - description: Human-readable name for a User. - apiKeyId: - type: string - description: Unique identifier for the created API key. - credentialBundle: - type: string - description: HPKE encrypted credential bundle - CreateSubOrganizationIntent: - required: - - name - - rootAuthenticator - type: object - properties: - name: - type: string - description: Name for this sub-organization - rootAuthenticator: - $ref: '#/components/schemas/AuthenticatorParamsV2' - CreateSubOrganizationIntentV2: - required: - - rootQuorumThreshold - - rootUsers - - subOrganizationName - type: object - properties: - subOrganizationName: - type: string - description: Name for this sub-organization - rootUsers: - type: array - description: Root users to create within this sub-organization - items: - $ref: '#/components/schemas/RootUserParams' - rootQuorumThreshold: - type: integer - description: The threshold of unique approvals to reach root quorum. This - value must be less than or equal to the number of root users - format: int32 - CreateSubOrganizationIntentV3: - required: - - privateKeys - - rootQuorumThreshold - - rootUsers - - subOrganizationName - type: object - properties: - subOrganizationName: - type: string - description: Name for this sub-organization - rootUsers: - type: array - description: Root users to create within this sub-organization - items: - $ref: '#/components/schemas/RootUserParams' - rootQuorumThreshold: - type: integer - description: The threshold of unique approvals to reach root quorum. This - value must be less than or equal to the number of root users - format: int32 - privateKeys: - type: array - description: A list of Private Keys. - items: - $ref: '#/components/schemas/PrivateKeyParams' - CreateSubOrganizationIntentV4: - required: - - rootQuorumThreshold - - rootUsers - - subOrganizationName - type: object - properties: - subOrganizationName: - type: string - description: Name for this sub-organization - rootUsers: - type: array - description: Root users to create within this sub-organization - items: - $ref: '#/components/schemas/RootUserParams' - rootQuorumThreshold: - type: integer - description: The threshold of unique approvals to reach root quorum. This - value must be less than or equal to the number of root users - format: int32 - wallet: - $ref: '#/components/schemas/WalletParams' - disableEmailRecovery: - type: boolean - description: Disable email recovery for the sub-organization - nullable: true - disableEmailAuth: - type: boolean - description: Disable email auth for the sub-organization - nullable: true - CreateSubOrganizationIntentV5: - required: - - rootQuorumThreshold - - rootUsers - - subOrganizationName - type: object - properties: - subOrganizationName: - type: string - description: Name for this sub-organization - rootUsers: - type: array - description: Root users to create within this sub-organization - items: - $ref: '#/components/schemas/RootUserParamsV2' - rootQuorumThreshold: - type: integer - description: The threshold of unique approvals to reach root quorum. This - value must be less than or equal to the number of root users - format: int32 - wallet: - $ref: '#/components/schemas/WalletParams' - disableEmailRecovery: - type: boolean - description: Disable email recovery for the sub-organization - nullable: true - disableEmailAuth: - type: boolean - description: Disable email auth for the sub-organization - nullable: true - CreateSubOrganizationIntentV6: - required: - - rootQuorumThreshold - - rootUsers - - subOrganizationName - type: object - properties: - subOrganizationName: - type: string - description: Name for this sub-organization - rootUsers: - type: array - description: Root users to create within this sub-organization - items: - $ref: '#/components/schemas/RootUserParamsV3' - rootQuorumThreshold: - type: integer - description: The threshold of unique approvals to reach root quorum. This - value must be less than or equal to the number of root users - format: int32 - wallet: - $ref: '#/components/schemas/WalletParams' - disableEmailRecovery: - type: boolean - description: Disable email recovery for the sub-organization - nullable: true - disableEmailAuth: - type: boolean - description: Disable email auth for the sub-organization - nullable: true - CreateSubOrganizationIntentV7: - required: - - rootQuorumThreshold - - rootUsers - - subOrganizationName - type: object - properties: - subOrganizationName: - type: string - description: Name for this sub-organization - rootUsers: - type: array - description: Root users to create within this sub-organization - items: - $ref: '#/components/schemas/RootUserParamsV4' - rootQuorumThreshold: - type: integer - description: The threshold of unique approvals to reach root quorum. This - value must be less than or equal to the number of root users - format: int32 - wallet: - $ref: '#/components/schemas/WalletParams' - disableEmailRecovery: - type: boolean - description: Disable email recovery for the sub-organization - nullable: true - disableEmailAuth: - type: boolean - description: Disable email auth for the sub-organization - nullable: true - disableSmsAuth: - type: boolean - description: Disable OTP SMS auth for the sub-organization - nullable: true - disableOtpEmailAuth: - type: boolean - description: Disable OTP email auth for the sub-organization - nullable: true - CreateSubOrganizationRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreateSubOrganizationIntentV7' - CreateSubOrganizationResult: - required: - - subOrganizationId - type: object - properties: - subOrganizationId: - type: string - rootUserIds: - type: array - items: - type: string - CreateSubOrganizationResultV3: - required: - - privateKeys - - subOrganizationId - type: object - properties: - subOrganizationId: - type: string - privateKeys: - type: array - description: A list of Private Key IDs and addresses. - items: - $ref: '#/components/schemas/PrivateKeyResult' - rootUserIds: - type: array - items: - type: string - CreateSubOrganizationResultV4: - required: - - subOrganizationId - type: object - properties: - subOrganizationId: - type: string - wallet: - $ref: '#/components/schemas/WalletResult' - rootUserIds: - type: array - items: - type: string - CreateSubOrganizationResultV5: - required: - - subOrganizationId - type: object - properties: - subOrganizationId: - type: string - wallet: - $ref: '#/components/schemas/WalletResult' - rootUserIds: - type: array - items: - type: string - CreateSubOrganizationResultV6: - required: - - subOrganizationId - type: object - properties: - subOrganizationId: - type: string - wallet: - $ref: '#/components/schemas/WalletResult' - rootUserIds: - type: array - items: - type: string - CreateSubOrganizationResultV7: - required: - - subOrganizationId - type: object - properties: - subOrganizationId: - type: string - wallet: - $ref: '#/components/schemas/WalletResult' - rootUserIds: - type: array - items: - type: string - CreateUserTagIntent: - required: - - userIds - - userTagName - type: object - properties: - userTagName: - type: string - description: Human-readable name for a User Tag. - userIds: - type: array - description: A list of User IDs. - items: - type: string - CreateUserTagRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_USER_TAG - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreateUserTagIntent' - CreateUserTagResult: - required: - - userIds - - userTagId - type: object - properties: - userTagId: - type: string - description: Unique identifier for a given User Tag. - userIds: - type: array - description: A list of User IDs. - items: - type: string - CreateUsersIntent: - required: - - users - type: object - properties: - users: - type: array - description: A list of Users. - items: - $ref: '#/components/schemas/UserParams' - CreateUsersIntentV2: - required: - - users - type: object - properties: - users: - type: array - description: A list of Users. - items: - $ref: '#/components/schemas/UserParamsV2' - CreateUsersIntentV3: - required: - - users - type: object - properties: - users: - type: array - description: A list of Users. - items: - $ref: '#/components/schemas/UserParamsV3' - CreateUsersRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_USERS_V3 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreateUsersIntentV3' - CreateUsersResult: - required: - - userIds - type: object - properties: - userIds: - type: array - description: A list of User IDs. - items: - type: string - CreateWalletAccountsIntent: - required: - - accounts - - walletId - type: object - properties: - walletId: - type: string - description: Unique identifier for a given Wallet. - accounts: - type: array - description: A list of wallet Accounts. - items: - $ref: '#/components/schemas/WalletAccountParams' - CreateWalletAccountsRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreateWalletAccountsIntent' - CreateWalletAccountsResult: - required: - - addresses - type: object - properties: - addresses: - type: array - description: A list of derived addresses. - items: - type: string - CreateWalletIntent: - required: - - accounts - - walletName - type: object - properties: - walletName: - type: string - description: Human-readable name for a Wallet. - accounts: - type: array - description: "A list of wallet Accounts. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/WalletAccountParams' - mnemonicLength: - type: integer - description: "Length of mnemonic to generate the Wallet seed. Defaults to\ - \ 12. Accepted values: 12, 15, 18, 21, 24." - format: int32 - nullable: true - CreateWalletRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_CREATE_WALLET - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/CreateWalletIntent' - CreateWalletResult: - required: - - addresses - - walletId - type: object - properties: - walletId: - type: string - description: Unique identifier for a Wallet. - addresses: - type: array - description: A list of account addresses. - items: - type: string - CredPropsAuthenticationExtensionsClientOutputs: - required: - - rk - type: object - properties: - rk: - type: boolean - CredentialType: - type: string - enum: - - CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR - - CREDENTIAL_TYPE_API_KEY_P256 - - CREDENTIAL_TYPE_RECOVER_USER_KEY_P256 - - CREDENTIAL_TYPE_API_KEY_SECP256K1 - - CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256 - - CREDENTIAL_TYPE_API_KEY_ED25519 - - CREDENTIAL_TYPE_OTP_AUTH_KEY_P256 - - CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256 - - CREDENTIAL_TYPE_OAUTH_KEY_P256 - - CREDENTIAL_TYPE_LOGIN - Curve: - type: string - enum: - - CURVE_SECP256K1 - - CURVE_ED25519 - DeleteApiKeysIntent: - required: - - apiKeyIds - - userId - type: object - properties: - userId: - type: string - description: Unique identifier for a given User. - apiKeyIds: - type: array - description: A list of API Key IDs. - items: - type: string - DeleteApiKeysRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_DELETE_API_KEYS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/DeleteApiKeysIntent' - DeleteApiKeysResult: - required: - - apiKeyIds - type: object - properties: - apiKeyIds: - type: array - description: A list of API Key IDs. - items: - type: string - DeleteAuthenticatorsIntent: - required: - - authenticatorIds - - userId - type: object - properties: - userId: - type: string - description: Unique identifier for a given User. - authenticatorIds: - type: array - description: A list of Authenticator IDs. - items: - type: string - DeleteAuthenticatorsRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_DELETE_AUTHENTICATORS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/DeleteAuthenticatorsIntent' - DeleteAuthenticatorsResult: - required: - - authenticatorIds - type: object - properties: - authenticatorIds: - type: array - description: Unique identifier for a given Authenticator. - items: - type: string - DeleteInvitationIntent: - required: - - invitationId - type: object - properties: - invitationId: - type: string - description: Unique identifier for a given Invitation object. - DeleteInvitationRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_DELETE_INVITATION - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/DeleteInvitationIntent' - DeleteInvitationResult: - required: - - invitationId - type: object - properties: - invitationId: - type: string - description: Unique identifier for a given Invitation. - DeleteOauthProvidersIntent: - required: - - providerIds - - userId - type: object - properties: - userId: - type: string - description: The ID of the User to remove an Oauth provider from - providerIds: - type: array - description: Unique identifier for a given Provider. - items: - type: string - DeleteOauthProvidersRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/DeleteOauthProvidersIntent' - DeleteOauthProvidersResult: - required: - - providerIds - type: object - properties: - providerIds: - type: array - description: A list of unique identifiers for Oauth Providers - items: - type: string - DeleteOrganizationIntent: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - DeleteOrganizationResult: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - DeletePaymentMethodIntent: - required: - - paymentMethodId - type: object - properties: - paymentMethodId: - type: string - description: The payment method that the customer wants to remove. - nullable: true - DeletePaymentMethodResult: - required: - - paymentMethodId - type: object - properties: - paymentMethodId: - type: string - description: The payment method that was removed. - DeletePolicyIntent: - required: - - policyId - type: object - properties: - policyId: - type: string - description: Unique identifier for a given Policy. - DeletePolicyRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_DELETE_POLICY - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/DeletePolicyIntent' - DeletePolicyResult: - required: - - policyId - type: object - properties: - policyId: - type: string - description: Unique identifier for a given Policy. - DeletePrivateKeyTagsIntent: - required: - - privateKeyTagIds - type: object - properties: - privateKeyTagIds: - type: array - description: A list of Private Key Tag IDs. - items: - type: string - DeletePrivateKeyTagsRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/DeletePrivateKeyTagsIntent' - DeletePrivateKeyTagsResult: - required: - - privateKeyIds - - privateKeyTagIds - type: object - properties: - privateKeyTagIds: - type: array - description: A list of Private Key Tag IDs. - items: - type: string - privateKeyIds: - type: array - description: A list of Private Key IDs. - items: - type: string - DeletePrivateKeysIntent: - required: - - privateKeyIds - type: object - properties: - privateKeyIds: - type: array - description: List of unique identifiers for private keys within an organization - items: - type: string - deleteWithoutExport: - type: boolean - description: "Optional parameter for deleting the private keys, even if\ - \ any have not been previously exported. If they have been exported, this\ - \ field is ignored." - nullable: true - DeletePrivateKeysRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_DELETE_PRIVATE_KEYS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/DeletePrivateKeysIntent' - DeletePrivateKeysResult: - required: - - privateKeyIds - type: object - properties: - privateKeyIds: - type: array - description: A list of private key unique identifiers that were removed - items: - type: string - DeleteSubOrganizationIntent: - type: object - properties: - deleteWithoutExport: - type: boolean - description: "Sub-organization deletion, by default, requires associated\ - \ wallets and private keys to be exported for security reasons. Set this\ - \ boolean to true to force sub-organization deletion even if some wallets\ - \ or private keys within it have not been exported yet. Default: false." - nullable: true - DeleteSubOrganizationRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/DeleteSubOrganizationIntent' - DeleteSubOrganizationResult: - required: - - subOrganizationUuid - type: object - properties: - subOrganizationUuid: - type: string - description: Unique identifier of the sub organization that was removed - DeleteUserTagsIntent: - required: - - userTagIds - type: object - properties: - userTagIds: - type: array - description: A list of User Tag IDs. - items: - type: string - DeleteUserTagsRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_DELETE_USER_TAGS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/DeleteUserTagsIntent' - DeleteUserTagsResult: - required: - - userIds - - userTagIds - type: object - properties: - userTagIds: - type: array - description: A list of User Tag IDs. - items: - type: string - userIds: - type: array - description: A list of User IDs. - items: - type: string - DeleteUsersIntent: - required: - - userIds - type: object - properties: - userIds: - type: array - description: A list of User IDs. - items: - type: string - DeleteUsersRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_DELETE_USERS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/DeleteUsersIntent' - DeleteUsersResult: - required: - - userIds - type: object - properties: - userIds: - type: array - description: A list of User IDs. - items: - type: string - DeleteWalletsIntent: - required: - - walletIds - type: object - properties: - walletIds: - type: array - description: List of unique identifiers for wallets within an organization - items: - type: string - deleteWithoutExport: - type: boolean - description: "Optional parameter for deleting the wallets, even if any have\ - \ not been previously exported. If they have been exported, this field\ - \ is ignored." - nullable: true - DeleteWalletsRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_DELETE_WALLETS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/DeleteWalletsIntent' - DeleteWalletsResult: - required: - - walletIds - type: object - properties: - walletIds: - type: array - description: A list of wallet unique identifiers that were removed - items: - type: string - DisablePrivateKeyIntent: - required: - - privateKeyId - type: object - properties: - privateKeyId: - type: string - description: Unique identifier for a given Private Key. - DisablePrivateKeyResult: - required: - - privateKeyId - type: object - properties: - privateKeyId: - type: string - description: Unique identifier for a given Private Key. - Effect: - type: string - enum: - - EFFECT_ALLOW - - EFFECT_DENY - EmailAuthIntent: - required: - - email - - targetPublicKey - type: object - properties: - email: - type: string - description: Email of the authenticating user. - targetPublicKey: - type: string - description: "Client-side public key generated by the user, to which the\ - \ email auth bundle (credentials) will be encrypted." - apiKeyName: - type: string - description: "Optional human-readable name for an API Key. If none provided,\ - \ default to Email Auth - " - nullable: true - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the API\ - \ key is valid for. If not provided, a default of 15 minutes will be used." - nullable: true - emailCustomization: - $ref: '#/components/schemas/EmailCustomizationParams' - invalidateExisting: - type: boolean - description: Invalidate all other previously generated Email Auth API keys - nullable: true - sendFromEmailAddress: - type: string - description: Optional custom email address from which to send the email - nullable: true - sendFromEmailSenderName: - type: string - description: "Optional custom sender name for use with sendFromEmailAddress;\ - \ if left empty, will default to 'Notifications'" - nullable: true - replyToEmailAddress: - type: string - description: Optional custom email address to use as reply-to - nullable: true - EmailAuthIntentV2: - required: - - email - - targetPublicKey - type: object - properties: - email: - type: string - description: Email of the authenticating user. - targetPublicKey: - type: string - description: "Client-side public key generated by the user, to which the\ - \ email auth bundle (credentials) will be encrypted." - apiKeyName: - type: string - description: "Optional human-readable name for an API Key. If none provided,\ - \ default to Email Auth - " - nullable: true - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the API\ - \ key is valid for. If not provided, a default of 15 minutes will be used." - nullable: true - emailCustomization: - $ref: '#/components/schemas/EmailCustomizationParams' - invalidateExisting: - type: boolean - description: Invalidate all other previously generated Email Auth API keys - nullable: true - sendFromEmailAddress: - type: string - description: Optional custom email address from which to send the email - nullable: true - sendFromEmailSenderName: - type: string - description: "Optional custom sender name for use with sendFromEmailAddress;\ - \ if left empty, will default to 'Notifications'" - nullable: true - replyToEmailAddress: - type: string - description: Optional custom email address to use as reply-to - nullable: true - EmailAuthRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_EMAIL_AUTH_V2 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/EmailAuthIntentV2' - EmailAuthResult: - required: - - apiKeyId - - userId - type: object - properties: - userId: - type: string - description: Unique identifier for the authenticating User. - apiKeyId: - type: string - description: Unique identifier for the created API key. - EmailCustomizationParams: - type: object - properties: - appName: - type: string - description: The name of the application. - nullable: true - logoUrl: - type: string - description: A URL pointing to a logo in PNG format. Note this logo will - be resized to fit into 340px x 124px. - nullable: true - magicLinkTemplate: - type: string - description: "A template for the URL to be used in a magic link button,\ - \ e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into\ - \ the `%s`." - nullable: true - templateVariables: - type: string - description: JSON object containing key/value pairs to be used with custom - templates. - nullable: true - templateId: - type: string - description: "Unique identifier for a given Email Template. If not specified,\ - \ the default is the most recent Email Template." - nullable: true - ExportPrivateKeyIntent: - required: - - privateKeyId - - targetPublicKey - type: object - properties: - privateKeyId: - type: string - description: Unique identifier for a given Private Key. - targetPublicKey: - type: string - description: "Client-side public key generated by the user, to which the\ - \ export bundle will be encrypted." - ExportPrivateKeyRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_EXPORT_PRIVATE_KEY - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/ExportPrivateKeyIntent' - ExportPrivateKeyResult: - required: - - exportBundle - - privateKeyId - type: object - properties: - privateKeyId: - type: string - description: Unique identifier for a given Private Key. - exportBundle: - type: string - description: Export bundle containing a private key encrypted to the client's - target public key. - ExportWalletAccountIntent: - required: - - address - - targetPublicKey - type: object - properties: - address: - type: string - description: Address to identify Wallet Account. - targetPublicKey: - type: string - description: "Client-side public key generated by the user, to which the\ - \ export bundle will be encrypted." - ExportWalletAccountRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/ExportWalletAccountIntent' - ExportWalletAccountResult: - required: - - address - - exportBundle - type: object - properties: - address: - type: string - description: Address to identify Wallet Account. - exportBundle: - type: string - description: Export bundle containing a private key encrypted by the client's - target public key. - ExportWalletIntent: - required: - - targetPublicKey - - walletId - type: object - properties: - walletId: - type: string - description: Unique identifier for a given Wallet. - targetPublicKey: - type: string - description: "Client-side public key generated by the user, to which the\ - \ export bundle will be encrypted." - language: - $ref: '#/components/schemas/MnemonicLanguage' - ExportWalletRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_EXPORT_WALLET - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/ExportWalletIntent' - ExportWalletResult: - required: - - exportBundle - - walletId - type: object - properties: - walletId: - type: string - description: Unique identifier for a given Wallet. - exportBundle: - type: string - description: Export bundle containing a wallet mnemonic + optional newline - passphrase encrypted by the client's target public key. - Feature: - type: object - properties: - name: - $ref: '#/components/schemas/FeatureName' - value: - type: string - nullable: true - FeatureName: - type: string - enum: - - FEATURE_NAME_ROOT_USER_EMAIL_RECOVERY - - FEATURE_NAME_WEBAUTHN_ORIGINS - - FEATURE_NAME_EMAIL_AUTH - - FEATURE_NAME_EMAIL_RECOVERY - - FEATURE_NAME_WEBHOOK - - FEATURE_NAME_SMS_AUTH - - FEATURE_NAME_OTP_EMAIL_AUTH - GetActivitiesRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - filterByStatus: - type: array - description: Array of Activity Statuses filtering which Activities will - be listed in the response. - items: - $ref: '#/components/schemas/ActivityStatus' - paginationOptions: - $ref: '#/components/schemas/Pagination' - filterByType: - type: array - description: Array of Activity Types filtering which Activities will be - listed in the response. - items: - $ref: '#/components/schemas/ActivityType' - GetActivitiesResponse: - required: - - activities - type: object - properties: - activities: - type: array - description: A list of Activities. - items: - $ref: '#/components/schemas/Activity' - GetActivityRequest: - required: - - activityId - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - activityId: - type: string - description: Unique identifier for a given Activity object. - GetApiKeyRequest: - required: - - apiKeyId - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - apiKeyId: - type: string - description: Unique identifier for a given API key. - GetApiKeyResponse: - required: - - apiKey - type: object - properties: - apiKey: - $ref: '#/components/schemas/ApiKey' - GetApiKeysRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - userId: - type: string - description: Unique identifier for a given User. - nullable: true - GetApiKeysResponse: - required: - - apiKeys - type: object - properties: - apiKeys: - type: array - description: A list of API keys. - items: - $ref: '#/components/schemas/ApiKey' - GetAuthenticatorRequest: - required: - - authenticatorId - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - authenticatorId: - type: string - description: Unique identifier for a given Authenticator. - GetAuthenticatorResponse: - required: - - authenticator - type: object - properties: - authenticator: - $ref: '#/components/schemas/Authenticator' - GetAuthenticatorsRequest: - required: - - organizationId - - userId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - userId: - type: string - description: Unique identifier for a given User. - GetAuthenticatorsResponse: - required: - - authenticators - type: object - properties: - authenticators: - type: array - description: A list of authenticators. - items: - $ref: '#/components/schemas/Authenticator' - GetOauthProvidersRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - userId: - type: string - description: Unique identifier for a given User. - nullable: true - GetOauthProvidersResponse: - required: - - oauthProviders - type: object - properties: - oauthProviders: - type: array - description: A list of Oauth Providers - items: - $ref: '#/components/schemas/OauthProvider' - GetOrganizationConfigsRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - GetOrganizationConfigsResponse: - required: - - configs - type: object - properties: - configs: - $ref: '#/components/schemas/Config' - GetPoliciesRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - GetPoliciesResponse: - required: - - policies - type: object - properties: - policies: - type: array - description: A list of Policies. - items: - $ref: '#/components/schemas/Policy' - GetPolicyRequest: - required: - - organizationId - - policyId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - policyId: - type: string - description: Unique identifier for a given Policy. - GetPolicyResponse: - required: - - policy - type: object - properties: - policy: - $ref: '#/components/schemas/Policy' - GetPrivateKeyRequest: - required: - - organizationId - - privateKeyId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - privateKeyId: - type: string - description: Unique identifier for a given Private Key. - GetPrivateKeyResponse: - required: - - privateKey - type: object - properties: - privateKey: - $ref: '#/components/schemas/PrivateKey' - GetPrivateKeysRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - GetPrivateKeysResponse: - required: - - privateKeys - type: object - properties: - privateKeys: - type: array - description: A list of Private Keys. - items: - $ref: '#/components/schemas/PrivateKey' - GetSubOrgIdsRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for the parent Organization. This is used - to find sub-organizations within it. - filterType: - type: string - description: "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID',\ - \ 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY'" - filterValue: - type: string - description: "The value of the filter to apply for the specified type. For\ - \ example, a specific email or name string." - paginationOptions: - $ref: '#/components/schemas/Pagination' - GetSubOrgIdsResponse: - required: - - organizationIds - type: object - properties: - organizationIds: - type: array - description: List of unique identifiers for the matching sub-organizations. - items: - type: string - GetUserRequest: - required: - - organizationId - - userId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - userId: - type: string - description: Unique identifier for a given User. - GetUserResponse: - required: - - user - type: object - properties: - user: - $ref: '#/components/schemas/User' - GetUsersRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - GetUsersResponse: - required: - - users - type: object - properties: - users: - type: array - description: A list of Users. - items: - $ref: '#/components/schemas/User' - GetVerifiedSubOrgIdsRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for the parent Organization. This is used - to find sub-organizations within it. - filterType: - type: string - description: "Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'" - filterValue: - type: string - description: "The value of the filter to apply for the specified type. For\ - \ example, a specific email or phone number string." - paginationOptions: - $ref: '#/components/schemas/Pagination' - GetVerifiedSubOrgIdsResponse: - required: - - organizationIds - type: object - properties: - organizationIds: - type: array - description: List of unique identifiers for the matching sub-organizations. - items: - type: string - GetWalletAccountRequest: - required: - - organizationId - - walletId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - walletId: - type: string - description: Unique identifier for a given Wallet. - address: - type: string - description: Address corresponding to a Wallet Account. - nullable: true - path: - type: string - description: Path corresponding to a Wallet Account. - nullable: true - GetWalletAccountResponse: - required: - - account - type: object - properties: - account: - $ref: '#/components/schemas/WalletAccount' - GetWalletAccountsRequest: - required: - - organizationId - - walletId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - walletId: - type: string - description: Unique identifier for a given Wallet. - paginationOptions: - $ref: '#/components/schemas/Pagination' - GetWalletAccountsResponse: - required: - - accounts - type: object - properties: - accounts: - type: array - description: A list of Accounts generated from a Wallet that share a common - seed. - items: - $ref: '#/components/schemas/WalletAccount' - GetWalletRequest: - required: - - organizationId - - walletId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - walletId: - type: string - description: Unique identifier for a given Wallet. - GetWalletResponse: - required: - - wallet - type: object - properties: - wallet: - $ref: '#/components/schemas/Wallet' - GetWalletsRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - GetWalletsResponse: - required: - - wallets - type: object - properties: - wallets: - type: array - description: A list of Wallets. - items: - $ref: '#/components/schemas/Wallet' - GetWhoamiRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: "Unique identifier for a given Organization. If the request\ - \ is being made by a WebAuthN user and their Sub-Organization ID is unknown,\ - \ this can be the Parent Organization ID; using the Sub-Organization ID\ - \ when possible is preferred due to performance reasons." - GetWhoamiResponse: - required: - - organizationId - - organizationName - - userId - - username - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - organizationName: - type: string - description: Human-readable name for an Organization. - userId: - type: string - description: Unique identifier for a given User. - username: - type: string - description: Human-readable name for a User. - HashFunction: - type: string - enum: - - HASH_FUNCTION_NO_OP - - HASH_FUNCTION_SHA256 - - HASH_FUNCTION_KECCAK256 - - HASH_FUNCTION_NOT_APPLICABLE - ImportPrivateKeyIntent: - required: - - addressFormats - - curve - - encryptedBundle - - privateKeyName - - userId - type: object - properties: - userId: - type: string - description: The ID of the User importing a Private Key. - privateKeyName: - type: string - description: Human-readable name for a Private Key. - encryptedBundle: - type: string - description: Bundle containing a raw private key encrypted to the enclave's - target public key. - curve: - $ref: '#/components/schemas/Curve' - addressFormats: - type: array - description: "Cryptocurrency-specific formats for a derived address (e.g.,\ - \ Ethereum)." - items: - $ref: '#/components/schemas/AddressFormat' - ImportPrivateKeyRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_IMPORT_PRIVATE_KEY - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/ImportPrivateKeyIntent' - ImportPrivateKeyResult: - required: - - addresses - - privateKeyId - type: object - properties: - privateKeyId: - type: string - description: Unique identifier for a Private Key. - addresses: - type: array - description: A list of addresses. - items: - $ref: '#/components/schemas/activity.v1.Address' - ImportWalletIntent: - required: - - accounts - - encryptedBundle - - userId - - walletName - type: object - properties: - userId: - type: string - description: The ID of the User importing a Wallet. - walletName: - type: string - description: Human-readable name for a Wallet. - encryptedBundle: - type: string - description: Bundle containing a wallet mnemonic encrypted to the enclave's - target public key. - accounts: - type: array - description: A list of wallet Accounts. - items: - $ref: '#/components/schemas/WalletAccountParams' - ImportWalletRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_IMPORT_WALLET - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/ImportWalletIntent' - ImportWalletResult: - required: - - addresses - - walletId - type: object - properties: - walletId: - type: string - description: Unique identifier for a Wallet. - addresses: - type: array - description: A list of account addresses. - items: - type: string - InitImportPrivateKeyIntent: - required: - - userId - type: object - properties: - userId: - type: string - description: The ID of the User importing a Private Key. - InitImportPrivateKeyRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/InitImportPrivateKeyIntent' - InitImportPrivateKeyResult: - required: - - importBundle - type: object - properties: - importBundle: - type: string - description: Import bundle containing a public key and signature to use - for importing client data. - InitImportWalletIntent: - required: - - userId - type: object - properties: - userId: - type: string - description: The ID of the User importing a Wallet. - InitImportWalletRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_INIT_IMPORT_WALLET - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/InitImportWalletIntent' - InitImportWalletResult: - required: - - importBundle - type: object - properties: - importBundle: - type: string - description: Import bundle containing a public key and signature to use - for importing client data. - InitOtpAuthIntent: - required: - - contact - - otpType - type: object - properties: - otpType: - type: string - description: Enum to specifiy whether to send OTP via SMS or email - contact: - type: string - description: Email or phone number to send the OTP code to - emailCustomization: - $ref: '#/components/schemas/EmailCustomizationParams' - smsCustomization: - $ref: '#/components/schemas/SmsCustomizationParams' - userIdentifier: - type: string - description: Optional client-generated user identifier to enable per-user - rate limiting for SMS auth. We recommend using a hash of the client-side - IP address. - nullable: true - sendFromEmailAddress: - type: string - description: Optional custom email address from which to send the OTP email - nullable: true - sendFromEmailSenderName: - type: string - description: "Optional custom sender name for use with sendFromEmailAddress;\ - \ if left empty, will default to 'Notifications'" - nullable: true - replyToEmailAddress: - type: string - description: Optional custom email address to use as reply-to - nullable: true - InitOtpAuthIntentV2: - required: - - contact - - otpType - type: object - properties: - otpType: - type: string - description: Enum to specifiy whether to send OTP via SMS or email - contact: - type: string - description: Email or phone number to send the OTP code to - otpLength: - type: integer - description: Optional length of the OTP code. Default = 9 - format: int32 - nullable: true - emailCustomization: - $ref: '#/components/schemas/EmailCustomizationParams' - smsCustomization: - $ref: '#/components/schemas/SmsCustomizationParams' - userIdentifier: - type: string - description: Optional client-generated user identifier to enable per-user - rate limiting for SMS auth. We recommend using a hash of the client-side - IP address. - nullable: true - sendFromEmailAddress: - type: string - description: Optional custom email address from which to send the OTP email - nullable: true - alphanumeric: - type: boolean - description: Optional flag to specify if the OTP code should be alphanumeric - (Crockford’s Base32). Default = true - nullable: true - sendFromEmailSenderName: - type: string - description: "Optional custom sender name for use with sendFromEmailAddress;\ - \ if left empty, will default to 'Notifications'" - nullable: true - replyToEmailAddress: - type: string - description: Optional custom email address to use as reply-to - nullable: true - InitOtpAuthRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_INIT_OTP_AUTH_V2 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/InitOtpAuthIntentV2' - InitOtpAuthResult: - required: - - otpId - type: object - properties: - otpId: - type: string - description: Unique identifier for an OTP authentication - InitOtpAuthResultV2: - required: - - otpId - type: object - properties: - otpId: - type: string - description: Unique identifier for an OTP authentication - InitOtpIntent: - required: - - contact - - otpType - type: object - properties: - otpType: - type: string - description: "Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS,\ - \ OTP_TYPE_EMAIL" - contact: - type: string - description: Email or phone number to send the OTP code to - otpLength: - type: integer - description: Optional length of the OTP code. Default = 9 - format: int32 - nullable: true - emailCustomization: - $ref: '#/components/schemas/EmailCustomizationParams' - smsCustomization: - $ref: '#/components/schemas/SmsCustomizationParams' - userIdentifier: - type: string - description: Optional client-generated user identifier to enable per-user - rate limiting for SMS auth. We recommend using a hash of the client-side - IP address. - nullable: true - sendFromEmailAddress: - type: string - description: Optional custom email address from which to send the OTP email - nullable: true - alphanumeric: - type: boolean - description: Optional flag to specify if the OTP code should be alphanumeric - (Crockford’s Base32). Default = true - nullable: true - sendFromEmailSenderName: - type: string - description: "Optional custom sender name for use with sendFromEmailAddress;\ - \ if left empty, will default to 'Notifications'" - nullable: true - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the OTP\ - \ is valid for. If not provided, a default of 5 minutes will be used.\ - \ Maximum value is 600 seconds (10 minutes)" - nullable: true - replyToEmailAddress: - type: string - description: Optional custom email address to use as reply-to - nullable: true - InitOtpRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_INIT_OTP - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/InitOtpIntent' - InitOtpResult: - required: - - otpId - type: object - properties: - otpId: - type: string - description: Unique identifier for an OTP authentication - InitUserEmailRecoveryIntent: - required: - - email - - targetPublicKey - type: object - properties: - email: - type: string - description: Email of the user starting recovery - targetPublicKey: - type: string - description: "Client-side public key generated by the user, to which the\ - \ recovery bundle will be encrypted." - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the recovery\ - \ credential is valid for. If not provided, a default of 15 minutes will\ - \ be used." - nullable: true - emailCustomization: - $ref: '#/components/schemas/EmailCustomizationParams' - InitUserEmailRecoveryRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/InitUserEmailRecoveryIntent' - InitUserEmailRecoveryResult: - required: - - userId - type: object - properties: - userId: - type: string - description: Unique identifier for the user being recovered. - Intent: - type: object - properties: - createOrganizationIntent: - $ref: '#/components/schemas/CreateOrganizationIntent' - createAuthenticatorsIntent: - $ref: '#/components/schemas/CreateAuthenticatorsIntent' - createUsersIntent: - $ref: '#/components/schemas/CreateUsersIntent' - createPrivateKeysIntent: - $ref: '#/components/schemas/CreatePrivateKeysIntent' - signRawPayloadIntent: - $ref: '#/components/schemas/SignRawPayloadIntent' - createInvitationsIntent: - $ref: '#/components/schemas/CreateInvitationsIntent' - acceptInvitationIntent: - $ref: '#/components/schemas/AcceptInvitationIntent' - createPolicyIntent: - $ref: '#/components/schemas/CreatePolicyIntent' - disablePrivateKeyIntent: - $ref: '#/components/schemas/DisablePrivateKeyIntent' - deleteUsersIntent: - $ref: '#/components/schemas/DeleteUsersIntent' - deleteAuthenticatorsIntent: - $ref: '#/components/schemas/DeleteAuthenticatorsIntent' - deleteInvitationIntent: - $ref: '#/components/schemas/DeleteInvitationIntent' - deleteOrganizationIntent: - $ref: '#/components/schemas/DeleteOrganizationIntent' - deletePolicyIntent: - $ref: '#/components/schemas/DeletePolicyIntent' - createUserTagIntent: - $ref: '#/components/schemas/CreateUserTagIntent' - deleteUserTagsIntent: - $ref: '#/components/schemas/DeleteUserTagsIntent' - signTransactionIntent: - $ref: '#/components/schemas/SignTransactionIntent' - createApiKeysIntent: - $ref: '#/components/schemas/CreateApiKeysIntent' - deleteApiKeysIntent: - $ref: '#/components/schemas/DeleteApiKeysIntent' - approveActivityIntent: - $ref: '#/components/schemas/ApproveActivityIntent' - rejectActivityIntent: - $ref: '#/components/schemas/RejectActivityIntent' - createPrivateKeyTagIntent: - $ref: '#/components/schemas/CreatePrivateKeyTagIntent' - deletePrivateKeyTagsIntent: - $ref: '#/components/schemas/DeletePrivateKeyTagsIntent' - createPolicyIntentV2: - $ref: '#/components/schemas/CreatePolicyIntentV2' - setPaymentMethodIntent: - $ref: '#/components/schemas/SetPaymentMethodIntent' - activateBillingTierIntent: - $ref: '#/components/schemas/ActivateBillingTierIntent' - deletePaymentMethodIntent: - $ref: '#/components/schemas/DeletePaymentMethodIntent' - createPolicyIntentV3: - $ref: '#/components/schemas/CreatePolicyIntentV3' - createApiOnlyUsersIntent: - $ref: '#/components/schemas/CreateApiOnlyUsersIntent' - updateRootQuorumIntent: - $ref: '#/components/schemas/UpdateRootQuorumIntent' - updateUserTagIntent: - $ref: '#/components/schemas/UpdateUserTagIntent' - updatePrivateKeyTagIntent: - $ref: '#/components/schemas/UpdatePrivateKeyTagIntent' - createAuthenticatorsIntentV2: - $ref: '#/components/schemas/CreateAuthenticatorsIntentV2' - acceptInvitationIntentV2: - $ref: '#/components/schemas/AcceptInvitationIntentV2' - createOrganizationIntentV2: - $ref: '#/components/schemas/CreateOrganizationIntentV2' - createUsersIntentV2: - $ref: '#/components/schemas/CreateUsersIntentV2' - createSubOrganizationIntent: - $ref: '#/components/schemas/CreateSubOrganizationIntent' - createSubOrganizationIntentV2: - $ref: '#/components/schemas/CreateSubOrganizationIntentV2' - updateAllowedOriginsIntent: - $ref: '#/components/schemas/UpdateAllowedOriginsIntent' - createPrivateKeysIntentV2: - $ref: '#/components/schemas/CreatePrivateKeysIntentV2' - updateUserIntent: - $ref: '#/components/schemas/UpdateUserIntent' - updatePolicyIntent: - $ref: '#/components/schemas/UpdatePolicyIntent' - setPaymentMethodIntentV2: - $ref: '#/components/schemas/SetPaymentMethodIntentV2' - createSubOrganizationIntentV3: - $ref: '#/components/schemas/CreateSubOrganizationIntentV3' - createWalletIntent: - $ref: '#/components/schemas/CreateWalletIntent' - createWalletAccountsIntent: - $ref: '#/components/schemas/CreateWalletAccountsIntent' - initUserEmailRecoveryIntent: - $ref: '#/components/schemas/InitUserEmailRecoveryIntent' - recoverUserIntent: - $ref: '#/components/schemas/RecoverUserIntent' - setOrganizationFeatureIntent: - $ref: '#/components/schemas/SetOrganizationFeatureIntent' - removeOrganizationFeatureIntent: - $ref: '#/components/schemas/RemoveOrganizationFeatureIntent' - signRawPayloadIntentV2: - $ref: '#/components/schemas/SignRawPayloadIntentV2' - signTransactionIntentV2: - $ref: '#/components/schemas/SignTransactionIntentV2' - exportPrivateKeyIntent: - $ref: '#/components/schemas/ExportPrivateKeyIntent' - exportWalletIntent: - $ref: '#/components/schemas/ExportWalletIntent' - createSubOrganizationIntentV4: - $ref: '#/components/schemas/CreateSubOrganizationIntentV4' - emailAuthIntent: - $ref: '#/components/schemas/EmailAuthIntent' - exportWalletAccountIntent: - $ref: '#/components/schemas/ExportWalletAccountIntent' - initImportWalletIntent: - $ref: '#/components/schemas/InitImportWalletIntent' - importWalletIntent: - $ref: '#/components/schemas/ImportWalletIntent' - initImportPrivateKeyIntent: - $ref: '#/components/schemas/InitImportPrivateKeyIntent' - importPrivateKeyIntent: - $ref: '#/components/schemas/ImportPrivateKeyIntent' - createPoliciesIntent: - $ref: '#/components/schemas/CreatePoliciesIntent' - signRawPayloadsIntent: - $ref: '#/components/schemas/SignRawPayloadsIntent' - createReadOnlySessionIntent: - $ref: '#/components/schemas/CreateReadOnlySessionIntent' - createOauthProvidersIntent: - $ref: '#/components/schemas/CreateOauthProvidersIntent' - deleteOauthProvidersIntent: - $ref: '#/components/schemas/DeleteOauthProvidersIntent' - createSubOrganizationIntentV5: - $ref: '#/components/schemas/CreateSubOrganizationIntentV5' - oauthIntent: - $ref: '#/components/schemas/OauthIntent' - createApiKeysIntentV2: - $ref: '#/components/schemas/CreateApiKeysIntentV2' - createReadWriteSessionIntent: - $ref: '#/components/schemas/CreateReadWriteSessionIntent' - emailAuthIntentV2: - $ref: '#/components/schemas/EmailAuthIntentV2' - createSubOrganizationIntentV6: - $ref: '#/components/schemas/CreateSubOrganizationIntentV6' - deletePrivateKeysIntent: - $ref: '#/components/schemas/DeletePrivateKeysIntent' - deleteWalletsIntent: - $ref: '#/components/schemas/DeleteWalletsIntent' - createReadWriteSessionIntentV2: - $ref: '#/components/schemas/CreateReadWriteSessionIntentV2' - deleteSubOrganizationIntent: - $ref: '#/components/schemas/DeleteSubOrganizationIntent' - initOtpAuthIntent: - $ref: '#/components/schemas/InitOtpAuthIntent' - otpAuthIntent: - $ref: '#/components/schemas/OtpAuthIntent' - createSubOrganizationIntentV7: - $ref: '#/components/schemas/CreateSubOrganizationIntentV7' - updateWalletIntent: - $ref: '#/components/schemas/UpdateWalletIntent' - updatePolicyIntentV2: - $ref: '#/components/schemas/UpdatePolicyIntentV2' - createUsersIntentV3: - $ref: '#/components/schemas/CreateUsersIntentV3' - initOtpAuthIntentV2: - $ref: '#/components/schemas/InitOtpAuthIntentV2' - initOtpIntent: - $ref: '#/components/schemas/InitOtpIntent' - verifyOtpIntent: - $ref: '#/components/schemas/VerifyOtpIntent' - otpLoginIntent: - $ref: '#/components/schemas/OtpLoginIntent' - stampLoginIntent: - $ref: '#/components/schemas/StampLoginIntent' - oauthLoginIntent: - $ref: '#/components/schemas/OauthLoginIntent' - updateUserNameIntent: - $ref: '#/components/schemas/UpdateUserNameIntent' - updateUserEmailIntent: - $ref: '#/components/schemas/UpdateUserEmailIntent' - updateUserPhoneNumberIntent: - $ref: '#/components/schemas/UpdateUserPhoneNumberIntent' - InvitationParams: - required: - - accessType - - receiverUserEmail - - receiverUserName - - receiverUserTags - - senderUserId - type: object - properties: - receiverUserName: - type: string - description: The name of the intended Invitation recipient. - receiverUserEmail: - type: string - description: The email address of the intended Invitation recipient. - receiverUserTags: - type: array - description: "A list of tags assigned to the Invitation recipient. This\ - \ field, if not needed, should be an empty array in your request body." - items: - type: string - accessType: - $ref: '#/components/schemas/AccessType' - senderUserId: - type: string - description: Unique identifier for the Sender of an Invitation. - ListPrivateKeyTagsRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - ListPrivateKeyTagsResponse: - required: - - privateKeyTags - type: object - properties: - privateKeyTags: - type: array - description: A list of Private Key Tags - items: - $ref: '#/components/schemas/v1.Tag' - ListUserTagsRequest: - required: - - organizationId - type: object - properties: - organizationId: - type: string - description: Unique identifier for a given Organization. - ListUserTagsResponse: - required: - - userTags - type: object - properties: - userTags: - type: array - description: A list of User Tags - items: - $ref: '#/components/schemas/v1.Tag' - MnemonicLanguage: - type: string - enum: - - MNEMONIC_LANGUAGE_ENGLISH - - MNEMONIC_LANGUAGE_SIMPLIFIED_CHINESE - - MNEMONIC_LANGUAGE_TRADITIONAL_CHINESE - - MNEMONIC_LANGUAGE_CZECH - - MNEMONIC_LANGUAGE_FRENCH - - MNEMONIC_LANGUAGE_ITALIAN - - MNEMONIC_LANGUAGE_JAPANESE - - MNEMONIC_LANGUAGE_KOREAN - - MNEMONIC_LANGUAGE_SPANISH - OauthIntent: - required: - - oidcToken - - targetPublicKey - type: object - properties: - oidcToken: - type: string - description: Base64 encoded OIDC token - targetPublicKey: - type: string - description: "Client-side public key generated by the user, to which the\ - \ oauth bundle (credentials) will be encrypted." - apiKeyName: - type: string - description: "Optional human-readable name for an API Key. If none provided,\ - \ default to Oauth - " - nullable: true - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the API\ - \ key is valid for. If not provided, a default of 15 minutes will be used." - nullable: true - invalidateExisting: - type: boolean - description: Invalidate all other previously generated Oauth API keys - nullable: true - OauthLoginIntent: - required: - - oidcToken - - publicKey - type: object - properties: - oidcToken: - type: string - description: Base64 encoded OIDC token - publicKey: - type: string - description: "Client-side public key generated by the user, which will be\ - \ conditionally added to org data based on the validity of the oidc token\ - \ associated with this request" - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the Session\ - \ is valid for. If not provided, a default of 15 minutes will be used." - nullable: true - invalidateExisting: - type: boolean - description: Invalidate all other previously generated Login API keys - nullable: true - OauthLoginRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_OAUTH_LOGIN - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/OauthLoginIntent' - OauthLoginResult: - required: - - session - type: object - properties: - session: - type: string - description: "Signed JWT containing an expiry, public key, session type,\ - \ user id, and organization id" - OauthProvider: - required: - - audience - - createdAt - - issuer - - providerId - - providerName - - subject - - updatedAt - type: object - properties: - providerId: - type: string - description: Unique identifier for an OAuth Provider - providerName: - type: string - description: Human-readable name to identify a Provider. - issuer: - type: string - description: "The issuer of the token, typically a URL indicating the authentication\ - \ server, e.g https://accounts.google.com" - audience: - type: string - description: Expected audience ('aud' attribute of the signed token) which - represents the app ID - subject: - type: string - description: Expected subject ('sub' attribute of the signed token) which - represents the user ID - createdAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - updatedAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - OauthProviderParams: - required: - - oidcToken - - providerName - type: object - properties: - providerName: - type: string - description: Human-readable name to identify a Provider. - oidcToken: - type: string - description: Base64 encoded OIDC token - OauthRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_OAUTH - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/OauthIntent' - OauthResult: - required: - - apiKeyId - - credentialBundle - - userId - type: object - properties: - userId: - type: string - description: Unique identifier for the authenticating User. - apiKeyId: - type: string - description: Unique identifier for the created API key. - credentialBundle: - type: string - description: HPKE encrypted credential bundle - Operator: - type: string - enum: - - OPERATOR_EQUAL - - OPERATOR_MORE_THAN - - OPERATOR_MORE_THAN_OR_EQUAL - - OPERATOR_LESS_THAN - - OPERATOR_LESS_THAN_OR_EQUAL - - OPERATOR_CONTAINS - - OPERATOR_NOT_EQUAL - - OPERATOR_IN - - OPERATOR_NOT_IN - - OPERATOR_CONTAINS_ONE - - OPERATOR_CONTAINS_ALL - OtpAuthIntent: - required: - - otpCode - - otpId - - targetPublicKey - type: object - properties: - otpId: - type: string - description: ID representing the result of an init OTP activity. - otpCode: - type: string - description: OTP sent out to a user's contact (email or SMS) - targetPublicKey: - type: string - description: "Client-side public key generated by the user, to which the\ - \ OTP bundle (credentials) will be encrypted." - apiKeyName: - type: string - description: "Optional human-readable name for an API Key. If none provided,\ - \ default to OTP Auth - " - nullable: true - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the API\ - \ key is valid for. If not provided, a default of 15 minutes will be used." - nullable: true - invalidateExisting: - type: boolean - description: Invalidate all other previously generated OTP Auth API keys - nullable: true - OtpAuthRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_OTP_AUTH - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/OtpAuthIntent' - OtpAuthResult: - required: - - userId - type: object - properties: - userId: - type: string - description: Unique identifier for the authenticating User. - apiKeyId: - type: string - description: Unique identifier for the created API key. - credentialBundle: - type: string - description: HPKE encrypted credential bundle - OtpLoginIntent: - required: - - publicKey - - verificationToken - type: object - properties: - verificationToken: - type: string - description: "Signed JWT containing a unique id, expiry, verification type,\ - \ contact" - publicKey: - type: string - description: "Client-side public key generated by the user, which will be\ - \ conditionally added to org data based on the validity of the verification\ - \ token" - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the Session\ - \ is valid for. If not provided, a default of 15 minutes will be used." - nullable: true - invalidateExisting: - type: boolean - description: Invalidate all other previously generated Login API keys - nullable: true - OtpLoginRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_OTP_LOGIN - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/OtpLoginIntent' - OtpLoginResult: - required: - - session - type: object - properties: - session: - type: string - description: "Signed JWT containing an expiry, public key, session type,\ - \ user id, and organization id" - Pagination: - type: object - properties: - limit: - type: string - description: "A limit of the number of object to be returned, between 1\ - \ and 100. Defaults to 10." - before: - type: string - description: A pagination cursor. This is an object ID that enables you - to fetch all objects before this ID. - after: - type: string - description: A pagination cursor. This is an object ID that enables you - to fetch all objects after this ID. - PathFormat: - type: string - enum: - - PATH_FORMAT_BIP32 - PayloadEncoding: - type: string - enum: - - PAYLOAD_ENCODING_HEXADECIMAL - - PAYLOAD_ENCODING_TEXT_UTF8 - Policy: - required: - - condition - - consensus - - createdAt - - effect - - notes - - policyId - - policyName - - updatedAt - type: object - properties: - policyId: - type: string - description: Unique identifier for a given Policy. - policyName: - type: string - description: Human-readable name for a Policy. - effect: - $ref: '#/components/schemas/Effect' - createdAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - updatedAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - notes: - type: string - description: Human-readable notes added by a User to describe a particular - policy. - consensus: - type: string - description: A consensus expression that evalutes to true or false. - nullable: true - condition: - type: string - description: A condition expression that evalutes to true or false. - nullable: true - PrivateKey: - required: - - addresses - - createdAt - - curve - - exported - - imported - - privateKeyId - - privateKeyName - - privateKeyTags - - publicKey - - updatedAt - type: object - properties: - privateKeyId: - type: string - description: Unique identifier for a given Private Key. - publicKey: - type: string - description: The public component of a cryptographic key pair used to sign - messages and transactions. - privateKeyName: - type: string - description: Human-readable name for a Private Key. - curve: - $ref: '#/components/schemas/Curve' - addresses: - type: array - description: Derived cryptocurrency addresses for a given Private Key. - items: - $ref: '#/components/schemas/data.v1.Address' - privateKeyTags: - type: array - description: A list of Private Key Tag IDs. - items: - type: string - createdAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - updatedAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - exported: - type: boolean - description: "True when a given Private Key is exported, false otherwise." - imported: - type: boolean - description: "True when a given Private Key is imported, false otherwise." - PrivateKeyParams: - required: - - addressFormats - - curve - - privateKeyName - - privateKeyTags - type: object - properties: - privateKeyName: - type: string - description: Human-readable name for a Private Key. - curve: - $ref: '#/components/schemas/Curve' - privateKeyTags: - type: array - description: "A list of Private Key Tag IDs. This field, if not needed,\ - \ should be an empty array in your request body." - items: - type: string - addressFormats: - type: array - description: "Cryptocurrency-specific formats for a derived address (e.g.,\ - \ Ethereum)." - items: - $ref: '#/components/schemas/AddressFormat' - PrivateKeyResult: - type: object - properties: - privateKeyId: - type: string - addresses: - type: array - items: - $ref: '#/components/schemas/activity.v1.Address' - PublicKeyCredentialWithAttestation: - required: - - clientExtensionResults - - id - - rawId - - response - - type - type: object - properties: - id: - type: string - type: - type: string - enum: - - public-key - rawId: - type: string - authenticatorAttachment: - type: string - nullable: true - enum: - - cross-platform - - platform - response: - $ref: '#/components/schemas/AuthenticatorAttestationResponse' - clientExtensionResults: - $ref: '#/components/schemas/SimpleClientExtensionResults' - RecoverUserIntent: - required: - - authenticator - - userId - type: object - properties: - authenticator: - $ref: '#/components/schemas/AuthenticatorParamsV2' - userId: - type: string - description: Unique identifier for the user performing recovery. - RecoverUserRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_RECOVER_USER - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/RecoverUserIntent' - RecoverUserResult: - required: - - authenticatorId - type: object - properties: - authenticatorId: - type: array - description: ID of the authenticator created. - items: - type: string - RejectActivityIntent: - required: - - fingerprint - type: object - properties: - fingerprint: - type: string - description: An artifact verifying a User's action. - RejectActivityRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_REJECT_ACTIVITY - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/RejectActivityIntent' - RemoveOrganizationFeatureIntent: - required: - - name - type: object - properties: - name: - $ref: '#/components/schemas/FeatureName' - RemoveOrganizationFeatureRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/RemoveOrganizationFeatureIntent' - RemoveOrganizationFeatureResult: - required: - - features - type: object - properties: - features: - type: array - description: Resulting list of organization features. - items: - $ref: '#/components/schemas/Feature' - Result: - type: object - properties: - createOrganizationResult: - $ref: '#/components/schemas/CreateOrganizationResult' - createAuthenticatorsResult: - $ref: '#/components/schemas/CreateAuthenticatorsResult' - createUsersResult: - $ref: '#/components/schemas/CreateUsersResult' - createPrivateKeysResult: - $ref: '#/components/schemas/CreatePrivateKeysResult' - createInvitationsResult: - $ref: '#/components/schemas/CreateInvitationsResult' - acceptInvitationResult: - $ref: '#/components/schemas/AcceptInvitationResult' - signRawPayloadResult: - $ref: '#/components/schemas/SignRawPayloadResult' - createPolicyResult: - $ref: '#/components/schemas/CreatePolicyResult' - disablePrivateKeyResult: - $ref: '#/components/schemas/DisablePrivateKeyResult' - deleteUsersResult: - $ref: '#/components/schemas/DeleteUsersResult' - deleteAuthenticatorsResult: - $ref: '#/components/schemas/DeleteAuthenticatorsResult' - deleteInvitationResult: - $ref: '#/components/schemas/DeleteInvitationResult' - deleteOrganizationResult: - $ref: '#/components/schemas/DeleteOrganizationResult' - deletePolicyResult: - $ref: '#/components/schemas/DeletePolicyResult' - createUserTagResult: - $ref: '#/components/schemas/CreateUserTagResult' - deleteUserTagsResult: - $ref: '#/components/schemas/DeleteUserTagsResult' - signTransactionResult: - $ref: '#/components/schemas/SignTransactionResult' - deleteApiKeysResult: - $ref: '#/components/schemas/DeleteApiKeysResult' - createApiKeysResult: - $ref: '#/components/schemas/CreateApiKeysResult' - createPrivateKeyTagResult: - $ref: '#/components/schemas/CreatePrivateKeyTagResult' - deletePrivateKeyTagsResult: - $ref: '#/components/schemas/DeletePrivateKeyTagsResult' - setPaymentMethodResult: - $ref: '#/components/schemas/SetPaymentMethodResult' - activateBillingTierResult: - $ref: '#/components/schemas/ActivateBillingTierResult' - deletePaymentMethodResult: - $ref: '#/components/schemas/DeletePaymentMethodResult' - createApiOnlyUsersResult: - $ref: '#/components/schemas/CreateApiOnlyUsersResult' - updateRootQuorumResult: - $ref: '#/components/schemas/UpdateRootQuorumResult' - updateUserTagResult: - $ref: '#/components/schemas/UpdateUserTagResult' - updatePrivateKeyTagResult: - $ref: '#/components/schemas/UpdatePrivateKeyTagResult' - createSubOrganizationResult: - $ref: '#/components/schemas/CreateSubOrganizationResult' - updateAllowedOriginsResult: - $ref: '#/components/schemas/UpdateAllowedOriginsResult' - createPrivateKeysResultV2: - $ref: '#/components/schemas/CreatePrivateKeysResultV2' - updateUserResult: - $ref: '#/components/schemas/UpdateUserResult' - updatePolicyResult: - $ref: '#/components/schemas/UpdatePolicyResult' - createSubOrganizationResultV3: - $ref: '#/components/schemas/CreateSubOrganizationResultV3' - createWalletResult: - $ref: '#/components/schemas/CreateWalletResult' - createWalletAccountsResult: - $ref: '#/components/schemas/CreateWalletAccountsResult' - initUserEmailRecoveryResult: - $ref: '#/components/schemas/InitUserEmailRecoveryResult' - recoverUserResult: - $ref: '#/components/schemas/RecoverUserResult' - setOrganizationFeatureResult: - $ref: '#/components/schemas/SetOrganizationFeatureResult' - removeOrganizationFeatureResult: - $ref: '#/components/schemas/RemoveOrganizationFeatureResult' - exportPrivateKeyResult: - $ref: '#/components/schemas/ExportPrivateKeyResult' - exportWalletResult: - $ref: '#/components/schemas/ExportWalletResult' - createSubOrganizationResultV4: - $ref: '#/components/schemas/CreateSubOrganizationResultV4' - emailAuthResult: - $ref: '#/components/schemas/EmailAuthResult' - exportWalletAccountResult: - $ref: '#/components/schemas/ExportWalletAccountResult' - initImportWalletResult: - $ref: '#/components/schemas/InitImportWalletResult' - importWalletResult: - $ref: '#/components/schemas/ImportWalletResult' - initImportPrivateKeyResult: - $ref: '#/components/schemas/InitImportPrivateKeyResult' - importPrivateKeyResult: - $ref: '#/components/schemas/ImportPrivateKeyResult' - createPoliciesResult: - $ref: '#/components/schemas/CreatePoliciesResult' - signRawPayloadsResult: - $ref: '#/components/schemas/SignRawPayloadsResult' - createReadOnlySessionResult: - $ref: '#/components/schemas/CreateReadOnlySessionResult' - createOauthProvidersResult: - $ref: '#/components/schemas/CreateOauthProvidersResult' - deleteOauthProvidersResult: - $ref: '#/components/schemas/DeleteOauthProvidersResult' - createSubOrganizationResultV5: - $ref: '#/components/schemas/CreateSubOrganizationResultV5' - oauthResult: - $ref: '#/components/schemas/OauthResult' - createReadWriteSessionResult: - $ref: '#/components/schemas/CreateReadWriteSessionResult' - createSubOrganizationResultV6: - $ref: '#/components/schemas/CreateSubOrganizationResultV6' - deletePrivateKeysResult: - $ref: '#/components/schemas/DeletePrivateKeysResult' - deleteWalletsResult: - $ref: '#/components/schemas/DeleteWalletsResult' - createReadWriteSessionResultV2: - $ref: '#/components/schemas/CreateReadWriteSessionResultV2' - deleteSubOrganizationResult: - $ref: '#/components/schemas/DeleteSubOrganizationResult' - initOtpAuthResult: - $ref: '#/components/schemas/InitOtpAuthResult' - otpAuthResult: - $ref: '#/components/schemas/OtpAuthResult' - createSubOrganizationResultV7: - $ref: '#/components/schemas/CreateSubOrganizationResultV7' - updateWalletResult: - $ref: '#/components/schemas/UpdateWalletResult' - updatePolicyResultV2: - $ref: '#/components/schemas/UpdatePolicyResultV2' - initOtpAuthResultV2: - $ref: '#/components/schemas/InitOtpAuthResultV2' - initOtpResult: - $ref: '#/components/schemas/InitOtpResult' - verifyOtpResult: - $ref: '#/components/schemas/VerifyOtpResult' - otpLoginResult: - $ref: '#/components/schemas/OtpLoginResult' - stampLoginResult: - $ref: '#/components/schemas/StampLoginResult' - oauthLoginResult: - $ref: '#/components/schemas/OauthLoginResult' - updateUserNameResult: - $ref: '#/components/schemas/UpdateUserNameResult' - updateUserEmailResult: - $ref: '#/components/schemas/UpdateUserEmailResult' - updateUserPhoneNumberResult: - $ref: '#/components/schemas/UpdateUserPhoneNumberResult' - RootUserParams: - required: - - apiKeys - - authenticators - - userName - type: object - properties: - userName: - type: string - description: Human-readable name for a User. - userEmail: - type: string - description: The user's email address. - nullable: true - apiKeys: - type: array - description: "A list of API Key parameters. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/ApiKeyParams' - authenticators: - type: array - description: "A list of Authenticator parameters. This field, if not needed,\ - \ should be an empty array in your request body." - items: - $ref: '#/components/schemas/AuthenticatorParamsV2' - RootUserParamsV2: - required: - - apiKeys - - authenticators - - oauthProviders - - userName - type: object - properties: - userName: - type: string - description: Human-readable name for a User. - userEmail: - type: string - description: The user's email address. - nullable: true - apiKeys: - type: array - description: "A list of API Key parameters. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/ApiKeyParams' - authenticators: - type: array - description: "A list of Authenticator parameters. This field, if not needed,\ - \ should be an empty array in your request body." - items: - $ref: '#/components/schemas/AuthenticatorParamsV2' - oauthProviders: - type: array - description: "A list of Oauth providers. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/OauthProviderParams' - RootUserParamsV3: - required: - - apiKeys - - authenticators - - oauthProviders - - userName - type: object - properties: - userName: - type: string - description: Human-readable name for a User. - userEmail: - type: string - description: The user's email address. - nullable: true - apiKeys: - type: array - description: "A list of API Key parameters. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/ApiKeyParamsV2' - authenticators: - type: array - description: "A list of Authenticator parameters. This field, if not needed,\ - \ should be an empty array in your request body." - items: - $ref: '#/components/schemas/AuthenticatorParamsV2' - oauthProviders: - type: array - description: "A list of Oauth providers. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/OauthProviderParams' - RootUserParamsV4: - required: - - apiKeys - - authenticators - - oauthProviders - - userName - type: object - properties: - userName: - type: string - description: Human-readable name for a User. - userEmail: - type: string - description: The user's email address. - nullable: true - userPhoneNumber: - type: string - description: The user's phone number in E.164 format e.g. +13214567890 - nullable: true - apiKeys: - type: array - description: "A list of API Key parameters. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/ApiKeyParamsV2' - authenticators: - type: array - description: "A list of Authenticator parameters. This field, if not needed,\ - \ should be an empty array in your request body." - items: - $ref: '#/components/schemas/AuthenticatorParamsV2' - oauthProviders: - type: array - description: "A list of Oauth providers. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/OauthProviderParams' - Selector: - type: object - properties: - subject: - type: string - operator: - $ref: '#/components/schemas/Operator' - target: - type: string - SelectorV2: - type: object - properties: - subject: - type: string - operator: - $ref: '#/components/schemas/Operator' - targets: - type: array - items: - type: string - SetOrganizationFeatureIntent: - required: - - name - - value - type: object - properties: - name: - $ref: '#/components/schemas/FeatureName' - value: - type: string - description: Optional value for the feature. Will override existing values - if feature is already set. - nullable: true - SetOrganizationFeatureRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/SetOrganizationFeatureIntent' - SetOrganizationFeatureResult: - required: - - features - type: object - properties: - features: - type: array - description: Resulting list of organization features. - items: - $ref: '#/components/schemas/Feature' - SetPaymentMethodIntent: - required: - - cardHolderEmail - - cardHolderName - - cvv - - expiryMonth - - expiryYear - - number - type: object - properties: - number: - type: string - description: The account number of the customer's credit card. - cvv: - type: string - description: The verification digits of the customer's credit card. - expiryMonth: - type: string - description: The month that the credit card expires. - expiryYear: - type: string - description: The year that the credit card expires. - cardHolderEmail: - type: string - description: The email that will receive invoices for the credit card. - cardHolderName: - type: string - description: The name associated with the credit card. - SetPaymentMethodIntentV2: - required: - - cardHolderEmail - - cardHolderName - - paymentMethodId - type: object - properties: - paymentMethodId: - type: string - description: The id of the payment method that was created clientside. - cardHolderEmail: - type: string - description: The email that will receive invoices for the credit card. - cardHolderName: - type: string - description: The name associated with the credit card. - SetPaymentMethodResult: - required: - - cardHolderEmail - - cardHolderName - - lastFour - type: object - properties: - lastFour: - type: string - description: The last four digits of the credit card added. - cardHolderName: - type: string - description: The name associated with the payment method. - cardHolderEmail: - type: string - description: The email address associated with the payment method. - SignRawPayloadIntent: - required: - - encoding - - hashFunction - - payload - - privateKeyId - type: object - properties: - privateKeyId: - type: string - description: Unique identifier for a given Private Key. - payload: - type: string - description: Raw unsigned payload to be signed. - encoding: - $ref: '#/components/schemas/PayloadEncoding' - hashFunction: - $ref: '#/components/schemas/HashFunction' - SignRawPayloadIntentV2: - required: - - encoding - - hashFunction - - payload - - signWith - type: object - properties: - signWith: - type: string - description: "A Wallet account address, Private Key address, or Private\ - \ Key identifier." - payload: - type: string - description: Raw unsigned payload to be signed. - encoding: - $ref: '#/components/schemas/PayloadEncoding' - hashFunction: - $ref: '#/components/schemas/HashFunction' - SignRawPayloadRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/SignRawPayloadIntentV2' - SignRawPayloadResult: - required: - - r - - s - - v - type: object - properties: - r: - type: string - description: Component of an ECSDA signature. - s: - type: string - description: Component of an ECSDA signature. - v: - type: string - description: Component of an ECSDA signature. - SignRawPayloadsIntent: - required: - - encoding - - hashFunction - - payloads - - signWith - type: object - properties: - signWith: - type: string - description: "A Wallet account address, Private Key address, or Private\ - \ Key identifier." - payloads: - type: array - description: An array of raw unsigned payloads to be signed. - items: - type: string - encoding: - $ref: '#/components/schemas/PayloadEncoding' - hashFunction: - $ref: '#/components/schemas/HashFunction' - SignRawPayloadsRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_SIGN_RAW_PAYLOADS - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/SignRawPayloadsIntent' - SignRawPayloadsResult: - type: object - properties: - signatures: - type: array - items: - $ref: '#/components/schemas/SignRawPayloadResult' - SignTransactionIntent: - required: - - privateKeyId - - type - - unsignedTransaction - type: object - properties: - privateKeyId: - type: string - description: Unique identifier for a given Private Key. - unsignedTransaction: - type: string - description: Raw unsigned transaction to be signed by a particular Private - Key. - type: - $ref: '#/components/schemas/TransactionType' - SignTransactionIntentV2: - required: - - signWith - - type - - unsignedTransaction - type: object - properties: - signWith: - type: string - description: "A Wallet account address, Private Key address, or Private\ - \ Key identifier." - unsignedTransaction: - type: string - description: Raw unsigned transaction to be signed - type: - $ref: '#/components/schemas/TransactionType' - SignTransactionRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_SIGN_TRANSACTION_V2 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/SignTransactionIntentV2' - SignTransactionResult: - required: - - signedTransaction - type: object - properties: - signedTransaction: - type: string - SimpleClientExtensionResults: - type: object - properties: - appid: - type: boolean - nullable: true - appidExclude: - type: boolean - nullable: true - credProps: - $ref: '#/components/schemas/CredPropsAuthenticationExtensionsClientOutputs' - SmsCustomizationParams: - type: object - properties: - template: - type: string - description: "Template containing references to .OtpCode i.e Your OTP is\ - \ {{.OtpCode}}" - nullable: true - StampLoginIntent: - required: - - publicKey - type: object - properties: - publicKey: - type: string - description: "Client-side public key generated by the user, which will be\ - \ conditionally added to org data based on the passkey stamp associated\ - \ with this request" - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the Session\ - \ is valid for. If not provided, a default of 15 minutes will be used." - nullable: true - invalidateExisting: - type: boolean - description: Invalidate all other previously generated Login API keys - nullable: true - StampLoginRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_STAMP_LOGIN - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/StampLoginIntent' - StampLoginResult: - required: - - session - type: object - properties: - session: - type: string - description: "Signed JWT containing an expiry, public key, session type,\ - \ user id, and organization id" - Status: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - $ref: '#/components/schemas/Any' - TagType: - type: string - enum: - - TAG_TYPE_USER - - TAG_TYPE_PRIVATE_KEY - TransactionType: - type: string - enum: - - TRANSACTION_TYPE_ETHEREUM - - TRANSACTION_TYPE_SOLANA - - TRANSACTION_TYPE_TRON - UpdateAllowedOriginsIntent: - required: - - allowedOrigins - type: object - properties: - allowedOrigins: - type: array - description: Additional origins requests are allowed from besides Turnkey - origins - items: - type: string - UpdateAllowedOriginsResult: - type: object - UpdatePolicyIntent: - required: - - policyId - type: object - properties: - policyId: - type: string - description: Unique identifier for a given Policy. - policyName: - type: string - description: Human-readable name for a Policy. - nullable: true - policyEffect: - $ref: '#/components/schemas/Effect' - policyCondition: - type: string - description: The condition expression that triggers the Effect (optional). - nullable: true - policyConsensus: - type: string - description: The consensus expression that triggers the Effect (optional). - nullable: true - policyNotes: - type: string - description: Accompanying notes for a Policy (optional). - nullable: true - UpdatePolicyIntentV2: - required: - - policyId - type: object - properties: - policyId: - type: string - description: Unique identifier for a given Policy. - policyName: - type: string - description: Human-readable name for a Policy. - nullable: true - policyEffect: - $ref: '#/components/schemas/Effect' - policyCondition: - type: string - description: The condition expression that triggers the Effect (optional). - nullable: true - policyConsensus: - type: string - description: The consensus expression that triggers the Effect (optional). - nullable: true - policyNotes: - type: string - description: Accompanying notes for a Policy (optional). - nullable: true - UpdatePolicyRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_UPDATE_POLICY_V2 - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/UpdatePolicyIntentV2' - UpdatePolicyResult: - required: - - policyId - type: object - properties: - policyId: - type: string - description: Unique identifier for a given Policy. - UpdatePolicyResultV2: - required: - - policyId - type: object - properties: - policyId: - type: string - description: Unique identifier for a given Policy. - UpdatePrivateKeyTagIntent: - required: - - addPrivateKeyIds - - privateKeyTagId - - removePrivateKeyIds - type: object - properties: - privateKeyTagId: - type: string - description: Unique identifier for a given Private Key Tag. - newPrivateKeyTagName: - type: string - description: "The new, human-readable name for the tag with the given ID." - nullable: true - addPrivateKeyIds: - type: array - description: A list of Private Keys IDs to add this tag to. - items: - type: string - removePrivateKeyIds: - type: array - description: A list of Private Key IDs to remove this tag from. - items: - type: string - UpdatePrivateKeyTagRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/UpdatePrivateKeyTagIntent' - UpdatePrivateKeyTagResult: - required: - - privateKeyTagId - type: object - properties: - privateKeyTagId: - type: string - description: Unique identifier for a given Private Key Tag. - UpdateRootQuorumIntent: - required: - - threshold - - userIds - type: object - properties: - threshold: - type: integer - description: The threshold of unique approvals to reach quorum. - format: int32 - userIds: - type: array - description: The unique identifiers of users who comprise the quorum set. - items: - type: string - UpdateRootQuorumRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_UPDATE_ROOT_QUORUM - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/UpdateRootQuorumIntent' - UpdateRootQuorumResult: - type: object - UpdateUserEmailIntent: - required: - - userEmail - - userId - type: object - properties: - userId: - type: string - description: Unique identifier for a given User. - userEmail: - type: string - description: The user's email address. Setting this to an empty string will - remove the user's email. - verificationToken: - type: string - description: "Signed JWT containing a unique id, expiry, verification type,\ - \ contact" - nullable: true - UpdateUserEmailRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_UPDATE_USER_EMAIL - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/UpdateUserEmailIntent' - UpdateUserEmailResult: - required: - - userId - type: object - properties: - userId: - type: string - description: Unique identifier of the User whose email was updated. - UpdateUserIntent: - required: - - userId - type: object - properties: - userId: - type: string - description: Unique identifier for a given User. - userName: - type: string - description: Human-readable name for a User. - nullable: true - userEmail: - type: string - description: The user's email address. - nullable: true - userTagIds: - type: array - description: "An updated list of User Tags to apply to this User. This field,\ - \ if not needed, should be an empty array in your request body." - items: - type: string - userPhoneNumber: - type: string - description: The user's phone number in E.164 format e.g. +13214567890 - nullable: true - UpdateUserNameIntent: - required: - - userId - - userName - type: object - properties: - userId: - type: string - description: Unique identifier for a given User. - userName: - type: string - description: Human-readable name for a User. - UpdateUserNameRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_UPDATE_USER_NAME - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/UpdateUserNameIntent' - UpdateUserNameResult: - required: - - userId - type: object - properties: - userId: - type: string - description: Unique identifier of the User whose name was updated. - UpdateUserPhoneNumberIntent: - required: - - userId - - userPhoneNumber - type: object - properties: - userId: - type: string - description: Unique identifier for a given User. - userPhoneNumber: - type: string - description: The user's phone number in E.164 format e.g. +13214567890. - Setting this to an empty string will remove the user's phone number. - verificationToken: - type: string - description: "Signed JWT containing a unique id, expiry, verification type,\ - \ contact" - nullable: true - UpdateUserPhoneNumberRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/UpdateUserPhoneNumberIntent' - UpdateUserPhoneNumberResult: - required: - - userId - type: object - properties: - userId: - type: string - description: Unique identifier of the User whose phone number was updated. - UpdateUserRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_UPDATE_USER - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/UpdateUserIntent' - UpdateUserResult: - required: - - userId - type: object - properties: - userId: - type: string - description: A User ID. - UpdateUserTagIntent: - required: - - addUserIds - - removeUserIds - - userTagId - type: object - properties: - userTagId: - type: string - description: Unique identifier for a given User Tag. - newUserTagName: - type: string - description: "The new, human-readable name for the tag with the given ID." - nullable: true - addUserIds: - type: array - description: A list of User IDs to add this tag to. - items: - type: string - removeUserIds: - type: array - description: A list of User IDs to remove this tag from. - items: - type: string - UpdateUserTagRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_UPDATE_USER_TAG - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/UpdateUserTagIntent' - UpdateUserTagResult: - required: - - userTagId - type: object - properties: - userTagId: - type: string - description: Unique identifier for a given User Tag. - UpdateWalletIntent: - required: - - walletId - type: object - properties: - walletId: - type: string - description: Unique identifier for a given Wallet. - walletName: - type: string - description: Human-readable name for a Wallet. - UpdateWalletRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_UPDATE_WALLET - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/UpdateWalletIntent' - UpdateWalletResult: - required: - - walletId - type: object - properties: - walletId: - type: string - description: A Wallet ID. - User: - required: - - apiKeys - - authenticators - - createdAt - - oauthProviders - - updatedAt - - userId - - userName - - userTags - type: object - properties: - userId: - type: string - description: Unique identifier for a given User. - userName: - type: string - description: Human-readable name for a User. - userEmail: - type: string - description: The user's email address. - nullable: true - userPhoneNumber: - type: string - description: The user's phone number in E.164 format e.g. +13214567890 - nullable: true - authenticators: - type: array - description: A list of Authenticator parameters. - items: - $ref: '#/components/schemas/Authenticator' - apiKeys: - type: array - description: "A list of API Key parameters. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/ApiKey' - userTags: - type: array - description: A list of User Tag IDs. - items: - type: string - oauthProviders: - type: array - description: A list of Oauth Providers. - items: - $ref: '#/components/schemas/OauthProvider' - createdAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - updatedAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - UserParams: - required: - - accessType - - apiKeys - - authenticators - - userName - - userTags - type: object - properties: - userName: - type: string - description: Human-readable name for a User. - userEmail: - type: string - description: The user's email address. - nullable: true - accessType: - $ref: '#/components/schemas/AccessType' - apiKeys: - type: array - description: "A list of API Key parameters. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/ApiKeyParams' - authenticators: - type: array - description: "A list of Authenticator parameters. This field, if not needed,\ - \ should be an empty array in your request body." - items: - $ref: '#/components/schemas/AuthenticatorParams' - userTags: - type: array - description: "A list of User Tag IDs. This field, if not needed, should\ - \ be an empty array in your request body." - items: - type: string - UserParamsV2: - required: - - apiKeys - - authenticators - - userName - - userTags - type: object - properties: - userName: - type: string - description: Human-readable name for a User. - userEmail: - type: string - description: The user's email address. - nullable: true - apiKeys: - type: array - description: "A list of API Key parameters. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/ApiKeyParams' - authenticators: - type: array - description: "A list of Authenticator parameters. This field, if not needed,\ - \ should be an empty array in your request body." - items: - $ref: '#/components/schemas/AuthenticatorParamsV2' - userTags: - type: array - description: "A list of User Tag IDs. This field, if not needed, should\ - \ be an empty array in your request body." - items: - type: string - UserParamsV3: - required: - - apiKeys - - authenticators - - oauthProviders - - userName - - userTags - type: object - properties: - userName: - type: string - description: Human-readable name for a User. - userEmail: - type: string - description: The user's email address. - nullable: true - userPhoneNumber: - type: string - description: The user's phone number in E.164 format e.g. +13214567890 - nullable: true - apiKeys: - type: array - description: "A list of API Key parameters. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/ApiKeyParamsV2' - authenticators: - type: array - description: "A list of Authenticator parameters. This field, if not needed,\ - \ should be an empty array in your request body." - items: - $ref: '#/components/schemas/AuthenticatorParamsV2' - oauthProviders: - type: array - description: "A list of Oauth providers. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/OauthProviderParams' - userTags: - type: array - description: "A list of User Tag IDs. This field, if not needed, should\ - \ be an empty array in your request body." - items: - type: string - VerifyOtpIntent: - required: - - otpCode - - otpId - type: object - properties: - otpId: - type: string - description: ID representing the result of an init OTP activity. - otpCode: - type: string - description: OTP sent out to a user's contact (email or SMS) - expirationSeconds: - type: string - description: "Expiration window (in seconds) indicating how long the verification\ - \ token is valid for. If not provided, a default of 1 hour will be used.\ - \ Maximum value is 86400 seconds (24 hours)" - nullable: true - VerifyOtpRequest: - required: - - organizationId - - parameters - - timestampMs - - type - type: object - properties: - type: - type: string - enum: - - ACTIVITY_TYPE_VERIFY_OTP - timestampMs: - type: string - description: "Timestamp (in milliseconds) of the request, used to verify\ - \ liveness of user requests." - organizationId: - type: string - description: Unique identifier for a given Organization. - parameters: - $ref: '#/components/schemas/VerifyOtpIntent' - VerifyOtpResult: - required: - - verificationToken - type: object - properties: - verificationToken: - type: string - description: "Signed JWT containing a unique id, expiry, verification type,\ - \ contact. Verification status of a user is updated when the token is\ - \ consumed (in OTP_LOGIN requests)" - Vote: - required: - - activityId - - createdAt - - id - - message - - publicKey - - scheme - - selection - - signature - - user - - userId - type: object - properties: - id: - type: string - description: Unique identifier for a given Vote object. - userId: - type: string - description: Unique identifier for a given User. - user: - $ref: '#/components/schemas/User' - activityId: - type: string - description: Unique identifier for a given Activity object. - selection: - type: string - enum: - - VOTE_SELECTION_APPROVED - - VOTE_SELECTION_REJECTED - message: - type: string - description: The raw message being signed within a Vote. - publicKey: - type: string - description: The public component of a cryptographic key pair used to sign - messages and transactions. - signature: - type: string - description: The signature applied to a particular vote. - scheme: - type: string - description: Method used to produce a signature. - createdAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - Wallet: - required: - - createdAt - - exported - - imported - - updatedAt - - walletId - - walletName - type: object - properties: - walletId: - type: string - description: Unique identifier for a given Wallet. - walletName: - type: string - description: Human-readable name for a Wallet. - createdAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - updatedAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - exported: - type: boolean - description: "True when a given Wallet is exported, false otherwise." - imported: - type: boolean - description: "True when a given Wallet is imported, false otherwise." - WalletAccount: - required: - - address - - addressFormat - - createdAt - - curve - - organizationId - - path - - pathFormat - - updatedAt - - walletAccountId - - walletId - type: object - properties: - walletAccountId: - type: string - description: Unique identifier for a given Wallet Account. - organizationId: - type: string - description: The Organization the Account belongs to. - walletId: - type: string - description: The Wallet the Account was derived from. - curve: - $ref: '#/components/schemas/Curve' - pathFormat: - $ref: '#/components/schemas/PathFormat' - path: - type: string - description: Path used to generate the Account. - addressFormat: - $ref: '#/components/schemas/AddressFormat' - address: - type: string - description: Address generated using the Wallet seed and Account parameters. - createdAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - updatedAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - publicKey: - type: string - description: The public component of this wallet account's underlying cryptographic - key pair. - nullable: true - WalletAccountParams: - required: - - addressFormat - - curve - - path - - pathFormat - type: object - properties: - curve: - $ref: '#/components/schemas/Curve' - pathFormat: - $ref: '#/components/schemas/PathFormat' - path: - type: string - description: Path used to generate a wallet Account. - addressFormat: - $ref: '#/components/schemas/AddressFormat' - WalletParams: - required: - - accounts - - walletName - type: object - properties: - walletName: - type: string - description: Human-readable name for a Wallet. - accounts: - type: array - description: "A list of wallet Accounts. This field, if not needed, should\ - \ be an empty array in your request body." - items: - $ref: '#/components/schemas/WalletAccountParams' - mnemonicLength: - type: integer - description: "Length of mnemonic to generate the Wallet seed. Defaults to\ - \ 12. Accepted values: 12, 15, 18, 21, 24." - format: int32 - nullable: true - WalletResult: - required: - - addresses - - walletId - type: object - properties: - walletId: - type: string - addresses: - type: array - description: A list of account addresses. - items: - type: string - activity.v1.Address: - type: object - properties: - format: - $ref: '#/components/schemas/AddressFormat' - address: - type: string - data.v1.Address: - type: object - properties: - format: - $ref: '#/components/schemas/AddressFormat' - address: - type: string - external.data.v1.Credential: - required: - - publicKey - - type - type: object - properties: - publicKey: - type: string - description: The public component of a cryptographic key pair used to sign - messages and transactions. - type: - $ref: '#/components/schemas/CredentialType' - external.data.v1.Quorum: - required: - - threshold - - userIds - type: object - properties: - threshold: - type: integer - description: Count of unique approvals required to meet quorum. - format: int32 - userIds: - type: array - description: Unique identifiers of quorum set members. - items: - type: string - external.data.v1.Timestamp: - required: - - nanos - - seconds - type: object - properties: - seconds: - type: string - nanos: - type: string - v1.Tag: - required: - - createdAt - - tagId - - tagName - - tagType - - updatedAt - type: object - properties: - tagId: - type: string - description: Unique identifier for a given Tag. - tagName: - type: string - description: Human-readable name for a Tag. - tagType: - $ref: '#/components/schemas/TagType' - createdAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - updatedAt: - $ref: '#/components/schemas/external.data.v1.Timestamp' - securitySchemes: - ApiKeyAuth: - type: apiKey - name: X-Stamp - in: header - AuthenticatorAuth: - type: apiKey - name: X-Stamp-WebAuthn - in: header -x-tagGroups: -- name: ORGANIZATIONS - tags: - - Organizations - - Invitations - - Policies - - Features -- name: WALLETS AND PRIVATE KEYS - tags: - - Wallets - - Signing - - Private Keys - - Private Key Tags -- name: USERS - tags: - - Users - - User Tags - - User Recovery - - User Auth -- name: CREDENTIALS - tags: - - Authenticators - - API Keys - - Sessions -- name: ACTIVITIES - tags: - - Activities - - Consensus -x-original-swagger-version: "2.0" diff --git a/Sources/TurnkeyPasskeys/Internal/PasskeyRequestBuilder.swift b/Sources/TurnkeyPasskeys/Internal/PasskeyRequestBuilder.swift index fe1c4fd0..43f4b510 100644 --- a/Sources/TurnkeyPasskeys/Internal/PasskeyRequestBuilder.swift +++ b/Sources/TurnkeyPasskeys/Internal/PasskeyRequestBuilder.swift @@ -1,5 +1,6 @@ import AuthenticationServices import TurnkeyEncoding +import TurnkeyTypes private struct ClientData: Decodable { let challenge: String @@ -128,14 +129,14 @@ final class PasskeyRequestBuilder { return PasskeyRegistrationResult( challenge: clientData.challenge, - attestation: Attestation( - credentialId: credential.credentialID.base64URLEncodedString(), - clientDataJson: credential.rawClientDataJSON.base64URLEncodedString(), + attestation: v1Attestation( attestationObject: attestation.base64URLEncodedString(), + clientDataJson: credential.rawClientDataJSON.base64URLEncodedString(), + credentialId: credential.credentialID.base64URLEncodedString(), // TODO: Can we infer the transport from the registration result? // Defaulting to "hybrid" since that's commonly used for passkeys. - transports: [Transport.hybrid] + transports: [v1AuthenticatorTransport.authenticator_transport_hybrid] ) ) } diff --git a/Sources/TurnkeyPasskeys/Models/PasskeyModels.swift b/Sources/TurnkeyPasskeys/Models/PasskeyModels.swift index f4b6a2c0..57c2df34 100644 --- a/Sources/TurnkeyPasskeys/Models/PasskeyModels.swift +++ b/Sources/TurnkeyPasskeys/Models/PasskeyModels.swift @@ -1,21 +1,6 @@ import AuthenticationServices import Foundation -public enum Transport: String, Codable { - case ble = "AUTHENTICATOR_TRANSPORT_BLE" - case internalTransport = "AUTHENTICATOR_TRANSPORT_INTERNAL" - case nfc = "AUTHENTICATOR_TRANSPORT_NFC" - case usb = "AUTHENTICATOR_TRANSPORT_USB" - case hybrid = "AUTHENTICATOR_TRANSPORT_HYBRID" -} - -public struct Attestation: Codable { - public let credentialId: String - public let clientDataJson: String - public let attestationObject: String - public let transports: [Transport] -} - public struct AssertionResult { public let credentialId: String public let userId: String diff --git a/Sources/TurnkeyPasskeys/Public/Passkey.swift b/Sources/TurnkeyPasskeys/Public/Passkey.swift index 511d5106..2e1b2245 100644 --- a/Sources/TurnkeyPasskeys/Public/Passkey.swift +++ b/Sources/TurnkeyPasskeys/Public/Passkey.swift @@ -1,5 +1,6 @@ import AuthenticationServices import Foundation +import TurnkeyTypes public struct PasskeyUser { public let id: String @@ -25,7 +26,7 @@ public struct RelyingParty { public struct PasskeyRegistrationResult: Codable { public let challenge: String - public let attestation: Attestation + public let attestation: v1Attestation } /// Indicates whether the current platform version supports passkeys. diff --git a/Sources/TurnkeyStamper/Internal/KeyPairStamper.swift b/Sources/TurnkeyStamper/Internal/KeyPairStamper.swift new file mode 100644 index 00000000..a5cff2fc --- /dev/null +++ b/Sources/TurnkeyStamper/Internal/KeyPairStamper.swift @@ -0,0 +1,32 @@ +import Foundation + +/// Protocol defining the core key pair management interface for stampers. +/// +/// Both `SecureEnclaveStamper` and `SecureStorageStamper` conform to this protocol, +/// ensuring consistent API surface for key generation, deletion, listing, and stamping. +/// +/// Note: Each stamper may provide additional config-based overloads beyond this protocol +/// to support their specific features (e.g., SecureStorage has config overloads for all +/// operations to support access groups and access control policies). +protocol KeyPairStamper { + /// Configuration type for this stamper (e.g., `SecureEnclaveConfig`, `SecureStorageConfig`) + associatedtype Config + + /// List all stored public keys (compressed hex format). + static func listKeyPairs() throws -> [String] + + /// Clear all stored key pairs. + static func clearKeyPairs() throws + + /// Create a new key pair with default configuration, returning the public key (compressed hex). + static func createKeyPair() throws -> String + + /// Create a new key pair with custom configuration, returning the public key (compressed hex). + static func createKeyPair(config: Config) throws -> String + + /// Delete a specific key pair by its public key. + static func deleteKeyPair(publicKeyHex: String) throws + + /// Generate a cryptographic stamp for the given payload using the specified key. + static func stamp(payload: String, publicKeyHex: String) throws -> String +} diff --git a/Sources/TurnkeyStamper/Internal/SecureEnclaveStamper.swift b/Sources/TurnkeyStamper/Internal/SecureEnclaveStamper.swift new file mode 100644 index 00000000..3e0a3050 --- /dev/null +++ b/Sources/TurnkeyStamper/Internal/SecureEnclaveStamper.swift @@ -0,0 +1,316 @@ +import CryptoKit +import Foundation +import CoreFoundation +import Security +import TurnkeyEncoding +import TurnkeyCrypto + + +/// A Secure Enclave–backed stamper for generating and using P-256 keys inside the device TEE. +/// +/// Keys are generated and stored inside the device Secure Enclave (TEE). The +/// private key never leaves the enclave. Callers can control user-auth policy +/// (e.g., none, user presence, or biometry) at key creation time via +/// `SecureEnclaveConfig`. +/// +/// Note: Secure Enclave does not support importing external keys. Keys must be +/// generated inside the enclave. +enum SecureEnclaveStamper: KeyPairStamper { + typealias Config = SecureEnclaveConfig + + private static let label = "TurnkeyApiKeyPair" + + struct SecureEnclaveConfig: Sendable { + enum AuthPolicy { + case none + case userPresence + case biometryAny + case biometryCurrentSet + } + + let authPolicy: AuthPolicy + init(authPolicy: AuthPolicy = .none) { self.authPolicy = authPolicy } + } + + // MARK: - Public API + + /// Indicates whether Secure Enclave is available and usable on this device. + /// + /// Uses the same probing logic as key generation to determine support. + static func isSupported() -> Bool { + return isSecureEnclaveAvailable() + } + + static func listKeyPairs() throws -> [String] { + let query: [String: Any] = [ + kSecClass as String: kSecClassKey, + kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, + kSecAttrKeyClass as String: kSecAttrKeyClassPrivate, + kSecAttrLabel as String: label, + kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave, + kSecReturnRef as String: true, + kSecMatchLimit as String: kSecMatchLimitAll, + ] + + var result: CFTypeRef? + let status = SecItemCopyMatching(query as CFDictionary, &result) + if status == errSecItemNotFound { + return [] + } + guard status == errSecSuccess else { + throw SecureEnclaveStamperError.keychainError(status) + } + + var keys: [SecKey] = [] + if let array = result as? [SecKey] { + keys = array + } else if let r = result, CFGetTypeID(r) == SecKeyGetTypeID() { + keys = [r as! SecKey] + } + + var publicKeys: [String] = [] + publicKeys.reserveCapacity(keys.count) + for priv in keys { + if let hex = try? TurnkeyCrypto.getPublicKey(fromPrivateKey: priv) { + publicKeys.append(hex) + } + } + return publicKeys + } + + static func clearKeyPairs() throws { + for publicKey in try listKeyPairs() { + try deleteKeyPair(publicKeyHex: publicKey) + } + } + + static func createKeyPair() throws -> String { + return try createKeyPair(config: SecureEnclaveConfig()) + } + + static func createKeyPair(config: SecureEnclaveConfig) throws -> String { + guard isSecureEnclaveAvailable() else { + throw SecureEnclaveStamperError.secureEnclaveUnavailable + } + let accessControlFlags = accessControlFlags(for: config.authPolicy) + var acError: Unmanaged? + guard let access = SecAccessControlCreateWithFlags( + kCFAllocatorDefault, + kSecAttrAccessibleWhenUnlockedThisDeviceOnly, + accessControlFlags, + &acError + ) else { + throw SecureEnclaveStamperError.keyGenerationFailed(acError?.takeRetainedValue()) + } + + let attributes: [String: Any] = [ + kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, + kSecAttrKeySizeInBits as String: 256, + kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave, + kSecAttrLabel as String: label, + kSecAttrIsPermanent as String: true, + kSecPrivateKeyAttrs as String: [ + kSecAttrIsPermanent as String: true, + kSecAttrAccessControl as String: access, + ], + ] + + var error: Unmanaged? + guard let privateKey = SecKeyCreateRandomKey(attributes as CFDictionary, &error) else { + throw SecureEnclaveStamperError.keyGenerationFailed(error?.takeRetainedValue()) + } + + // Derive compressed public key hex for return and indexing. + let publicKeyHex = try TurnkeyCrypto.getPublicKey(fromPrivateKey: privateKey) + + // Best-effort: set applicationTag to the compressed public key hex for faster lookups later. + if let tagData = publicKeyHex.data(using: .utf8) { + let query: [String: Any] = [ + kSecClass as String: kSecClassKey, + kSecValueRef as String: privateKey, + ] + let update: [String: Any] = [ + kSecAttrApplicationTag as String: tagData, + ] + let setTagStatus = SecItemUpdate(query as CFDictionary, update as CFDictionary) + if setTagStatus != errSecSuccess && setTagStatus != errSecItemNotFound { + // Non-fatal; continue. + } + } + + return publicKeyHex + } + + static func deleteKeyPair(publicKeyHex: String) throws { + if let key = try findPrivateKey(publicKeyHex: publicKeyHex) { + let query: [String: Any] = [ + kSecClass as String: kSecClassKey, + kSecValueRef as String: key, + ] + let status = SecItemDelete(query as CFDictionary) + if status == errSecItemNotFound || status == errSecSuccess { + return + } + throw SecureEnclaveStamperError.keychainError(status) + } else { + // Treat as success if not found (parity with storage stamper behavior) + return + } + } + + static func stamp( + payload: String, + publicKeyHex: String + ) throws -> String { + guard let payloadData = payload.data(using: .utf8) else { + throw SecureEnclaveStamperError.payloadEncodingFailed + } + let digest = SHA256.hash(data: payloadData) + + guard let privateKey = try findPrivateKey(publicKeyHex: publicKeyHex) else { + throw SecureEnclaveStamperError.keyNotFound(publicKeyHex: publicKeyHex) + } + + let algorithm: SecKeyAlgorithm = .ecdsaSignatureDigestX962SHA256 + guard SecKeyIsAlgorithmSupported(privateKey, .sign, algorithm) else { + throw SecureEnclaveStamperError.unsupportedAlgorithm + } + + var signError: Unmanaged? + let signature = SecKeyCreateSignature( + privateKey, + algorithm, + Data(digest) as CFData, + &signError + ) + + guard let sig = signature as Data? else { + throw SecureEnclaveStamperError.keyGenerationFailed(signError?.takeRetainedValue()) + } + + let signatureHex = sig.toHexString() + let stamp: [String: Any] = [ + "publicKey": publicKeyHex, + "scheme": "SIGNATURE_SCHEME_TK_API_P256", + "signature": signatureHex, + ] + + let jsonData = try JSONSerialization.data(withJSONObject: stamp, options: []) + return jsonData.base64URLEncodedString() + } + + // MARK: - Helpers + + private static func isSecureEnclaveAvailable() -> Bool { + // Try generating and immediately deleting a no-prompt key. + let flags = accessControlFlags(for: .none) + var acError: Unmanaged? + guard let access = SecAccessControlCreateWithFlags( + kCFAllocatorDefault, + kSecAttrAccessibleWhenUnlockedThisDeviceOnly, + flags, + &acError + ) else { + return false + } + + let attributes: [String: Any] = [ + kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, + kSecAttrKeySizeInBits as String: 256, + kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave, + kSecAttrLabel as String: "TurnkeySESupportProbe", + kSecAttrIsPermanent as String: true, + kSecPrivateKeyAttrs as String: [ + kSecAttrIsPermanent as String: true, + kSecAttrAccessControl as String: access, + ], + ] + + var err: Unmanaged? + guard let key = SecKeyCreateRandomKey(attributes as CFDictionary, &err) else { + return false + } + // Cleanup: delete the probe key. + let query: [String: Any] = [ + kSecClass as String: kSecClassKey, + kSecValueRef as String: key, + ] + _ = SecItemDelete(query as CFDictionary) + return true + } + + private static func accessControlFlags(for policy: SecureEnclaveConfig.AuthPolicy) + -> SecAccessControlCreateFlags + { + switch policy { + case .none: + return [.privateKeyUsage] + case .userPresence: + return [.privateKeyUsage, .userPresence] + case .biometryAny: + return [.privateKeyUsage, .biometryAny] + case .biometryCurrentSet: + return [.privateKeyUsage, .biometryCurrentSet] + } + } + + + + private static func findPrivateKey(publicKeyHex: String) throws -> SecKey? { + // First, try by application tag if we were able to set it. + if let tag = publicKeyHex.data(using: .utf8) { + let tagQuery: [String: Any] = [ + kSecClass as String: kSecClassKey, + kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, + kSecAttrKeyClass as String: kSecAttrKeyClassPrivate, + kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave, + kSecAttrApplicationTag as String: tag, + kSecReturnRef as String: true, + kSecMatchLimit as String: kSecMatchLimitOne, + ] + + var tagResult: CFTypeRef? + let tagStatus = SecItemCopyMatching(tagQuery as CFDictionary, &tagResult) + if tagStatus == errSecSuccess, let r = tagResult, CFGetTypeID(r) == SecKeyGetTypeID() { + // Safe: Type ID check confirms this is a SecKey + return (r as! SecKey) + } + } + + // Fallback: scan keys with our label and match by derived compressed public key hex. + let query: [String: Any] = [ + kSecClass as String: kSecClassKey, + kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, + kSecAttrKeyClass as String: kSecAttrKeyClassPrivate, + kSecAttrLabel as String: label, + kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave, + kSecReturnRef as String: true, + kSecMatchLimit as String: kSecMatchLimitAll, + ] + + var result: CFTypeRef? + let status = SecItemCopyMatching(query as CFDictionary, &result) + if status == errSecItemNotFound { + return nil + } + guard status == errSecSuccess else { + throw SecureEnclaveStamperError.keychainError(status) + } + + if let keys = result as? [SecKey] { + for priv in keys { + if let hex = try? TurnkeyCrypto.getPublicKey(fromPrivateKey: priv), hex == publicKeyHex { + return priv + } + } + } else if let r = result, CFGetTypeID(r) == SecKeyGetTypeID() { + let single = r as! SecKey + if let hex = try? TurnkeyCrypto.getPublicKey(fromPrivateKey: single), hex == publicKeyHex { + return single + } + } + return nil + } +} + + diff --git a/Sources/TurnkeyStamper/Internal/SecureStorageStamper.swift b/Sources/TurnkeyStamper/Internal/SecureStorageStamper.swift new file mode 100644 index 00000000..d85d2217 --- /dev/null +++ b/Sources/TurnkeyStamper/Internal/SecureStorageStamper.swift @@ -0,0 +1,409 @@ +import CryptoKit +import Foundation +import Security +import LocalAuthentication +import TurnkeyEncoding +import TurnkeyCrypto + +/// A Keychain-backed stamper that stores private keys in the iOS Keychain as Generic Password entries with: +/// - service = public key (hex, compressed) +/// - account = "TurnkeySecureStorageStamper" +/// - label = "TurnkeyApiKeyPair" +/// +/// Note: +/// Keychain queries must match how items were stored (e.g., access group, iCloud synchronizable, +/// and whether access control requiring user presence/biometry was applied). If you store with +/// non-default attributes or an access control policy, use the config-based overloads of +/// `listKeyPairs`, `clearKeyPairs`, `deleteKeyPair`, and `stamp` to ensure lookups and auth UI +/// behave as intended. If you use the defaults, the no-config methods are sufficient. +/// +/// Unlike `SecureEnclaveStamper`, this stamper supports importing external key pairs via +/// `importKeyPair` methods. +enum SecureStorageStamper: KeyPairStamper { + typealias Config = SecureStorageConfig + + private static let account = "TurnkeySecureStorageStamper" + private static let label = "TurnkeyApiKeyPair" + + /// Configuration for how keys are stored and accessed from the Keychain. + /// + /// Defaults: + /// - `accessibility`: `.afterFirstUnlockThisDeviceOnly` (available after first unlock, not migrated) + /// - `accessControlPolicy`: `.none` (no per-access user prompt) + /// - `authPrompt`: `nil` (system default prompt if needed) + /// - `biometryReuseWindowSeconds`: `0` (no reuse window) + /// - `synchronizable`: `false` (do not sync via iCloud Keychain) + /// - `accessGroup`: `nil` (no shared access group) + struct SecureStorageConfig: Sendable { + enum Accessibility { + case whenUnlockedThisDeviceOnly + case afterFirstUnlockThisDeviceOnly + case whenPasscodeSetThisDeviceOnly + } + + enum AccessControlPolicy { + case none + case userPresence + case biometryAny + case biometryCurrentSet + case devicePasscode + } + + let accessibility: Accessibility + let accessControlPolicy: AccessControlPolicy + let authPrompt: String? + let biometryReuseWindowSeconds: Int + let synchronizable: Bool + let accessGroup: String? + + init( + accessibility: Accessibility = .afterFirstUnlockThisDeviceOnly, + accessControlPolicy: AccessControlPolicy = .none, + authPrompt: String? = nil, + biometryReuseWindowSeconds: Int = 0, + synchronizable: Bool = false, + accessGroup: String? = nil + ) { + self.accessibility = accessibility + self.accessControlPolicy = accessControlPolicy + self.authPrompt = authPrompt + self.biometryReuseWindowSeconds = biometryReuseWindowSeconds + self.synchronizable = synchronizable + self.accessGroup = accessGroup + } + } + + // MARK: - Public API + + static func listKeyPairs() throws -> [String] { + let query: [String: Any] = [ + kSecClass as String: kSecClassGenericPassword, + kSecAttrLabel as String: label, + kSecAttrSynchronizable as String: kSecAttrSynchronizableAny, + kSecReturnAttributes as String: true, + kSecMatchLimit as String: kSecMatchLimitAll, + ] + + var result: CFTypeRef? + let status = SecItemCopyMatching(query as CFDictionary, &result) + if status == errSecItemNotFound { + return [] + } + guard status == errSecSuccess else { + throw SecureStorageStamperError.keychainError(status) + } + + guard let items = result as? [[String: Any]] else { + return [] + } + + var services: [String] = [] + services.reserveCapacity(items.count) + for attributes in items { + if let publicKey = attributes[kSecAttrService as String] as? String { + services.append(publicKey) + } + } + return services + } + + /// List stored public keys using the provided config to scope lookups (e.g., access group, + /// iCloud Keychain). Use when you stored with non-default attributes. + static func listKeyPairs(config: SecureStorageConfig) throws -> [String] { + var query: [String: Any] = [ + kSecClass as String: kSecClassGenericPassword, + kSecAttrLabel as String: label, + kSecAttrSynchronizable as String: kSecAttrSynchronizableAny, + kSecReturnAttributes as String: true, + kSecMatchLimit as String: kSecMatchLimitAll, + ] + if let group = config.accessGroup { + query[kSecAttrAccessGroup as String] = group + } + + var result: CFTypeRef? + let status = SecItemCopyMatching(query as CFDictionary, &result) + if status == errSecItemNotFound { + return [] + } + guard status == errSecSuccess else { + throw SecureStorageStamperError.keychainError(status) + } + + guard let items = result as? [[String: Any]] else { + return [] + } + + var services: [String] = [] + services.reserveCapacity(items.count) + for attributes in items { + if let publicKey = attributes[kSecAttrService as String] as? String { + services.append(publicKey) + } + } + return services + } + + static func clearKeyPairs() throws { + for publicKey in try listKeyPairs() { + try deleteKeyPair(publicKeyHex: publicKey) + } + } + + /// Clear stored keys using the provided config to target the correct domain (e.g., access group, + /// iCloud Keychain). Use when you stored with non-default attributes. + static func clearKeyPairs(config: SecureStorageConfig) throws { + for publicKey in try listKeyPairs(config: config) { + try deleteKeyPair(publicKeyHex: publicKey, config: config) + } + } + + static func createKeyPair() throws -> String { + return try createKeyPair(config: SecureStorageConfig()) + } + + static func createKeyPair(config: SecureStorageConfig) throws -> String { + let keyPair = TurnkeyCrypto.generateP256KeyPair() + let privateKeyHex = keyPair.privateKey + let publicKeyHex = keyPair.publicKeyCompressed + try savePrivateKey(privateKeyHex, for: publicKeyHex, config: config) + return publicKeyHex + } + + /// Import an external key pair into Secure Storage with default configuration. + /// + /// - Parameter externalKeyPair: A tuple containing the public key (compressed hex) and private key (hex). + /// - Returns: The public key (compressed hex) that was imported. + static func importKeyPair( + externalKeyPair: (publicKey: String, privateKey: String) + ) throws -> String { + try savePrivateKey(externalKeyPair.privateKey, for: externalKeyPair.publicKey, config: SecureStorageConfig()) + return externalKeyPair.publicKey + } + + /// Import an external key pair into Secure Storage with custom configuration. + /// + /// - Parameters: + /// - externalKeyPair: A tuple containing the public key (compressed hex) and private key (hex). + /// - config: Configuration for keychain storage (accessibility, access control, etc.). + /// - Returns: The public key (compressed hex) that was imported. + static func importKeyPair( + externalKeyPair: (publicKey: String, privateKey: String), + config: SecureStorageConfig + ) throws -> String { + try savePrivateKey(externalKeyPair.privateKey, for: externalKeyPair.publicKey, config: config) + return externalKeyPair.publicKey + } + + static func deleteKeyPair(publicKeyHex: String) throws { + let query: [String: Any] = [ + kSecClass as String: kSecClassGenericPassword, + kSecAttrService as String: publicKeyHex, + kSecAttrAccount as String: account, + ] + + let status = SecItemDelete(query as CFDictionary) + if status == errSecItemNotFound || status == errSecSuccess { + return + } + throw SecureStorageStamperError.keychainError(status) + } + + /// Delete a specific key using the provided config to match how it was stored (e.g., access group, + /// iCloud Keychain). Use when you stored with non-default attributes. + /// Note: Does not throw if the key isn't found (treat as success). + static func deleteKeyPair(publicKeyHex: String, config: SecureStorageConfig) throws { + var query: [String: Any] = [ + kSecClass as String: kSecClassGenericPassword, + kSecAttrService as String: publicKeyHex, + kSecAttrAccount as String: account, + ] + if let group = config.accessGroup { + query[kSecAttrAccessGroup as String] = group + } + + let status = SecItemDelete(query as CFDictionary) + + if status == errSecItemNotFound || status == errSecSuccess { + return + } + throw SecureStorageStamperError.keychainError(status) + } + + static func stamp( + payload: String, + publicKeyHex: String + ) throws -> String { + guard let payloadData = payload.data(using: .utf8) else { + throw SecureStorageStamperError.payloadEncodingFailed + } + let digest = SHA256.hash(data: payloadData) + + guard let privateKeyHex = try getPrivateKey(publicKeyHex: publicKeyHex, config: nil) else { + throw SecureStorageStamperError.privateKeyNotFound(publicKeyHex: publicKeyHex) + } + + let stamp = try ApiKeyStamper.stamp( + payload: digest, + publicKeyHex: publicKeyHex, + privateKeyHex: privateKeyHex + ) + return stamp + } + + /// Generate a stamp while honoring access control and scoping (e.g., access group, iCloud). If the + /// key was saved with an access control policy, supply `authPrompt` and optionally a reuse window + /// via `config` so the system can present authentication UI. + static func stamp( + payload: String, + publicKeyHex: String, + config: SecureStorageConfig + ) throws -> String { + guard let payloadData = payload.data(using: .utf8) else { + throw SecureStorageStamperError.payloadEncodingFailed + } + let digest = SHA256.hash(data: payloadData) + + guard let privateKeyHex = try getPrivateKey(publicKeyHex: publicKeyHex, config: config) else { + throw SecureStorageStamperError.privateKeyNotFound(publicKeyHex: publicKeyHex) + } + + let stamp = try ApiKeyStamper.stamp( + payload: digest, + publicKeyHex: publicKeyHex, + privateKeyHex: privateKeyHex + ) + return stamp + } + + // MARK: - Keychain helpers + + private static func savePrivateKey( + _ privateKeyHex: String, + for publicKeyHex: String, + config: SecureStorageConfig + ) throws { + guard let valueData = privateKeyHex.data(using: .utf8) else { + throw SecureStorageStamperError.stringEncodingFailed + } + + // Try add + var attributes: [String: Any] = [ + kSecClass as String: kSecClassGenericPassword, + kSecAttrService as String: publicKeyHex, + kSecAttrAccount as String: account, + kSecAttrLabel as String: label, + kSecValueData as String: valueData, + ] + + // Set protection policy + if let access = makeAccessControl(from: config) { + attributes[kSecAttrAccessControl as String] = access + } else { + attributes[kSecAttrAccessible as String] = accessibilityConstant(config.accessibility) + } + + // Sync / group + attributes[kSecAttrSynchronizable as String] = config.synchronizable + if let group = config.accessGroup { + attributes[kSecAttrAccessGroup as String] = group + } + + var status = SecItemAdd(attributes as CFDictionary, nil) + + // If duplicate, update the value + if status == errSecDuplicateItem { + var query: [String: Any] = [ + kSecClass as String: kSecClassGenericPassword, + kSecAttrService as String: publicKeyHex, + kSecAttrAccount as String: account, + ] + if let group = config.accessGroup { + query[kSecAttrAccessGroup as String] = group + } + let update: [String: Any] = [kSecValueData as String: valueData] + status = SecItemUpdate(query as CFDictionary, update as CFDictionary) + } + + guard status == errSecSuccess else { + throw SecureStorageStamperError.keychainError(status) + } + } + + private static func getPrivateKey(publicKeyHex: String, config: SecureStorageConfig?) throws -> String? { + var query: [String: Any] = [ + kSecClass as String: kSecClassGenericPassword, + kSecAttrService as String: publicKeyHex, + kSecAttrAccount as String: account, + kSecReturnData as String: true, + kSecMatchLimit as String: kSecMatchLimitOne, + ] + // Include both local and iCloud items unless the store requires strict match + query[kSecAttrSynchronizable as String] = kSecAttrSynchronizableAny + if let cfg = config, let group = cfg.accessGroup { + query[kSecAttrAccessGroup as String] = group + } + + if let cfg = config { + let c = LAContext() + if #available(iOS 13.0, *) { + let maxAllowed = Int(LATouchIDAuthenticationMaximumAllowableReuseDuration) + let seconds = max(0, min(maxAllowed, cfg.biometryReuseWindowSeconds)) + c.touchIDAuthenticationAllowableReuseDuration = TimeInterval(seconds) + } + if let prompt = cfg.authPrompt { c.localizedReason = prompt } + query[kSecUseAuthenticationContext as String] = c + } + + var result: CFTypeRef? + let status = SecItemCopyMatching(query as CFDictionary, &result) + if status == errSecItemNotFound { + return nil + } + guard status == errSecSuccess else { + throw SecureStorageStamperError.keychainError(status) + } + guard let data = result as? Data, let privateKeyHex = String(data: data, encoding: .utf8) else { + throw SecureStorageStamperError.stringEncodingFailed + } + return privateKeyHex + } + + private static func accessibilityConstant(_ a: SecureStorageConfig.Accessibility) -> CFString { + switch a { + case .whenUnlockedThisDeviceOnly: + return kSecAttrAccessibleWhenUnlockedThisDeviceOnly + case .afterFirstUnlockThisDeviceOnly: + return kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly + case .whenPasscodeSetThisDeviceOnly: + return kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly + } + } + + private static func makeAccessControl(from config: SecureStorageConfig) -> SecAccessControl? { + guard config.accessControlPolicy != .none else { return nil } + var flags: SecAccessControlCreateFlags = [] + switch config.accessControlPolicy { + case .none: + flags = [] + case .userPresence: + flags = [.userPresence] + case .biometryAny: + flags = [.biometryAny] + case .biometryCurrentSet: + flags = [.biometryCurrentSet] + case .devicePasscode: + flags = [.devicePasscode] + } + var error: Unmanaged? + let access = SecAccessControlCreateWithFlags( + kCFAllocatorDefault, + accessibilityConstant(config.accessibility), + flags, + &error + ) + return access + } +} + + diff --git a/Sources/TurnkeyStamper/Models/Errors.swift b/Sources/TurnkeyStamper/Models/Errors.swift index 37acbf81..0ca47cbb 100644 --- a/Sources/TurnkeyStamper/Models/Errors.swift +++ b/Sources/TurnkeyStamper/Models/Errors.swift @@ -54,6 +54,8 @@ public enum StampError: Error { case unknownError(String) case passkeyManagerNotSet case invalidPayload + case secureEnclaveUnavailable + case keyNotFound(publicKeyHex: String) public var localizedDescription: String { switch self { @@ -71,6 +73,50 @@ public enum StampError: Error { return "Passkey manager has not been initialized." case .invalidPayload: return "Invalid payload provided for stamping." + case .secureEnclaveUnavailable: + return "Secure Enclave is not available on this device." + case .keyNotFound(let publicKeyHex): + return "No private key found for public key: \(publicKeyHex)" } } } + +enum SecureEnclaveStamperError: Error, Equatable { + case secureEnclaveUnavailable + case keychainError(OSStatus) + case keyGenerationFailed(Error?) + case keyNotFound(publicKeyHex: String) + case publicKeyEncodingFailed + case unsupportedAlgorithm + case payloadEncodingFailed +} + +extension SecureEnclaveStamperError { + static func == (lhs: SecureEnclaveStamperError, rhs: SecureEnclaveStamperError) -> Bool { + switch (lhs, rhs) { + case (.secureEnclaveUnavailable, .secureEnclaveUnavailable): + return true + case let (.keychainError(a), .keychainError(b)): + return a == b + case (.keyGenerationFailed, .keyGenerationFailed): + // Compare only by case; underlying Error? is not Equatable + return true + case let (.keyNotFound(a), .keyNotFound(b)): + return a == b + case (.publicKeyEncodingFailed, .publicKeyEncodingFailed): + return true + case (.unsupportedAlgorithm, .unsupportedAlgorithm): + return true + case (.payloadEncodingFailed, .payloadEncodingFailed): + return true + default: + return false + } + } +} +enum SecureStorageStamperError: Error, Equatable { + case keychainError(OSStatus) + case privateKeyNotFound(publicKeyHex: String) + case stringEncodingFailed + case payloadEncodingFailed +} diff --git a/Sources/TurnkeyStamper/Public/Stamper.swift b/Sources/TurnkeyStamper/Public/Stamper.swift index 7b5a5873..4481fb95 100644 --- a/Sources/TurnkeyStamper/Public/Stamper.swift +++ b/Sources/TurnkeyStamper/Public/Stamper.swift @@ -4,17 +4,33 @@ import Foundation import LocalAuthentication import TurnkeyPasskeys +public enum OnDeviceStamperPreference { + case auto + case secureEnclave + case secureStorage +} + public class Stamper { private let apiPublicKey: String? private let apiPrivateKey: String? private let presentationAnchor: ASPresentationAnchor? private let passkeyManager: PasskeyStamper? + + // Selected stamping backend + private enum StampingMode { + case apiKey(pub: String, priv: String) + case passkey(manager: PasskeyStamper) + case secureEnclave(publicKey: String) + case secureStorage(publicKey: String) + } + private let mode: StampingMode? public init() { self.apiPublicKey = nil self.apiPrivateKey = nil self.presentationAnchor = nil self.passkeyManager = nil + self.mode = nil } /// Initializes the stamper with an API key pair for signature stamping. @@ -27,6 +43,7 @@ public class Stamper { self.apiPrivateKey = apiPrivateKey self.presentationAnchor = nil self.passkeyManager = nil + self.mode = .apiKey(pub: apiPublicKey, priv: apiPrivateKey) } /// Initializes the stamper with a passkey setup for WebAuthn-based signing. @@ -39,6 +56,66 @@ public class Stamper { self.apiPrivateKey = nil self.presentationAnchor = presentationAnchor self.passkeyManager = PasskeyStamper(rpId: rpId, presentationAnchor: presentationAnchor) + self.mode = .passkey(manager: self.passkeyManager!) + } + + /// Initializes the stamper for on-device key signing using only a public key, with a selectable backend. + /// + /// - Parameters: + /// - apiPublicKey: The public key (compressed hex) whose private key resides on-device. + /// - onDevicePreference: Preferred backend selection. `.auto` prefers Secure Enclave when supported; otherwise uses Secure Storage. + /// - Throws: + /// - `StampError.secureEnclaveUnavailable` when `.secureEnclave` is selected but the device does not support it. + /// - `StampError.keyNotFound(publicKeyHex:)` if the private key for the given public key is not found in the selected backend. + public init(apiPublicKey: String, onDevicePreference: OnDeviceStamperPreference = .auto) throws { + self.presentationAnchor = nil + self.passkeyManager = nil + self.apiPrivateKey = nil + self.apiPublicKey = apiPublicKey + + switch onDevicePreference { + case .auto: + if SecureEnclaveStamper.isSupported() { + let existing = try SecureEnclaveStamper.listKeyPairs() + guard existing.contains(apiPublicKey) else { + throw StampError.keyNotFound(publicKeyHex: apiPublicKey) + } + self.mode = .secureEnclave(publicKey: apiPublicKey) + } else { + let existing = try SecureStorageStamper.listKeyPairs() + guard existing.contains(apiPublicKey) else { + throw StampError.keyNotFound(publicKeyHex: apiPublicKey) + } + self.mode = .secureStorage(publicKey: apiPublicKey) + } + case .secureEnclave: + guard SecureEnclaveStamper.isSupported() else { + throw StampError.secureEnclaveUnavailable + } + let existing = try SecureEnclaveStamper.listKeyPairs() + guard existing.contains(apiPublicKey) else { + throw StampError.keyNotFound(publicKeyHex: apiPublicKey) + } + self.mode = .secureEnclave(publicKey: apiPublicKey) + case .secureStorage: + let existing = try SecureStorageStamper.listKeyPairs() + guard existing.contains(apiPublicKey) else { + throw StampError.keyNotFound(publicKeyHex: apiPublicKey) + } + self.mode = .secureStorage(publicKey: apiPublicKey) + } + } + + /// Initializes the stamper for hardware/software-stored private key signing using only a public key. + /// + /// Selection rules: + /// - Prefer Secure Enclave if available; otherwise use Secure Storage. + /// - Validates that the private key for the provided public key already exists in the chosen backend. + /// + /// - Parameter apiPublicKey: The public key (compressed hex) whose private key resides on-device. + /// - Throws: `StampError.secureEnclaveUnavailable` or `StampError.keyNotFound(publicKeyHex:)` when appropriate. + public convenience init(apiPublicKey: String) throws { + try self.init(apiPublicKey: apiPublicKey, onDevicePreference: .auto) } /// Generates a signed stamp for the given payload using either API key or passkey credentials. @@ -55,17 +132,107 @@ public class Stamper { let payloadHash = SHA256.hash(data: payloadData) + // Route based on configured mode first + if let mode = self.mode { + switch mode { + case let .apiKey(pub, priv): + let stamp = try ApiKeyStamper.stamp( + payload: payloadHash, publicKeyHex: pub, privateKeyHex: priv) + return ("X-Stamp", stamp) + case let .passkey(manager): + let stamp = try await PasskeyStampBuilder.stamp( + payload: payloadHash, passkeyManager: manager) + return ("X-Stamp-WebAuthn", stamp) + case let .secureEnclave(publicKey): + let stamp = try SecureEnclaveStamper.stamp( + payload: payload, publicKeyHex: publicKey) + return ("X-Stamp", stamp) + case let .secureStorage(publicKey): + let stamp = try SecureStorageStamper.stamp( + payload: payload, publicKeyHex: publicKey) + return ("X-Stamp", stamp) + } + } + + // Backward compatibility: derive from legacy properties if possible if let pub = apiPublicKey, let priv = apiPrivateKey { let stamp = try ApiKeyStamper.stamp( payload: payloadHash, publicKeyHex: pub, privateKeyHex: priv) return ("X-Stamp", stamp) - } else if let manager = passkeyManager { + } + if let manager = passkeyManager { let stamp = try await PasskeyStampBuilder.stamp( payload: payloadHash, passkeyManager: manager) return ("X-Stamp-WebAuthn", stamp) - } else { - throw StampError.unknownError("Unable to stamp request") } + + throw StampError.missingCredentials + } +} + +// MARK: - Public key management helpers +public extension Stamper { + /// Create a new on-device API key pair. + /// + /// Prefers Secure Enclave when supported; otherwise falls back to Secure Storage. + /// Returns the compressed public key hex. The private key remains on-device. + static func createOnDeviceKeyPair() throws -> String { + if SecureEnclaveStamper.isSupported() { + return try createSecureEnclaveKeyPair() + } + return try createSecureStorageKeyPair() + } + + /// Create a new API key pair inside Secure Enclave. Throws if enclave is unavailable. + static func createSecureEnclaveKeyPair() throws -> String { + return try SecureEnclaveStamper.createKeyPair() + } + + /// Create a new API key pair stored in Secure Storage (Keychain). + static func createSecureStorageKeyPair() throws -> String { + return try SecureStorageStamper.createKeyPair() + } + + /// Delete an on-device API key pair. + /// + /// Prefers Secure Enclave when supported; otherwise falls back to Secure Storage. + /// Returns true if the key pair was deleted successfully. + static func deleteOnDeviceKeyPair(publicKeyHex: String) throws { + if SecureEnclaveStamper.isSupported() { + return try deleteSecureEnclaveKeyPair(publicKeyHex: publicKeyHex) + } + return try deleteSecureStorageKeyPair(publicKeyHex: publicKeyHex) + } + + /// Delete an API key pair inside Secure Enclave. + static func deleteSecureEnclaveKeyPair(publicKeyHex: String) throws { + return try SecureEnclaveStamper.deleteKeyPair(publicKeyHex: publicKeyHex) + } + + /// Delete an API key pair stored in Secure Storage (Keychain). + static func deleteSecureStorageKeyPair(publicKeyHex: String) throws { + return try SecureStorageStamper.deleteKeyPair(publicKeyHex: publicKeyHex) + } + + /// Exists an on-device API key pair. + /// + /// Prefers Secure Enclave when supported; otherwise falls back to Secure Storage. + /// Returns true if the key pair exists. + static func existsOnDeviceKeyPair(publicKeyHex: String) throws -> Bool { + if SecureEnclaveStamper.isSupported() { + return try existsSecureEnclaveKeyPair(publicKeyHex: publicKeyHex) + } + return try existsSecureStorageKeyPair(publicKeyHex: publicKeyHex) + } + + /// Exists an API key pair inside Secure Enclave. + static func existsSecureEnclaveKeyPair(publicKeyHex: String) throws -> Bool { + return try SecureEnclaveStamper.listKeyPairs().contains(where: { $0 == publicKeyHex }) + } + + /// Exists an API key pair stored in Secure Storage (Keychain). + static func existsSecureStorageKeyPair(publicKeyHex: String) throws -> Bool { + return try SecureStorageStamper.listKeyPairs().contains(where: { $0 == publicKeyHex }) } } diff --git a/Sources/TurnkeyStamper/README.md b/Sources/TurnkeyStamper/README.md index 6b88ff37..48d90386 100644 --- a/Sources/TurnkeyStamper/README.md +++ b/Sources/TurnkeyStamper/README.md @@ -1,43 +1,173 @@ # TurnkeyStamper -This Swift package provides a unified interface for signing payloads using either API keys or WebAuthn passkeys. It abstracts over the differences between raw keypair signing and passkey-based assertion, and provides a simple method to produce verifiable cryptographic stamps. +This Swift package provides a unified interface for signing payloads using API keys, on-device keys (Secure Enclave or Keychain), or WebAuthn passkeys. It abstracts over the differences between various signing methods and provides a simple `stamp()` method to produce verifiable cryptographic stamps. -It is designed to work seamlessly with Turnkey’s backend APIs that expect either `X-Stamp` or `X-Stamp-WebAuthn` headers. +It is designed to work seamlessly with Turnkey's backend APIs that expect either `X-Stamp` or `X-Stamp-WebAuthn` headers. ## Features -* Supports both API key-based and WebAuthn passkey-based stamping. -* Unified `stamp()` method returns the correct header name and value. -* Uses P-256 ECDSA signatures (DER for API keys, WebAuthn-compliant for passkeys). +* **API Key Signing**: Sign with raw P-256 keypairs +* **On-Device Key Signing**: Sign with keys stored in Secure Enclave or Keychain + * Automatic backend selection (prefers Secure Enclave when available) + * Manual backend selection for specific requirements +* **Passkey Signing**: WebAuthn-compliant passkey authentication +* **Unified Interface**: Single `stamp()` method returns the correct header name and value +* **Key Management**: Create, list, and delete on-device key pairs --- -## Requirements +## Usage -* iOS 16.0+ / macOS 13.0+ -* Swift 5.7+ +### 1. API Key Signing ---- +Sign with a raw P-256 key pair (both public and private key provided): -## Usage +```swift +import TurnkeyStamper + +let stamper = Stamper(apiPublicKey: "", apiPrivateKey: "") +let (headerName, headerValue) = try await stamper.stamp(payload: jsonPayload) +// headerName: "X-Stamp" +``` -### API Key Signing +### 2. On-Device Key Signing + +Sign with a key stored in Secure Enclave or Keychain (only public key needed): ```swift import TurnkeyStamper -let stamper = Stamper(apiPublicKey: "", apiPrivateKey: "") +// Create a new on-device key pair +let publicKey = try Stamper.createOnDeviceKeyPair() + +// Sign with automatic backend selection (prefers Secure Enclave) +let stamper = try Stamper(apiPublicKey: publicKey) +let (headerName, headerValue) = try await stamper.stamp(payload: jsonPayload) +// headerName: "X-Stamp" ``` -### Passkey Signing +#### Manual Backend Selection + +You can explicitly choose which backend to use: + +```swift +// Force Secure Enclave +let stamper = try Stamper(apiPublicKey: publicKey, onDevicePreference: .secureEnclave) + +// Force Secure Storage (Keychain) +let stamper = try Stamper(apiPublicKey: publicKey, onDevicePreference: .secureStorage) + +// Auto (default) - prefers Secure Enclave when available +let stamper = try Stamper(apiPublicKey: publicKey, onDevicePreference: .auto) +``` + +#### Key Management + +```swift +// Create a new key pair +let publicKey = try Stamper.createOnDeviceKeyPair(preference: .auto) + +// List existing key pairs +let keys = try Stamper.listOnDeviceKeyPairs(preference: .auto) + +// Delete a key pair +try Stamper.deleteOnDeviceKeyPair(publicKeyHex: publicKey, preference: .auto) +``` + +#### Advanced: Secure Enclave with Biometric Protection + +For Secure Enclave, you can set an authentication policy at key creation time. The policy is embedded in the key and enforced by the hardware: ```swift import TurnkeyStamper -let stamper = Stamper(rpId: "your.site.com", presentationAnchor: anchor) +// Create config with biometric requirement +let config = SecureEnclaveStamper.SecureEnclaveConfig(authPolicy: .biometryAny) + +// Create key with biometric protection +let publicKey = try SecureEnclaveStamper.createKeyPair(config: config) + +// All subsequent operations work normally - the biometric prompt happens automatically +let stamp = try SecureEnclaveStamper.stamp(payload: jsonPayload, publicKeyHex: publicKey) +// User is prompted for biometric authentication when signing ``` -The resulting header can be attached to any HTTP request for authenticated interaction with Turnkey services. +**Note**: Unlike Secure Storage, Secure Enclave config is only used at key creation. Subsequent operations (list, stamp, delete) don't need the config because the auth policy is permanently embedded in the key by the hardware. + +#### Advanced: Secure Storage with Custom Configuration + +For Secure Storage (Keychain), you can customize storage attributes like access groups, iCloud sync, or biometric protection: + +```swift +import TurnkeyStamper + +// Create custom configuration +let config = SecureStorageStamper.SecureStorageConfig( + accessibility: .afterFirstUnlockThisDeviceOnly, + accessControlPolicy: .biometryAny, // Require biometric authentication + authPrompt: "Authenticate to sign", + biometryReuseWindowSeconds: 30, + synchronizable: false, // Don't sync to iCloud + accessGroup: "com.example.shared" // Share keys between apps +) + +// Create key with custom config +let publicKey = try SecureStorageStamper.createKeyPair(config: config) + +// IMPORTANT: All subsequent operations MUST use the same config +let keys = try SecureStorageStamper.listKeyPairs(config: config) +let stamp = try SecureStorageStamper.stamp(payload: jsonPayload, publicKeyHex: publicKey, config: config) +try SecureStorageStamper.deleteKeyPair(publicKeyHex: publicKey, config: config) +``` + +**Note**: Keychain queries must match how items were stored. If you create a key with custom config attributes (especially `accessGroup`, `synchronizable`, or `accessControlPolicy`), you must pass that same config to all subsequent operations (`listKeyPairs`, `stamp`, `deleteKeyPair`). If you use default settings, the no-config methods work fine. + +### 3. Passkey Signing + +Sign with WebAuthn passkeys: + +```swift +import TurnkeyStamper + +let stamper = Stamper(rpId: "your.site.com", presentationAnchor: window) +let (headerName, headerValue) = try await stamper.stamp(payload: jsonPayload) +// headerName: "X-Stamp-WebAuthn" +``` + +--- + +## Architecture + +### Secure Enclave Stamper + +The **Secure Enclave** is Apple's dedicated secure coprocessor: + +* Private keys are generated and stored inside the Secure Enclave +* Keys never leave the secure enclave - signing happens inside +* Available on iPhone 5s and later, iPad Air and later, Macs with Apple Silicon or T2 chip +* Metadata stored in iCloud Keychain for persistence + +### Secure Storage Stamper + +The **Secure Storage** stamper uses the device's Keychain: + +* Private keys stored in local Keychain +* Available after first device unlock (no biometric protection by default) +* Used as fallback when Secure Enclave is unavailable +* Works on all Apple devices + +### Automatic Selection + +When using `.auto` preference (default), the stamper: +1. Checks if Secure Enclave is available +2. Uses Secure Enclave if supported, otherwise falls back to Secure Storage + +--- + +## Requirements + +* iOS 17.0+ / macOS 14.0+ +* Swift 5.9+ --- diff --git a/Sources/TurnkeySwift/Internal/AddressFormatDefaults.swift b/Sources/TurnkeySwift/Internal/AddressFormatDefaults.swift new file mode 100644 index 00000000..0bdc6d06 --- /dev/null +++ b/Sources/TurnkeySwift/Internal/AddressFormatDefaults.swift @@ -0,0 +1,63 @@ +import Foundation +import TurnkeyHttp + +// Maps AddressFormat to default payload encoding and hash function. +// Values mirror sdk-core addressFormatConfig for parity across platforms. +struct AddressFormatDefaults { + struct Defaults { + let encoding: PayloadEncoding + let hashFunction: HashFunction + } + + static func defaults(for addressFormat: AddressFormat) -> Defaults { + switch addressFormat { + case .address_format_uncompressed, + .address_format_compressed: + return .init(encoding: .payload_encoding_hexadecimal, hashFunction: .hash_function_sha256) + + case .address_format_ethereum: + return .init(encoding: .payload_encoding_hexadecimal, hashFunction: .hash_function_keccak256) + + case .address_format_solana, + .address_format_sui, + .address_format_aptos, + .address_format_ton_v3r2, + .address_format_ton_v4r2, + .address_format_ton_v5r1, + .address_format_xlm: + return .init(encoding: .payload_encoding_hexadecimal, hashFunction: .hash_function_not_applicable) + + case .address_format_cosmos, + .address_format_sei: + return .init(encoding: .payload_encoding_text_utf8, hashFunction: .hash_function_sha256) + + case .address_format_tron, + .address_format_bitcoin_mainnet_p2pkh, + .address_format_bitcoin_mainnet_p2sh, + .address_format_bitcoin_mainnet_p2wpkh, + .address_format_bitcoin_mainnet_p2wsh, + .address_format_bitcoin_mainnet_p2tr, + .address_format_bitcoin_testnet_p2pkh, + .address_format_bitcoin_testnet_p2sh, + .address_format_bitcoin_testnet_p2wpkh, + .address_format_bitcoin_testnet_p2wsh, + .address_format_bitcoin_testnet_p2tr, + .address_format_bitcoin_signet_p2pkh, + .address_format_bitcoin_signet_p2sh, + .address_format_bitcoin_signet_p2wpkh, + .address_format_bitcoin_signet_p2wsh, + .address_format_bitcoin_signet_p2tr, + .address_format_bitcoin_regtest_p2pkh, + .address_format_bitcoin_regtest_p2sh, + .address_format_bitcoin_regtest_p2wpkh, + .address_format_bitcoin_regtest_p2wsh, + .address_format_bitcoin_regtest_p2tr, + .address_format_doge_mainnet, + .address_format_doge_testnet, + .address_format_xrp: + return .init(encoding: .payload_encoding_hexadecimal, hashFunction: .hash_function_sha256) + } + } +} + + diff --git a/Sources/TurnkeySwift/Internal/MessageEncoding.swift b/Sources/TurnkeySwift/Internal/MessageEncoding.swift new file mode 100644 index 00000000..80a401bd --- /dev/null +++ b/Sources/TurnkeySwift/Internal/MessageEncoding.swift @@ -0,0 +1,24 @@ +import Foundation +import TurnkeyHttp + +enum MessageEncodingHelper { + static func ethereumPrefixed(messageData: Data) -> Data { + // "\x19Ethereum Signed Message:\n" + message length (decimal) + message + let prefix = "\u{0019}Ethereum Signed Message:\n" + String(messageData.count) + var prefixed = Data(prefix.utf8) + prefixed.append(messageData) + return prefixed + } + + static func encodeMessageBytes(_ bytes: Data, as encoding: PayloadEncoding) -> String { + if encoding == .payload_encoding_hexadecimal { + return "0x" + bytes.map { String(format: "%02x", $0) }.joined() + } + + // we decode back to a UTF-8 string + return String(decoding: bytes, as: UTF8.self) + } + +} + + diff --git a/Sources/TurnkeySwift/Internal/Storage/Keys/KeyPairStore.swift b/Sources/TurnkeySwift/Internal/Storage/Keys/KeyPairStore.swift deleted file mode 100644 index 508427df..00000000 --- a/Sources/TurnkeySwift/Internal/Storage/Keys/KeyPairStore.swift +++ /dev/null @@ -1,24 +0,0 @@ -import Foundation - -/// Stores private key material in the device's secure storage. -/// Keys are indexed by their public key hex string and used for signing authenticated Turnkey requests. -enum KeyPairStore { - private static let secureAccount = Constants.Storage.secureAccount - - static func save(privateHex: String, for publicHex: String) throws { - try SecureStore.set(Data(privateHex.utf8), service: publicHex, account: secureAccount) - } - - static func getPrivateHex(for publicHex: String) throws -> String { - guard let data = try SecureStore.get(service: publicHex, account: secureAccount), - let str = String(data: data, encoding: .utf8) - else { - throw TurnkeySwiftError.keyNotFound - } - return str - } - - static func delete(for publicHex: String) throws { - try SecureStore.delete(service: publicHex, account: secureAccount) - } -} diff --git a/Sources/TurnkeySwift/Internal/Storage/Keys/PendingKeysStore.swift b/Sources/TurnkeySwift/Internal/Storage/Keys/PendingKeysStore.swift index 9e37826a..f4d8d878 100644 --- a/Sources/TurnkeySwift/Internal/Storage/Keys/PendingKeysStore.swift +++ b/Sources/TurnkeySwift/Internal/Storage/Keys/PendingKeysStore.swift @@ -1,10 +1,10 @@ import Foundation +import TurnkeyStamper /// Tracks generated but unused public keys along with their expiration timestamps. /// This is used to clean up stale key material that was never used to establish a session. enum PendingKeysStore { private static let storeKey = Constants.Storage.pendingKeysStoreKey - private static let secureAccount = Constants.Storage.secureAccount private static let q = DispatchQueue(label: "pendingKeys", attributes: .concurrent) static func add(_ pub: String, ttlHours: Double = 1) throws { @@ -32,7 +32,7 @@ enum PendingKeysStore { let now = Date().timeIntervalSince1970 for (pub, expiry) in all() where expiry < now { do { - try SecureStore.delete(service: pub, account: secureAccount) + try Stamper.deleteOnDeviceKeyPair(publicKeyHex: pub) try remove(pub) } catch { print("PendingKeysStore purge error for \(pub): \(error)") diff --git a/Sources/TurnkeySwift/Internal/Storage/Primitives/SecureStorage.swift b/Sources/TurnkeySwift/Internal/Storage/Primitives/SecureStorage.swift deleted file mode 100644 index a03a4349..00000000 --- a/Sources/TurnkeySwift/Internal/Storage/Primitives/SecureStorage.swift +++ /dev/null @@ -1,82 +0,0 @@ -import Foundation -import Security - -enum SecureStore { - enum ItemClass { case genericPassword, key } - - static func set( - _ data: Data, - service: String, - account: String, - accessible: CFString = kSecAttrAccessibleAfterFirstUnlock, - itemClass: ItemClass = .genericPassword - ) throws { - let query: [String: Any] = [ - kSecClass as String: keyClass(itemClass), - kSecAttrService as String: service, - kSecAttrAccount as String: account, - ] - let deleteStatus = SecItemDelete(query as CFDictionary) - if deleteStatus != errSecSuccess && deleteStatus != errSecItemNotFound { - throw StorageError.keychainDeleteFailed(status: deleteStatus) - } - - var attrs = query - attrs[kSecValueData as String] = data - attrs[kSecAttrAccessible as String] = accessible - - let addStatus = SecItemAdd(attrs as CFDictionary, nil) - guard addStatus == errSecSuccess else { - throw StorageError.keychainAddFailed(status: addStatus) - } - } - - static func get( - service: String, - account: String, - itemClass: ItemClass = .genericPassword - ) throws -> Data? { - let query: [String: Any] = [ - kSecClass as String: keyClass(itemClass), - kSecAttrService as String: service, - kSecAttrAccount as String: account, - kSecReturnData as String: true, - kSecMatchLimit as String: kSecMatchLimitOne, - ] - var out: CFTypeRef? - let status = SecItemCopyMatching(query as CFDictionary, &out) - - if status == errSecItemNotFound { - return nil - } - - guard status == errSecSuccess else { - throw StorageError.keychainFetchFailed(status: status) - } - - return out as? Data - } - - static func delete( - service: String, - account: String, - itemClass: ItemClass = .genericPassword - ) throws { - let query: [String: Any] = [ - kSecClass as String: keyClass(itemClass), - kSecAttrService as String: service, - kSecAttrAccount as String: account, - ] - let status = SecItemDelete(query as CFDictionary) - if status != errSecSuccess && status != errSecItemNotFound { - throw StorageError.keychainDeleteFailed(status: status) - } - } - - private static func keyClass(_ c: ItemClass) -> CFString { - switch c { - case .genericPassword: return kSecClassGenericPassword - case .key: return kSecClassKey - } - } -} diff --git a/Sources/TurnkeySwift/Internal/Storage/Sessions/JWTSessionStore.swift b/Sources/TurnkeySwift/Internal/Storage/Sessions/JWTSessionStore.swift index eed53b3e..9ababd3c 100644 --- a/Sources/TurnkeySwift/Internal/Storage/Sessions/JWTSessionStore.swift +++ b/Sources/TurnkeySwift/Internal/Storage/Sessions/JWTSessionStore.swift @@ -1,14 +1,22 @@ import Foundation +/// Internal storage structure for session data including both decoded JWT and raw token +struct StoredSession: Codable { + let decoded: TurnkeySession + let jwt: String +} + /// Stores and retrieves decoded Turnkey session JWTs by session key /// Used to persist session metadata such as organization ID, user ID, and public key /// so that sessions can be restored or reused across app launches. enum JwtSessionStore: KeyValueStore { - static func save(_ value: TurnkeySession, key: String) throws { + typealias Value = StoredSession + + static func save(_ value: StoredSession, key: String) throws { try LocalStore.set(value, for: key) } - static func load(key: String) throws -> TurnkeySession? { + static func load(key: String) throws -> StoredSession? { try LocalStore.get(key) } diff --git a/Sources/TurnkeySwift/Internal/Storage/Sessions/SessionRegistryStore.swift b/Sources/TurnkeySwift/Internal/Storage/Sessions/SessionRegistryStore.swift index 59f2e810..08a26859 100644 --- a/Sources/TurnkeySwift/Internal/Storage/Sessions/SessionRegistryStore.swift +++ b/Sources/TurnkeySwift/Internal/Storage/Sessions/SessionRegistryStore.swift @@ -1,11 +1,11 @@ import Foundation +import TurnkeyStamper /// Stores a list of all active session keys. /// Used to track and manage multiple JWT-backed sessions, and to purge expired ones. enum SessionRegistryStore: CollectionStore { private static let storeKey = Constants.Storage.sessionRegistryKey - private static let secureAccount = Constants.Storage.secureAccount private static let q = DispatchQueue(label: "sessionKeys", attributes: .concurrent) static func add(_ sessionKey: String) throws { @@ -37,11 +37,11 @@ enum SessionRegistryStore: CollectionStore { let selectedSessionKey = try? SelectedSessionStore.load() for sessionKey in sessionKeys { - if let sess = try JwtSessionStore.load(key: sessionKey) { - if Date(timeIntervalSince1970: sess.exp) <= Date() { + if let stored = try JwtSessionStore.load(key: sessionKey) { + if Date(timeIntervalSince1970: stored.decoded.exp) <= Date() { JwtSessionStore.delete(key: sessionKey) try AutoRefreshStore.remove(for: sessionKey) - try KeyPairStore.delete(for: sess.publicKey) + try Stamper.deleteOnDeviceKeyPair(publicKeyHex: stored.decoded.publicKey) try remove(sessionKey) // if we just removed the selected session we clear the SelectedSessionStore diff --git a/Sources/TurnkeySwift/Internal/TurnkeyContext+AuthProxy.swift b/Sources/TurnkeySwift/Internal/TurnkeyContext+AuthProxy.swift new file mode 100644 index 00000000..f337cbd7 --- /dev/null +++ b/Sources/TurnkeySwift/Internal/TurnkeyContext+AuthProxy.swift @@ -0,0 +1,257 @@ +import Foundation +import TurnkeyTypes +import TurnkeyHttp + +extension TurnkeyContext { + @MainActor + internal func setRuntimeConfig(_ config: TurnkeyRuntimeConfig) { + self.runtimeConfig = config + } + + /// Initializes the runtime configuration. + /// + /// If an Auth Proxy configuration ID is available, this method fetches the Wallet Kit configuration + /// from the Turnkey Auth Proxy. It then constructs the complete runtime configuration + /// combining remote and local settings. + /// + /// - Note: This function runs asynchronously and updates `runtimeConfig` on the main thread. + internal func initializeRuntimeConfig() async { + // if an Auth Proxy config ID is available we fetch the Wallet Kit config + var walletKitConfig: ProxyGetWalletKitConfigResponse? + if let client, let _ = self.authProxyConfigId { + do { + let response = try await client.proxyGetWalletKitConfig(ProxyTGetWalletKitConfigBody()) + walletKitConfig = response + } catch { + walletKitConfig = nil + } + } + + // we always build the runtime configuration using the Wallet Kit config (if available) + // and local defaults + let config = buildRuntimeConfig(walletKitConfig: walletKitConfig) + await MainActor.run { + self.runtimeConfig = config + } + } + + /// Builds the complete runtime configuration object. + /// + /// Merges values from the fetched Wallet Kit configuration, user-provided configuration, + /// and fallback defaults. Handles URL sanitization, OAuth provider overrides, and passkey options. + /// + /// - Parameter walletKitConfig: Optional configuration fetched from the Auth Proxy. + /// - Returns: A fully constructed `TurnkeyRuntimeConfig` instance. + internal func buildRuntimeConfig( + walletKitConfig: ProxyGetWalletKitConfigResponse? + ) -> TurnkeyRuntimeConfig { + // we sanitize the auth proxy URL + let trimmedAuthProxyUrl = authProxyUrl.trimmingCharacters(in: .whitespacesAndNewlines) + let sanitizedAuthProxyUrl = trimmedAuthProxyUrl.isEmpty ? nil : authProxyUrl + + // we resolve the OAuth redirect base URL and app scheme + let redirectBaseUrl = userConfig.auth?.oauth?.redirectUri + ?? walletKitConfig?.oauthRedirectUrl + ?? Constants.Turnkey.oauthRedirectUrl + let appScheme = userConfig.auth?.oauth?.appScheme + + // we resolve per-provider OAuth info + var resolvedProviders: [String: TurnkeyRuntimeConfig.Auth.Oauth.Provider] = [:] + let proxyClientIds = walletKitConfig?.oauthClientIds ?? [:] + let providers = ["google", "apple", "x", "discord"] + for provider in providers { + let override: TurnkeyConfig.Auth.Oauth.ProviderOverride? = { + switch provider { + case "google": return userConfig.auth?.oauth?.providers?.google + case "apple": return userConfig.auth?.oauth?.providers?.apple + case "x": return userConfig.auth?.oauth?.providers?.x + case "discord": return userConfig.auth?.oauth?.providers?.discord + default: return nil + } + }() + + let clientId = override?.clientId ?? proxyClientIds[provider] + + // for X and Discord, if there is no explicit provider redirect and we have an appScheme + // we default to scheme:// + let providerRedirect: String? = { + if let explicit = override?.redirectUri { + return explicit + } + if (provider == "x" || provider == "discord"), let scheme = appScheme, !scheme.isEmpty { + return scheme.hasSuffix("://") ? scheme : "\(scheme)://" + } + return nil + }() + + resolvedProviders[provider] = .init(clientId: clientId, redirectUri: providerRedirect) + } + + // we resolve passkey options + let passkey: TurnkeyRuntimeConfig.Auth.Passkey? = { + if let p = userConfig.auth?.passkey { + return TurnkeyRuntimeConfig.Auth.Passkey( + passkeyName: p.passkeyName, + rpId: p.rpId ?? userConfig.rpId, + rpName: p.rpName + ) + } else if userConfig.rpId != nil { + return TurnkeyRuntimeConfig.Auth.Passkey( + passkeyName: nil, + rpId: userConfig.rpId, + rpName: nil + ) + } else { + return nil + } + }() + + let auth = TurnkeyRuntimeConfig.Auth( + sessionExpirationSeconds: walletKitConfig?.sessionExpirationSeconds ?? Constants.Session.defaultExpirationSeconds, + oauth: .init( + redirectBaseUrl: redirectBaseUrl, + appScheme: appScheme, + providers: resolvedProviders + ), + autoRefreshSession: userConfig.auth?.autoRefreshSession ?? true, + passkey: passkey, + createSuborgParams: userConfig.auth?.createSuborgParams + ) + + let runtime = TurnkeyRuntimeConfig( + authProxyUrl: sanitizedAuthProxyUrl, + auth: auth, + autoRefreshManagedState: userConfig.autoRefreshManagedState ?? true + ) + + return runtime + } + + /// Builds a signup body for creating a new sub-organization. + /// + /// Constructs a `ProxyTSignupBody` payload for the Turnkey Auth Proxy based on the provided + /// `CreateSubOrgParams`. Supports authenticators, API keys, OAuth providers, and user metadata. + /// Default names are generated automatically when missing. + /// + /// - Parameter createSubOrgParams: Parameters describing the new sub-organization, credentials, and user details. + /// - Returns: A fully populated `ProxyTSignupBody` object suitable for submission to the Auth Proxy. + func buildSignUpBody(createSubOrgParams: CreateSubOrgParams) -> ProxyTSignupBody { + // TODO: is there names have a uniqueness constraint per user? + // if so then this will fail if we have to autofill multiple authenticators (e.g. two apiKeys) + let now = Int(Date().timeIntervalSince1970) + + // authenticators to v1AuthenticatorParamsV2 + let authenticators: [v1AuthenticatorParamsV2] + if let list = createSubOrgParams.authenticators, !list.isEmpty { + authenticators = list.map { auth in + v1AuthenticatorParamsV2( + attestation: auth.attestation, + authenticatorName: auth.authenticatorName ?? "passkey-\(now)", + challenge: auth.challenge + ) + } + } else { + authenticators = [] + } + + // apiKeys to v1ApiKeyParamsV2 + let apiKeys: [v1ApiKeyParamsV2] + if let list = createSubOrgParams.apiKeys, !list.isEmpty { + apiKeys = list.map { apiKey in + v1ApiKeyParamsV2( + apiKeyName: apiKey.apiKeyName ?? "api-key-\(now)", + curveType: apiKey.curveType, + expirationSeconds: apiKey.expirationSeconds, + publicKey: apiKey.publicKey + ) + } + } else { + apiKeys = [] + } + + + // oauthProviders to v1OauthProviderParams + let oauthProviders: [v1OauthProviderParams] + if let list = createSubOrgParams.oauthProviders, !list.isEmpty { + oauthProviders = list.map { provider in + v1OauthProviderParams( + oidcToken: provider.oidcToken, + providerName: provider.providerName + ) + } + } else { + oauthProviders = [] + } + + // Construct ProxyTSignupBody + return ProxyTSignupBody( + apiKeys: apiKeys, + authenticators: authenticators, + oauthProviders: oauthProviders, + organizationName: createSubOrgParams.subOrgName ?? "sub-org-\(now)", + userEmail: createSubOrgParams.userEmail, + userName: createSubOrgParams.userName + ?? createSubOrgParams.userEmail + ?? "user-\(now)", + userPhoneNumber: createSubOrgParams.userPhoneNumber, + userTag: createSubOrgParams.userTag, + verificationToken: createSubOrgParams.verificationToken, + wallet: createSubOrgParams.customWallet + ) + } + + /// Creates an Auth Proxy client if a configuration ID is available. + /// + /// Generates a `TurnkeyClient` preconfigured for Auth Proxy requests using the stored + /// proxy URL and configuration ID. + /// + /// - Returns: A configured `TurnkeyClient` if `authProxyConfigId` is set, otherwise `nil`. + internal func makeAuthProxyClientIfNeeded() -> TurnkeyClient? { + if let configId = self.authProxyConfigId { + return TurnkeyClient( + authProxyConfigId: configId, + authProxyUrl: self.authProxyUrl + ) + } else { + return nil + } + } + + /// Creates a TurnkeyClient with stamper and optional auth proxy configuration. + /// + /// If auth proxy is configured, creates a client that can handle both authenticated + /// requests (via stamper) and auth proxy requests. Otherwise, creates a client with + /// only stamper configuration. + /// + /// - Parameter apiPublicKey: The hex-encoded API public key whose private key is stored on-device. + /// - Returns: A configured TurnkeyClient. + /// - Throws: An error if the private key corresponding to the public key is not found. + internal func makeClientWithStamper(apiPublicKey: String) throws -> TurnkeyClient { + if let authProxyConfigId = self.authProxyConfigId { + return try TurnkeyClient( + apiPublicKey: apiPublicKey, + authProxyConfigId: authProxyConfigId, + baseUrl: apiUrl, + authProxyUrl: authProxyUrl + ) + } else { + return try TurnkeyClient( + apiPublicKey: apiPublicKey, + baseUrl: apiUrl + ) + } + } + + /// Resolves the session expiration duration in seconds. + /// + /// Determines the expiration time based on the provided value, runtime configuration, + /// or the default constant if neither is set. + /// + /// - Parameter expirationSeconds: Optional explicit expiration duration in seconds. + /// - Returns: The resolved expiration duration as a string. + internal func resolvedSessionExpirationSeconds(expirationSeconds: String? = nil) -> String { + return expirationSeconds ?? runtimeConfig?.auth.sessionExpirationSeconds ?? Constants.Session.defaultExpirationSeconds + } +} + + diff --git a/Sources/TurnkeySwift/Internal/TurnkeyContext+InternalHelpers.swift b/Sources/TurnkeySwift/Internal/TurnkeyContext+InternalHelpers.swift deleted file mode 100644 index ba2afdf8..00000000 --- a/Sources/TurnkeySwift/Internal/TurnkeyContext+InternalHelpers.swift +++ /dev/null @@ -1,273 +0,0 @@ -import Foundation -import TurnkeyHttp - -#if canImport(UIKit) -import UIKit -#endif - -#if canImport(AppKit) -import AppKit -#endif - -extension TurnkeyContext { - - /// Returns the appropriate notification that fires when the app returns to foreground. - /// - /// - Returns: The notification name for foreground entry on supported platforms. - static var foregroundNotification: Notification.Name? { - #if os(iOS) || os(tvOS) || os(visionOS) - UIApplication.willEnterForegroundNotification - #elseif os(macOS) - NSApplication.didBecomeActiveNotification - #else - nil - #endif - } - - /// Attempts to restore the most recently selected session on app launch or resume. - /// - /// Loads the selected session key from persistent storage and re-establishes the client/user state if valid. - func restoreSelectedSession() async { - do { - guard let sessionKey = try SelectedSessionStore.load(), - (try? JwtSessionStore.load(key: sessionKey)) != nil - else { - // if we fail that means the selected session expired - // so we delete it from the SelectedSessionStore - SelectedSessionStore.delete() - await MainActor.run { self.authState = .unAuthenticated } - return - } - - await MainActor.run { self.authState = .authenticated } - _ = try? await setSelectedSession(sessionKey: sessionKey) - } catch { - await MainActor.run { self.authState = .unAuthenticated } - } - } - - /// Reschedules expiry timers for all persisted sessions. - /// - /// Iterates over all stored session keys and schedules timers based on JWT expiration. - func rescheduleAllSessionExpiries() async { - do { - for key in try SessionRegistryStore.all() { - guard let dto = try? JwtSessionStore.load(key: key) else { continue } - scheduleExpiryTimer(for: key, expTimestamp: dto.exp) - } - } catch { - // Silently fail - } - } - - /// Schedules an expiry timer to automatically refresh or clear a session when its JWT expires. - /// - /// - Parameters: - /// - sessionKey: The key identifying the session to monitor. - /// - expTimestamp: The UNIX timestamp (in seconds) when the JWT expires. - /// - buffer: Seconds to subtract from the expiry time to fire early (default is 5 seconds) - func scheduleExpiryTimer( - for sessionKey: String, - expTimestamp: TimeInterval, - buffer: TimeInterval = 5 - ) { - // cancel any old timer - expiryTasks[sessionKey]?.cancel() - - let timeLeft = expTimestamp - Date().timeIntervalSince1970 - - // if already within (or past) the buffer window, we just clear now - if timeLeft <= buffer { - clearSession(for: sessionKey) - return - } - - let interval = timeLeft - buffer - let deadline = DispatchTime.now() + .milliseconds(Int(interval * 1_000)) - let timer = DispatchSource.makeTimerSource() - - timer.schedule(deadline: deadline, leeway: .milliseconds(100)) - timer.setEventHandler { [weak self] in - guard let self = self else { return } - - // we calculate how much time is left when this handler actually runs - // this is needed because if the app was backgrounded past the expiry, - // the dispatch timer will still fire once the app returns to foreground - // this avoids making a call we know will fail - let currentLeft = expTimestamp - Date().timeIntervalSince1970 - if currentLeft <= 0 { - self.clearSession(for: sessionKey) - timer.cancel() - return - } - - if let dur = AutoRefreshStore.durationSeconds(for: sessionKey) { - Task { - do { - try await self.refreshSession( - expirationSeconds: dur, - sessionKey: sessionKey - ) - } catch { - self.clearSession(for: sessionKey) - } - } - } else { - self.clearSession(for: sessionKey) - } - - timer.cancel() - } - - timer.resume() - expiryTasks[sessionKey] = timer - } - - - - /// Persists all storage-level artefacts for a session, schedules its expiry - /// timer, and (optionally) registers the session for auto-refresh. - func persistSession( - dto: TurnkeySession, - sessionKey: String, - refreshedSessionTTLSeconds: String? = nil - ) throws { - try JwtSessionStore.save(dto, key: sessionKey) - try SessionRegistryStore.add(sessionKey) - - let priv = try KeyPairStore.getPrivateHex(for: dto.publicKey) - if priv.isEmpty { throw TurnkeySwiftError.keyNotFound } - try PendingKeysStore.remove(dto.publicKey) - - if let duration = refreshedSessionTTLSeconds { - try AutoRefreshStore.set(durationSeconds: duration, for: sessionKey) - } - - scheduleExpiryTimer(for: sessionKey, expTimestamp: dto.exp) - } - - /// Removes *only* the stored artefacts for a session (no UI / in-memory reset). - /// - /// - Parameters: - /// - sessionKey: The key identifying the session in storage. - /// - keepAutoRefresh: Whether to retain any auto-refresh setting. - func purgeStoredSession( - for sessionKey: String, - keepAutoRefresh: Bool - ) throws { - expiryTasks[sessionKey]?.cancel() - expiryTasks.removeValue(forKey: sessionKey) - - if let dto = try? JwtSessionStore.load(key: sessionKey) { - try? KeyPairStore.delete(for: dto.publicKey) - } - - JwtSessionStore.delete(key: sessionKey) - try? SessionRegistryStore.remove(sessionKey) - - if !keepAutoRefresh { - try? AutoRefreshStore.remove(for: sessionKey) - } - } - - /// Updates an existing session with a new JWT, preserving any configured auto-refresh duration. - /// - /// - Parameters: - /// - jwt: The fresh JWT string returned by the Turnkey backend. - /// - sessionKey: The identifier of the session to update. Defaults to `Constants.Session.defaultSessionKey`. - /// - /// - Throws: - /// - `TurnkeySwiftError.keyNotFound` if no session exists under the given key. - /// - `TurnkeySwiftError.failedToCreateSession` if decoding or persistence operations fail. - func updateSession( - jwt: String, - sessionKey: String = Constants.Session.defaultSessionKey - ) async throws { - do { - // eventually we should verify that the jwt was signed by Turnkey - // but for now we just assume it is - - guard try JwtSessionStore.load(key: sessionKey) != nil else { - throw TurnkeySwiftError.keyNotFound - } - - // remove old key material but preserve any auto-refresh duration - try purgeStoredSession(for: sessionKey, keepAutoRefresh: true) - - let dto = try JWTDecoder.decode(jwt, as: TurnkeySession.self) - let nextDuration = AutoRefreshStore.durationSeconds(for: sessionKey) - try persistSession(dto: dto, - sessionKey: sessionKey, - refreshedSessionTTLSeconds: nextDuration) - } catch { - throw TurnkeySwiftError.failedToCreateSession(underlying: error) - } - } - - /// Fetches the current session user's full profile and associated wallets. - /// - /// - Parameters: - /// - client: The `TurnkeyClient` instance for API calls. - /// - organizationId: The organization ID associated with the session. - /// - userId: The user ID to retrieve. - /// - Returns: A fully populated `SessionUser` object containing user metadata and wallet accounts. - func fetchSessionUser( - using client: TurnkeyClient, - organizationId: String, - userId: String - ) async throws -> SessionUser { - guard !organizationId.isEmpty, !userId.isEmpty else { - throw TurnkeySwiftError.invalidResponse - } - - do { - // run user and wallets requests in parallel - async let userResp = client.getUser(organizationId: organizationId, userId: userId) - async let walletsResp = client.getWallets(organizationId: organizationId) - - let user = try await userResp.body.json.user - let wallets = try await walletsResp.body.json.wallets - - // fetch wallet accounts concurrently - let detailed = try await withThrowingTaskGroup(of: SessionUser.UserWallet.self) { group in - for w in wallets { - group.addTask { - let accounts = try await client.getWalletAccounts( - organizationId: organizationId, - walletId: w.walletId, - paginationOptions: nil - ).body.json.accounts.map { - SessionUser.UserWallet.WalletAccount( - id: $0.walletAccountId, - curve: $0.curve, - pathFormat: $0.pathFormat, - path: $0.path, - addressFormat: $0.addressFormat, - address: $0.address, - createdAt: $0.createdAt, - updatedAt: $0.updatedAt - ) - } - return SessionUser.UserWallet(id: w.walletId, name: w.walletName, accounts: accounts) - } - } - - var res: [SessionUser.UserWallet] = [] - for try await item in group { res.append(item) } - return res - } - - return SessionUser( - id: user.userId, - userName: user.userName, - email: user.userEmail, - phoneNumber: user.userPhoneNumber, - organizationId: organizationId, - wallets: detailed - ) - - } catch { - throw error - } - } -} diff --git a/Sources/TurnkeySwift/Internal/TurnkeyContext+OAuthHelpers.swift b/Sources/TurnkeySwift/Internal/TurnkeyContext+OAuthHelpers.swift new file mode 100644 index 00000000..21e1785f --- /dev/null +++ b/Sources/TurnkeySwift/Internal/TurnkeyContext+OAuthHelpers.swift @@ -0,0 +1,253 @@ +import Foundation +import TurnkeyTypes +import AuthenticationServices +import CryptoKit +import Security + +extension TurnkeyContext { + + /// Builds an OAuth URL for initiating a login or signup flow. + /// + /// Constructs a fully encoded OAuth URL for the given provider, + /// including client ID, redirect URI, nonce, and optional additional state parameters. + /// + /// - Parameters: + /// - provider: The OAuth provider name (e.g., "google", "apple", "x", "discord"). + /// - clientId: The client identifier registered with the OAuth provider. + /// - redirectUri: The redirect URI used for callback. + /// - nonce: A unique nonce value to include in the request. + /// - additionalState: Optional additional key–value pairs to append as state. + /// + /// - Returns: A fully constructed OAuth request `URL`. + /// + /// - Throws: `TurnkeySwiftError.oauthInvalidURL` if the final URL cannot be created. + internal func buildOAuthURL( + provider: String, + clientId: String, + redirectUri: String, + nonce: String, + additionalState: [String: String]? + ) throws -> URL { + let finalOriginUri = Constants.Turnkey.oauthOriginUrl + // Encode nested redirectUri like encodeURIComponent + let allowedUnreserved = CharacterSet(charactersIn: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~") + let encodedRedirectUri = redirectUri.addingPercentEncoding(withAllowedCharacters: allowedUnreserved) ?? redirectUri + + var comps = URLComponents(string: finalOriginUri)! + var items: [URLQueryItem] = [ + URLQueryItem(name: "provider", value: provider), + URLQueryItem(name: "clientId", value: clientId), + URLQueryItem(name: "redirectUri", value: encodedRedirectUri), + URLQueryItem(name: "nonce", value: nonce) + ] + if let state = additionalState, !state.isEmpty { + for (k, v) in state { + let ev = v.addingPercentEncoding(withAllowedCharacters: allowedUnreserved) ?? v + items.append(URLQueryItem(name: k, value: ev)) + } + } + comps.percentEncodedQueryItems = items + guard let url = comps.url else { throw TurnkeySwiftError.oauthInvalidURL } + return url + } + + /// Runs an OAuth session and retrieves the OIDC token. + /// + /// Opens a system browser using `ASWebAuthenticationSession` to complete an OAuth flow, + /// then extracts and returns the `id_token` (OIDC token) from the redirect URL upon successful authentication. + /// + /// - Parameters: + /// - provider: The OAuth provider name (e.g., `"google"`, `"discord"`). + /// - clientId: The OAuth client ID associated with the provider. + /// - scheme: The callback scheme used for redirect handling. + /// - anchor: The presentation anchor for the authentication session. + /// - nonce: A unique nonce value used to validate the OAuth response. + /// - additionalState: Optional additional state parameters appended to the OAuth request. + /// + /// - Returns: The OIDC token (`id_token`) returned by the OAuth provider. + /// + /// - Throws: + /// - `TurnkeySwiftError.failedToRetrieveOAuthCredential` if the OAuth flow fails or is cancelled. + /// - `TurnkeySwiftError.oauthMissingIDToken` if the redirect URL does not include an `id_token`. + internal func runOAuthSession( + provider: String, + clientId: String, + scheme: String, + anchor: ASPresentationAnchor, + nonce: String, + additionalState: [String: String]? = nil + ) async throws -> String { + self.oauthAnchor = anchor + let settings = try getOAuthProviderSettings(provider: provider) + let url = try buildOAuthURL( + provider: provider, + clientId: clientId, + redirectUri: settings.redirectUri, + nonce: nonce, + additionalState: additionalState + ) + + return try await withCheckedThrowingContinuation { continuation in + let session = ASWebAuthenticationSession( + url: url, + callbackURLScheme: scheme + ) { callbackURL, error in + if let error { + continuation.resume(throwing: TurnkeySwiftError.failedToRetrieveOAuthCredential(type: .oidcToken, underlying: error)) + return + } + guard + let callbackURL, + let comps = URLComponents(url: callbackURL, resolvingAgainstBaseURL: false), + let idToken = comps.queryItems?.first(where: { $0.name == "id_token" })?.value + else { + continuation.resume(throwing: TurnkeySwiftError.oauthMissingIDToken) + return + } + continuation.resume(returning: idToken) + } + session.presentationContextProvider = self + session.prefersEphemeralWebBrowserSession = false + session.start() + } + } + + /// Generates a PKCE verifier and challenge pair. + /// + /// Produces a cryptographically secure random verifier and its corresponding SHA-256 challenge + /// encoded in Base64URL format, compliant with RFC 7636. + /// + /// - Returns: A tuple containing the `verifier` and `challenge` strings. + /// + /// - Throws: `TurnkeySwiftError.keyGenerationFailed` if secure random byte generation fails. + internal func generatePKCEPair() throws -> (verifier: String, challenge: String) { + var randomBytes = [UInt8](repeating: 0, count: 32) + let status = SecRandomCopyBytes(kSecRandomDefault, randomBytes.count, &randomBytes) + if status != errSecSuccess { + throw TurnkeySwiftError.keyGenerationFailed(NSError(domain: NSOSStatusErrorDomain, code: Int(status))) + } + let verifierData = Data(randomBytes) + let verifier = verifierData + .base64EncodedString(options: []) + .replacingOccurrences(of: "+", with: "-") + .replacingOccurrences(of: "/", with: "_") + .replacingOccurrences(of: "=", with: "") + let challengeData = Data(SHA256.hash(data: Data(verifier.utf8))) + let challenge = challengeData + .base64EncodedString(options: []) + .replacingOccurrences(of: "+", with: "-") + .replacingOccurrences(of: "/", with: "_") + .replacingOccurrences(of: "=", with: "") + return (verifier: verifier, challenge: challenge) + } + + /// Builds an OAuth 2.0 authorization URL using the PKCE flow. + /// + /// Constructs a compliant authorization URL including PKCE parameters such as + /// `code_challenge` and `code_challenge_method`, used for exchanging an auth code later. + /// + /// - Parameters: + /// - baseURL: The OAuth authorization endpoint. + /// - clientId: The client identifier. + /// - redirectUri: The redirect URI registered for the client. + /// - codeChallenge: The PKCE challenge derived from the verifier. + /// - scope: The OAuth scope to request. + /// - state: A unique string used to verify request integrity. + /// + /// - Returns: A fully composed authorization `URL`. + /// + /// - Throws: `TurnkeySwiftError.oauthInvalidURL` if URL construction fails. + internal func buildOAuth2AuthURL( + baseURL: String, + clientId: String, + redirectUri: String, + codeChallenge: String, + scope: String, + state: String + ) throws -> URL { + guard var comps = URLComponents(string: baseURL) else { throw TurnkeySwiftError.oauthInvalidURL } + comps.queryItems = [ + URLQueryItem(name: "client_id", value: clientId), + URLQueryItem(name: "redirect_uri", value: redirectUri), + URLQueryItem(name: "response_type", value: "code"), + URLQueryItem(name: "code_challenge", value: codeChallenge), + URLQueryItem(name: "code_challenge_method", value: "S256"), + URLQueryItem(name: "scope", value: scope), + URLQueryItem(name: "state", value: state) + ] + guard let url = comps.url else { throw TurnkeySwiftError.oauthInvalidURL } + return url + } + + /// Runs an OAuth 2.0 authorization code session. + /// + /// Launches a browser session using `ASWebAuthenticationSession` and waits for + /// a redirect containing an authorization code and optional state. + /// + /// - Parameters: + /// - url: The authorization URL to open. + /// - scheme: The callback scheme for the redirect URI. + /// - anchor: The presentation anchor for the browser session. + /// + /// - Returns: A tuple containing the `authorization code` and optional `state` string. + /// + /// - Throws: + /// - `TurnkeySwiftError.failedToRetrieveOAuthCredential` if the session fails. + /// - `TurnkeySwiftError.invalidResponse` if the callback URL or code is missing. + internal func runOAuth2CodeSession( + url: URL, + scheme: String, + anchor: ASPresentationAnchor + ) async throws -> (code: String, state: String?) { + self.oauthAnchor = anchor + return try await withCheckedThrowingContinuation { continuation in + let session = ASWebAuthenticationSession( + url: url, + callbackURLScheme: scheme + ) { callbackURL, error in + if let error { + continuation.resume(throwing: TurnkeySwiftError.failedToRetrieveOAuthCredential(type: .authCode, underlying: error)) + return + } + guard + let callbackURL, + let comps = URLComponents(url: callbackURL, resolvingAgainstBaseURL: false) + else { + continuation.resume(throwing: TurnkeySwiftError.invalidResponse) + return + } + let code = comps.queryItems?.first(where: { $0.name == "code" })?.value + let state = comps.queryItems?.first(where: { $0.name == "state" })?.value + guard let code else { + continuation.resume(throwing: TurnkeySwiftError.invalidResponse) + return + } + continuation.resume(returning: (code: code, state: state)) + } + session.presentationContextProvider = self + session.prefersEphemeralWebBrowserSession = false + session.start() + } + } + + /// Resolves OAuth provider configuration for the given provider. + /// + /// Uses runtime and user configuration to determine client ID, redirect URI, + /// and app scheme for a specific OAuth provider. + /// + /// - Parameter provider: The provider identifier (e.g., "google", "apple", "x", "discord"). + /// - Returns: A tuple containing the resolved `clientId`, `redirectUri`, and `appScheme`. + /// + /// - Throws: Never directly, but may return empty values if configuration is incomplete. + internal func getOAuthProviderSettings(provider: String) throws -> (clientId: String, redirectUri: String, appScheme: String) { + let providerInfo = runtimeConfig?.auth.oauth.providers[provider] + let clientId = providerInfo?.clientId ?? "" + let appScheme = runtimeConfig?.auth.oauth.appScheme ?? "" + let redirectBase = runtimeConfig?.auth.oauth.redirectBaseUrl ?? Constants.Turnkey.oauthRedirectUrl + let redirectUri = (providerInfo?.redirectUri?.isEmpty == false) + ? (providerInfo!.redirectUri!) + : "\(redirectBase)?scheme=\(appScheme)" + + return (clientId: clientId, redirectUri: redirectUri, appScheme: appScheme) + } +} diff --git a/Sources/TurnkeySwift/Internal/TurnkeyContext+SessionManagement.swift b/Sources/TurnkeySwift/Internal/TurnkeyContext+SessionManagement.swift new file mode 100644 index 00000000..0556e154 --- /dev/null +++ b/Sources/TurnkeySwift/Internal/TurnkeyContext+SessionManagement.swift @@ -0,0 +1,99 @@ +import Foundation +import TurnkeyTypes +import TurnkeyStamper + +extension TurnkeyContext { + + /// Restores the previously selected session from persistent storage. + /// + /// Attempts to load the last active session key from storage and re-establish + /// the authenticated state if the session is still valid. + /// If the stored session is expired or missing, it is removed and + /// the authentication state is reset to unauthenticated. + /// + /// - Note: This method is called automatically on app launch or resume. + func restoreSelectedSession() async { + do { + guard let sessionKey = try SelectedSessionStore.load(), + (try? JwtSessionStore.load(key: sessionKey)) != nil + else { + // if we fail that means the selected session expired + // so we delete it from the SelectedSessionStore + SelectedSessionStore.delete() + await MainActor.run { self.authState = .unAuthenticated } + return + } + + await MainActor.run { self.authState = .authenticated } + _ = try? await self.setActiveSession(sessionKey: sessionKey) + } catch { + await MainActor.run { self.authState = .unAuthenticated } + } + } + + /// Persists all artifacts associated with a session. + /// + /// Saves the session payload (decoded JWT, token, and metadata) into storage, + /// registers it with the session registry, removes any pending keys, + /// and schedules an expiration timer for automatic cleanup. + /// + /// - Parameters: + /// - dto: The decoded `TurnkeySession` object representing the session. + /// - jwt: The raw session JWT. + /// - sessionKey: The unique key used to identify this session in storage. + /// - refreshedSessionTTLSeconds: Optional override for the session's TTL (used for auto-refresh scheduling). + /// + /// - Throws: + /// - `TurnkeySwiftError.keyNotFound` if the private key for the session’s public key is missing. + /// - Any error thrown during session persistence or store updates. + func persistSession( + stored: TurnkeySession, + jwt: String, + sessionKey: String, + refreshedSessionTTLSeconds: String? = nil + ) throws { + let stored = StoredSession(decoded: stored, jwt: jwt) + try JwtSessionStore.save(stored, key: sessionKey) + try SessionRegistryStore.add(sessionKey) + + let exists = try Stamper.existsOnDeviceKeyPair(publicKeyHex: stored.decoded.publicKey) + if !exists { throw TurnkeySwiftError.keyNotFound } + try PendingKeysStore.remove(stored.decoded.publicKey) + + if let duration = refreshedSessionTTLSeconds { + try AutoRefreshStore.set(durationSeconds: duration, for: sessionKey) + } + + scheduleExpiryTimer(for: sessionKey, expTimestamp: stored.decoded.exp) + } + + /// Removes stored session data from disk. + /// + /// Deletes all persisted artifacts associated with a session, including the JWT, + /// registry entry, and any private keys, while optionally preserving auto-refresh settings. + /// Does not modify in-memory state or authentication status. + /// + /// - Parameters: + /// - sessionKey: The key identifying the stored session. + /// - keepAutoRefresh: Whether to retain any existing auto-refresh configuration for the session. + /// + /// - Throws: Any error encountered while removing session data from local stores. + func purgeStoredSession( + for sessionKey: String, + keepAutoRefresh: Bool + ) throws { + expiryTasks[sessionKey]?.cancel() + expiryTasks.removeValue(forKey: sessionKey) + + if let stored = try? JwtSessionStore.load(key: sessionKey) { + try? Stamper.deleteOnDeviceKeyPair(publicKeyHex: stored.decoded.publicKey) + } + + JwtSessionStore.delete(key: sessionKey) + try? SessionRegistryStore.remove(sessionKey) + + if !keepAutoRefresh { + try? AutoRefreshStore.remove(for: sessionKey) + } + } +} diff --git a/Sources/TurnkeySwift/Internal/TurnkeyContext+Timers.swift b/Sources/TurnkeySwift/Internal/TurnkeyContext+Timers.swift new file mode 100644 index 00000000..2f8b72b2 --- /dev/null +++ b/Sources/TurnkeySwift/Internal/TurnkeyContext+Timers.swift @@ -0,0 +1,113 @@ +import Foundation + +#if canImport(UIKit) +import UIKit +#endif + +#if canImport(AppKit) +import AppKit +#endif + +extension TurnkeyContext { + + /// Returns the system notification triggered when the app enters the foreground. + /// + /// Resolves the appropriate notification name based on the active platform (iOS, tvOS, visionOS, or macOS). + /// + /// - Returns: The platform-specific `Notification.Name` for foreground entry, or `nil` if unsupported. + static var foregroundNotification: Notification.Name? { + #if os(iOS) || os(tvOS) || os(visionOS) + UIApplication.willEnterForegroundNotification + #elseif os(macOS) + NSApplication.didBecomeActiveNotification + #else + nil + #endif + } + + /// Reschedules expiry timers for all persisted sessions. + /// + /// Iterates through all stored sessions in the registry, restoring + /// their expiration timers based on JWT expiry timestamps. + /// + /// - Note: This method is typically invoked during startup or after app resume. + func rescheduleAllSessionExpiries() async { + do { + for key in try SessionRegistryStore.all() { + guard let stored = try? JwtSessionStore.load(key: key) else { continue } + scheduleExpiryTimer(for: key, expTimestamp: stored.decoded.exp) + } + } catch { + // Silently fail + } + } + + /// Schedules an expiry timer for a given session. + /// + /// Sets up a timer that triggers just before a session’s JWT expiration time. + /// If an auto-refresh duration is configured, the timer attempts to refresh the session. + /// Otherwise, it clears the session when the timer fires. + /// + /// - Parameters: + /// - sessionKey: The key identifying the session to monitor. + /// - expTimestamp: The UNIX timestamp (in seconds) when the JWT expires. + /// - buffer: The number of seconds before expiry to trigger the timer early (default is 5 seconds). + /// + /// - Note: Existing timers for the same session are automatically cancelled before scheduling a new one. + func scheduleExpiryTimer( + for sessionKey: String, + expTimestamp: TimeInterval, + buffer: TimeInterval = 5 + ) { + // cancel any old timer + expiryTasks[sessionKey]?.cancel() + + let timeLeft = expTimestamp - Date().timeIntervalSince1970 + + // if already within (or past) the buffer window, we just clear now + if timeLeft <= buffer { + clearSession(for: sessionKey) + return + } + + let interval = timeLeft - buffer + let deadline = DispatchTime.now() + .milliseconds(Int(interval * 1_000)) + let timer = DispatchSource.makeTimerSource() + + timer.schedule(deadline: deadline, leeway: .milliseconds(100)) + timer.setEventHandler { [weak self] in + guard let self = self else { return } + + // we calculate how much time is left when this handler actually runs + // this is needed because if the app was backgrounded past the expiry, + // the dispatch timer will still fire once the app returns to foreground + // this avoids making a call we know will fail + let currentLeft = expTimestamp - Date().timeIntervalSince1970 + if currentLeft <= 0 { + self.clearSession(for: sessionKey) + timer.cancel() + return + } + + if let dur = AutoRefreshStore.durationSeconds(for: sessionKey) { + Task { + do { + try await self.refreshSession( + expirationSeconds: dur, + sessionKey: sessionKey + ) + } catch { + self.clearSession(for: sessionKey) + } + } + } else { + self.clearSession(for: sessionKey) + } + + timer.cancel() + } + + timer.resume() + expiryTasks[sessionKey] = timer + } +} diff --git a/Sources/TurnkeySwift/Models/AuthModels.swift b/Sources/TurnkeySwift/Models/AuthModels.swift new file mode 100644 index 00000000..20e8e7ef --- /dev/null +++ b/Sources/TurnkeySwift/Models/AuthModels.swift @@ -0,0 +1,95 @@ +import Foundation +import TurnkeyHttp +import TurnkeyTypes + +public enum OtpType: String, Codable { + case email = "OTP_TYPE_EMAIL" + case sms = "OTP_TYPE_SMS" +} + +public enum OAuthCredentialType: String, Sendable { + case oidcToken + case authCode +} + +public struct OAuthSuccess: Sendable { + public let oidcToken: String + public let providerName: String + public let publicKey: String +} + +public struct CreateSubOrgParams: Codable, Sendable { + /// Name of the user + public var userName: String? + + /// Name of the sub-organization + public var subOrgName: String? + + /// Email of the user + public var userEmail: String? + + /// Tag of the user + public var userTag: String? + + /// List of authenticators + public var authenticators: [Authenticator]? + + /// Phone number of the user + public var userPhoneNumber: String? + + /// Verification token if email or phone number is provided + public var verificationToken: String? + + /// List of API keys + public var apiKeys: [ApiKey]? + + /// Custom wallet to create during sub-org creation time + public var customWallet: v1WalletParams? + + /// List of OAuth providers + public var oauthProviders: [Provider]? + + public struct Authenticator: Codable, Sendable { + /// Name of the authenticator + public var authenticatorName: String? + + /// Challenge string to use for passkey registration + public var challenge: String + + /// Attestation object returned from the passkey creation process + public var attestation: v1Attestation + } + + public struct ApiKey: Codable, Sendable { + /// Name of the API key + public var apiKeyName: String? + + /// Public key in hex format + public var publicKey: String + + /// Curve type + public var curveType: v1ApiKeyCurve + + /// Expiration in seconds + public var expirationSeconds: String? + } + + public struct CustomWallet: Codable, Sendable { + /// Name of the wallet created + public var walletName: String + + /// List of wallet accounts to create + public var walletAccounts: [v1WalletAccountParams] + } + + public struct Provider: Codable, Sendable { + /// Name of the OAuth provider + public var providerName: String + + /// OIDC token + public var oidcToken: String + } +} + + + diff --git a/Sources/TurnkeySwift/Models/Constants.swift b/Sources/TurnkeySwift/Models/Constants.swift index fce0704d..e3cc920c 100644 --- a/Sources/TurnkeySwift/Models/Constants.swift +++ b/Sources/TurnkeySwift/Models/Constants.swift @@ -8,7 +8,6 @@ public enum Constants { } public enum Storage { - public static let secureAccount = "p256-private" public static let selectedSessionKey = "com.turnkey.sdk.selectedSession" public static let sessionRegistryKey = "com.turnkey.sdk.sessionKeys" public static let pendingKeysStoreKey = "com.turnkey.sdk.pendingList" @@ -17,6 +16,7 @@ public enum Constants { public enum Turnkey { public static let defaultApiUrl = "https://api.turnkey.com" + public static let defaultAuthProxyUrl = "https://authproxy.turnkey.com" public static let oauthOriginUrl = "https://oauth-origin.turnkey.com" public static let oauthRedirectUrl = "https://oauth-redirect.turnkey.com" } diff --git a/Sources/TurnkeySwift/Models/Errors.swift b/Sources/TurnkeySwift/Models/Errors.swift index 14834376..8abaff38 100644 --- a/Sources/TurnkeySwift/Models/Errors.swift +++ b/Sources/TurnkeySwift/Models/Errors.swift @@ -1,15 +1,33 @@ import Foundation +import TurnkeyHttp -enum StorageError: Error { +public enum StorageError: LocalizedError, Sendable { case keychainAddFailed(status: OSStatus) case keychainFetchFailed(status: OSStatus) case keychainDeleteFailed(status: OSStatus) case invalidJWT case encodingFailed(key: String, underlying: Error) case decodingFailed(key: String, underlying: Error) + + public var errorDescription: String? { + switch self { + case .keychainAddFailed(let status): + return "Keychain add operation failed with status \(status)." + case .keychainFetchFailed(let status): + return "Keychain fetch operation failed with status \(status)." + case .keychainDeleteFailed(let status): + return "Keychain delete operation failed with status \(status)." + case .invalidJWT: + return "Invalid JWT format." + case .encodingFailed(let key, let underlying): + return "Failed to encode value for key '\(key)': \(underlying.localizedDescription)" + case .decodingFailed(let key, let underlying): + return "Failed to decode value for key '\(key)': \(underlying.localizedDescription)" + } + } } -enum TurnkeySwiftError: Error { +public enum TurnkeySwiftError: LocalizedError, Sendable { case keyGenerationFailed(Error) case keyIndexFailed(status: OSStatus) case keyAlreadyExists @@ -21,23 +39,133 @@ enum TurnkeySwiftError: Error { case invalidResponse case invalidSession case invalidRefreshTTL(String) + case invalidConfiguration(String) + case missingAuthProxyConfiguration + case failedToSignPayload(underlying: Error) - case failedToCreateSession(underlying: Error) + case failedToStoreSession(underlying: Error) case failedToClearSession(underlying: Error) case failedToRefreshSession(underlying: Error) - case failedToRefreshUser(underlying: Error) + case failedToFetchUser(underlying: Error) case failedToSetSelectedSession(underlying: Error) case failedToCreateWallet(underlying: Error) case failedToExportWallet(underlying: Error) case failedToImportWallet(underlying: Error) + case failedToFetchWallets(underlying: Error) case failedToUpdateUser(underlying: Error) case failedToUpdateUserEmail(underlying: Error) case failedToUpdateUserPhoneNumber(underlying: Error) + case failedToLoginWithPasskey(underlying: Error) + case failedToSignUpWithPasskey(underlying: Error) + case failedToInitOtp(underlying: Error) + case failedToVerifyOtp(underlying: Error) + case failedToLoginWithOtp(underlying: Error) + case failedToSignUpWithOtp(underlying: Error) + case failedToCompleteOtp(underlying: Error) + case failedToLoginWithOAuth(underlying: Error) + case failedToSignUpWithOAuth(underlying: Error) + case failedToCompleteOAuth(underlying: Error) - case oauthInvalidURL case oauthMissingIDToken - case oauthFailed(underlying: Error) + case failedToRetrieveOAuthCredential(type: OAuthCredentialType, underlying: Error) + + + public var errorDescription: String? { + switch self { + case .keyAlreadyExists: return "Key already exists." + case .keyNotFound: return "Key not found." + case .publicKeyMissing: return "Missing public key." + case .signingNotSupported: return "Signing is not supported for this key." + case .invalidJWT: return "Invalid JWT format." + case .invalidResponse: return "Invalid response from server." + case .invalidSession: return "Session is invalid or expired." + case .invalidConfiguration(let msg): return "Invalid configuration: \(msg)" + case .missingAuthProxyConfiguration: + return "Auth Proxy client not initialized. Ensure `authProxyConfigId` is provided in the TurnkeyConfig." + case .oauthInvalidURL: return "OAuth flow failed: invalid URL." + case .oauthMissingIDToken: return "OAuth flow failed: missing ID token." + + case .keyIndexFailed(let status): + return "Failed to retrieve key index (OSStatus: \(status))." + case .keychainAddFailed(let status): + return "Keychain add operation failed (OSStatus: \(status))." + + case .failedToRetrieveOAuthCredential(let type, let e): + return "Failed to retrieve \(type.rawValue) from OAuth callback: \(e.localizedDescription)" + + case .keyGenerationFailed(let e), + .failedToSignPayload(let e), + .failedToStoreSession(let e), + .failedToClearSession(let e), + .failedToRefreshSession(let e), + .failedToFetchUser(let e), + .failedToSetSelectedSession(let e), + .failedToCreateWallet(let e), + .failedToExportWallet(let e), + .failedToImportWallet(let e), + .failedToFetchWallets(let e), + .failedToUpdateUser(let e), + .failedToUpdateUserEmail(let e), + .failedToUpdateUserPhoneNumber(let e), + .failedToLoginWithPasskey(let e), + .failedToSignUpWithPasskey(let e), + .failedToInitOtp(let e), + .failedToVerifyOtp(let e), + .failedToLoginWithOtp(let e), + .failedToSignUpWithOtp(let e), + .failedToCompleteOtp(let e), + .failedToLoginWithOAuth(let e), + .failedToSignUpWithOAuth(let e), + .failedToCompleteOAuth(let e): + + // prefer rich TurnkeyRequestError message when available + if let turnkeyError = e as? TurnkeyRequestError { + return turnkeyError.fullMessage + } + return e.localizedDescription + + case .invalidRefreshTTL(let ttl): + return "Invalid refresh TTL: \(ttl)" + } + } + + // underlying TurnkeyRequestError extraction + public var underlyingTurnkeyError: TurnkeyRequestError? { + switch self { + case .keyGenerationFailed(let e), + .failedToSignPayload(let e), + .failedToStoreSession(let e), + .failedToClearSession(let e), + .failedToRefreshSession(let e), + .failedToFetchUser(let e), + .failedToSetSelectedSession(let e), + .failedToCreateWallet(let e), + .failedToExportWallet(let e), + .failedToImportWallet(let e), + .failedToFetchWallets(let e), + .failedToUpdateUser(let e), + .failedToUpdateUserEmail(let e), + .failedToUpdateUserPhoneNumber(let e), + .failedToLoginWithPasskey(let e), + .failedToInitOtp(let e), + .failedToVerifyOtp(let e), + .failedToLoginWithOtp(let e): + return e as? TurnkeyRequestError + default: + return nil + } + } +} +extension Error { + /// returns any TurnkeyRequestError found within the error chain + public var turnkeyRequestError: TurnkeyRequestError? { + if let e = self as? TurnkeyRequestError { return e } + if let swiftError = self as? TurnkeySwiftError { + return swiftError.underlyingTurnkeyError + } + return nil + } } diff --git a/Sources/TurnkeySwift/Models/MethodModels.swift b/Sources/TurnkeySwift/Models/MethodModels.swift new file mode 100644 index 00000000..b86de388 --- /dev/null +++ b/Sources/TurnkeySwift/Models/MethodModels.swift @@ -0,0 +1,36 @@ +// Shared +public enum AuthAction: String, Codable { + case login + case signup +} + +public struct BaseAuthResult: Codable, Sendable { + public let session: String +} + +// Passkey +public struct PasskeyAuthResult: Codable { + public let session: String + public let credentialId: String +} + +// OTP +public struct InitOtpResult: Codable, Sendable { + public let otpId: String +} + +public struct VerifyOtpResult: Codable, Sendable { + public let credentialBundle: String +} + +public struct CompleteOtpResult: Codable { + public let session: String + public let verificationToken: String + public let action: AuthAction +} + +// OAuth +public struct CompleteOAuthResult: Codable { + public let session: String + public let action: AuthAction +} diff --git a/Sources/TurnkeySwift/Models/SessionModels.swift b/Sources/TurnkeySwift/Models/SessionModels.swift index 1f7383e9..3281620c 100644 --- a/Sources/TurnkeySwift/Models/SessionModels.swift +++ b/Sources/TurnkeySwift/Models/SessionModels.swift @@ -1,4 +1,5 @@ import Foundation +import TurnkeyTypes public enum AuthState{ case loading @@ -6,44 +7,62 @@ public enum AuthState{ case unAuthenticated } +public enum SessionType: String, Codable { + case readWrite = "SESSION_TYPE_READ_WRITE" + case readOnly = "SESSION_TYPE_READ_ONLY" +} + +// this is what the jwt returned by Turnkey decodes to public struct TurnkeySession: Codable, Equatable { - public let exp: TimeInterval - public let publicKey: String - public let sessionType: String - public let userId: String - public let organizationId: String - - enum CodingKeys: String, CodingKey { - case exp - case publicKey = "public_key" - case sessionType = "session_type" - case userId = "user_id" - case organizationId = "organization_id" - } + public let exp: TimeInterval + public let publicKey: String + public let sessionType: SessionType + public let userId: String + public let organizationId: String + + enum CodingKeys: String, CodingKey { + case exp + case publicKey = "public_key" + case sessionType = "session_type" + case userId = "user_id" + case organizationId = "organization_id" + } } -public struct SessionUser: Identifiable, Codable { - public let id: String - public let userName: String - public let email: String? - public let phoneNumber: String? - public let organizationId: String - public let wallets: [UserWallet] - - public struct UserWallet: Codable { - public let id: String - public let name: String - public let accounts: [WalletAccount] - - public struct WalletAccount: Codable { - public let id: String - public let curve: Curve - public let pathFormat: PathFormat - public let path: String - public let addressFormat: AddressFormat - public let address: String - public let createdAt: Timestamp - public let updatedAt: Timestamp +// TurnkeySession with an added raw JWT token +// for people that are doing backend authentication +public struct Session: Codable, Equatable, Identifiable { + public let exp: TimeInterval + public let publicKey: String + public let sessionType: SessionType + public let userId: String + public let organizationId: String + public let token: String? + + public var id: String { publicKey } + + enum CodingKeys: String, CodingKey { + case exp + case publicKey = "public_key" + case sessionType = "session_type" + case userId = "user_id" + case organizationId = "organization_id" + case token } - } } + + + + +public struct Wallet: Identifiable, Codable { + public let walletId: String + public let walletName: String + public let createdAt: String + public let updatedAt: String + public let exported: Bool + public let imported: Bool + public let accounts: [v1WalletAccount] + + public var id: String { walletId } +} + diff --git a/Sources/TurnkeySwift/Models/TurnkeyConfigModels.swift b/Sources/TurnkeySwift/Models/TurnkeyConfigModels.swift new file mode 100644 index 00000000..d7ce5674 --- /dev/null +++ b/Sources/TurnkeySwift/Models/TurnkeyConfigModels.swift @@ -0,0 +1,201 @@ +import Foundation + +struct OtpConfigResolved: Sendable { + var email: Bool + var sms: Bool + var alphanumeric: Bool + var length: String +} + +public struct OauthProviderOverride: Sendable { + public var clientId: String? + public var redirectUri: String? + public init(clientId: String? = nil, redirectUri: String? = nil) { + self.clientId = clientId + self.redirectUri = redirectUri + } +} + +public struct OauthProvidersPartial: Sendable { + public var google: OauthProviderOverride? + public var apple: OauthProviderOverride? + public var x: OauthProviderOverride? + public var discord: OauthProviderOverride? + public init(google: OauthProviderOverride? = nil, apple: OauthProviderOverride? = nil, x: OauthProviderOverride? = nil, discord: OauthProviderOverride? = nil) { + self.google = google + self.apple = apple + self.x = x + self.discord = discord + } +} + +struct OauthProviderResolved: Sendable { + var clientId: String? + var redirectUri: String? +} + +public struct OauthConfigPartial: Sendable { + public var redirectUri: String? + public var appScheme: String? + public var providers: OauthProvidersPartial? + public init(redirectUri: String? = nil, appScheme: String? = nil, providers: OauthProvidersPartial? = nil) { + self.redirectUri = redirectUri + self.appScheme = appScheme + self.providers = providers + } +} + +struct OauthConfigResolved: Sendable { + var redirectBaseUrl: String + var appScheme: String? + var providers: [String: OauthProviderResolved] +} + +public struct PasskeyOptionsPartial: Sendable { + public var passkeyName: String? + public var rpId: String? + public var rpName: String? + public init(passkeyName: String? = nil, rpId: String? = nil, rpName: String? = nil) { + self.passkeyName = passkeyName + self.rpId = rpId + self.rpName = rpName + } +} + +struct PasskeyOptionsResolved: Sendable { + var passkeyName: String? + var rpId: String? + var rpName: String? +} + +public struct CreateSuborgDefaultsPartial: Sendable { + public var emailOtpAuth: CreateSubOrgParams? + public var smsOtpAuth: CreateSubOrgParams? + public var passkeyAuth: CreateSubOrgParams? + public var oauth: CreateSubOrgParams? + public init(emailOtpAuth: CreateSubOrgParams? = nil, smsOtpAuth: CreateSubOrgParams? = nil, passkeyAuth: CreateSubOrgParams? = nil, oauth: CreateSubOrgParams? = nil) { + self.emailOtpAuth = emailOtpAuth + self.smsOtpAuth = smsOtpAuth + self.passkeyAuth = passkeyAuth + self.oauth = oauth + } +} + +struct CreateSuborgDefaultsResolved: Sendable { + var emailOtpAuth: CreateSubOrgParams? + var smsOtpAuth: CreateSubOrgParams? + var passkeyAuth: CreateSubOrgParams? + var oauth: CreateSubOrgParams? +} + +// MARK: Internal runtime config using resolved shapes +struct TurnkeyRuntimeConfig: Sendable { + struct Auth: Sendable { + struct Oauth: Sendable { + typealias Provider = OauthProviderResolved + var redirectBaseUrl: String + var appScheme: String? + var providers: [String: Provider] + } + + var sessionExpirationSeconds: String + var oauth: Oauth + var autoRefreshSession: Bool + + typealias Passkey = PasskeyOptionsResolved + var passkey: Passkey? + + typealias CreateSuborgParamsByAuthMethod = TurnkeyConfig.Auth.CreateSuborgParamsByAuthMethod + var createSuborgParams: CreateSuborgParamsByAuthMethod? + } + + var authProxyUrl: String? + var auth: Auth + var autoRefreshManagedState: Bool +} + +public struct TurnkeyConfig: Sendable { + public struct Auth: Sendable { + + public struct Oauth: Sendable { + public typealias ProviderOverride = OauthProviderOverride + public typealias Providers = OauthProvidersPartial + public var redirectUri: String? + public var appScheme: String? + public var providers: Providers? + public init(redirectUri: String? = nil, appScheme: String? = nil, providers: Providers? = nil) { + self.redirectUri = redirectUri + self.appScheme = appScheme + self.providers = providers + } + } + + /// CreateSubOrg parameters for each authentication method. + public struct CreateSuborgParamsByAuthMethod: Sendable { + public var emailOtpAuth: CreateSubOrgParams? + public var smsOtpAuth: CreateSubOrgParams? + public var passkeyAuth: CreateSubOrgParams? + public var walletAuth: CreateSubOrgParams? + public var oauth: CreateSubOrgParams? + + public init( + emailOtpAuth: CreateSubOrgParams? = nil, + smsOtpAuth: CreateSubOrgParams? = nil, + passkeyAuth: CreateSubOrgParams? = nil, + walletAuth: CreateSubOrgParams? = nil, + oauth: CreateSubOrgParams? = nil + ) { + self.emailOtpAuth = emailOtpAuth + self.smsOtpAuth = smsOtpAuth + self.passkeyAuth = passkeyAuth + self.walletAuth = walletAuth + self.oauth = oauth + } + } + + public var oauth: Oauth? + public var autoRefreshSession: Bool? + public typealias Passkey = PasskeyOptionsPartial + public var passkey: Passkey? + public var createSuborgParams: CreateSuborgParamsByAuthMethod? + + public init( + oauth: Oauth? = nil, + autoRefreshSession: Bool? = nil, + passkey: Passkey? = nil, + createSuborgParams: CreateSuborgParamsByAuthMethod? = nil + ) { + self.oauth = oauth + self.autoRefreshSession = autoRefreshSession + self.passkey = passkey + self.createSuborgParams = createSuborgParams + } + } + + public var apiUrl: String + public var authProxyUrl: String + public var authProxyConfigId: String? + public var rpId: String? + public var organizationId: String? + + public var auth: Auth? + public var autoRefreshManagedState: Bool? + + public init( + apiUrl: String = Constants.Turnkey.defaultApiUrl, + authProxyUrl: String = Constants.Turnkey.defaultAuthProxyUrl, + authProxyConfigId: String? = nil, + rpId: String? = nil, + organizationId: String? = nil, + auth: Auth? = nil, + autoRefreshManagedState: Bool? = nil + ) { + self.apiUrl = apiUrl + self.authProxyUrl = authProxyUrl + self.authProxyConfigId = authProxyConfigId + self.rpId = rpId + self.organizationId = organizationId + self.auth = auth + self.autoRefreshManagedState = autoRefreshManagedState + } +} diff --git a/Sources/TurnkeySwift/Models/TurnkeyModels.swift b/Sources/TurnkeySwift/Models/TurnkeyModels.swift index b0f2fb9a..fc5426d5 100644 --- a/Sources/TurnkeySwift/Models/TurnkeyModels.swift +++ b/Sources/TurnkeySwift/Models/TurnkeyModels.swift @@ -1,13 +1,17 @@ import TurnkeyHttp +import TurnkeyTypes -public typealias PayloadEncoding = Components.Schemas.PayloadEncoding -public typealias HashFunction = Components.Schemas.HashFunction -public typealias Curve = Components.Schemas.Curve -public typealias PathFormat = Components.Schemas.PathFormat -public typealias AddressFormat = Components.Schemas.AddressFormat -public typealias Timestamp = Components.Schemas.external_period_data_period_v1_period_Timestamp +public typealias PayloadEncoding = v1PayloadEncoding +public typealias HashFunction = v1HashFunction +public typealias Curve = v1Curve +public typealias PathFormat = v1PathFormat +public typealias AddressFormat = v1AddressFormat +public typealias Timestamp = externaldatav1Timestamp -public typealias WalletAccountParams = Components.Schemas.WalletAccountParams +public typealias WalletAccountParams = v1WalletAccountParams +public typealias WalletAccount = v1WalletAccount -public typealias SignRawPayloadResult = Components.Schemas.SignRawPayloadResult -public typealias Activity = Components.Schemas.Activity +public typealias SignRawPayloadResult = v1SignRawPayloadResult +public typealias Activity = v1Activity + +public typealias ProxyGetWalletKitConfigResponse = ProxyTGetWalletKitConfigResponse diff --git a/Sources/TurnkeySwift/Public/AuthProxy/TurnkeyContext+OAuth.swift b/Sources/TurnkeySwift/Public/AuthProxy/TurnkeyContext+OAuth.swift new file mode 100644 index 00000000..0f580367 --- /dev/null +++ b/Sources/TurnkeySwift/Public/AuthProxy/TurnkeyContext+OAuth.swift @@ -0,0 +1,529 @@ +import Foundation +import TurnkeyTypes +import AuthenticationServices +import CryptoKit +import TurnkeyHttp + +extension TurnkeyContext: ASWebAuthenticationPresentationContextProviding { + + /// Logs in an existing user via OAuth using the provided OIDC token and public key. + /// + /// Performs a proxy OAuth login, creates a session, and returns the resulting session token. + /// + /// - Parameters: + /// - oidcToken: The OIDC token returned from the OAuth provider. + /// - publicKey: The public key bound to the login session. This key is required because it is directly + /// tied to the nonce used during OIDC token generation and must match the value + /// encoded in the token. + /// - organizationId: Optional organization ID if known. + /// - invalidateExisting: Whether to invalidate any existing session (defaults to `false`). + /// - sessionKey: Optional session key to associate with the login. + /// + /// - Returns: A `BaseAuthResult` containing the created session. + /// + /// - Throws: `TurnkeySwiftError.missingAuthProxyConfiguration` if no client is configured, + /// or `TurnkeySwiftError.failedToLoginWithOAuth` if login fails. + @discardableResult + internal func loginWithOAuth( + oidcToken: String, + publicKey: String, + organizationId: String? = nil, + invalidateExisting: Bool = false, + sessionKey: String? = nil + ) async throws -> BaseAuthResult { + guard let client = client else { + throw TurnkeySwiftError.missingAuthProxyConfiguration + } + + do { + let response = try await client.proxyOAuthLogin(ProxyTOAuthLoginBody( + invalidateExisting: invalidateExisting, + oidcToken: oidcToken, + organizationId: organizationId, + publicKey: publicKey + )) + let session = response.session + try await storeSession(jwt: session, sessionKey: sessionKey) + return BaseAuthResult(session: session) + } catch { + throw TurnkeySwiftError.failedToLoginWithOAuth(underlying: error) + } + } + + /// Signs up a new sub-organization and user via OAuth, then performs login. + /// + /// Adds the OAuth provider details to the sub-organization parameters, + /// executes the signup request, and logs in using the same OIDC token. + /// + /// - Parameters: + /// - oidcToken: The OIDC token returned from the OAuth provider. + /// - publicKey: The public key bound to the login session. This key is required because it is directly + /// tied to the nonce used during OIDC token generation and must match the value + /// encoded in the token. + /// - providerName: The OAuth provider name (defaults to `"OpenID Connect Provider "`). + /// - createSubOrgParams: Optional parameters for sub-organization creation. + /// - invalidateExisting: Whether to invalidate any existing session (defaults to `false`). + /// - sessionKey: Optional session key to associate with the signup. + /// + /// - Returns: A `BaseAuthResult` containing the created session. + /// + /// - Throws: `TurnkeySwiftError.missingAuthProxyConfiguration` if no client is configured, + /// or `TurnkeySwiftError.failedToSignUpWithOAuth` if signup or login fails. + @discardableResult + internal func signUpWithOAuth( + oidcToken: String, + publicKey: String, + providerName: String?, + createSubOrgParams: CreateSubOrgParams? = nil, + invalidateExisting: Bool = false, + sessionKey: String? = nil + ) async throws -> BaseAuthResult { + guard let client = client else { + throw TurnkeySwiftError.missingAuthProxyConfiguration + } + + do { + var merged = createSubOrgParams ?? CreateSubOrgParams() + + let resolvedProviderName = providerName ?? "OpenID Connect Provider \(Int(Date().timeIntervalSince1970))" + var oauthProviders = merged.oauthProviders ?? [] + oauthProviders.append(.init(providerName: resolvedProviderName, oidcToken: oidcToken)) + merged.oauthProviders = oauthProviders + + let signupBody = buildSignUpBody(createSubOrgParams: merged) + _ = try await client.proxySignup(signupBody) + + // after signing up we login + return try await loginWithOAuth( + oidcToken: oidcToken, + publicKey: publicKey, + invalidateExisting: invalidateExisting, + sessionKey: sessionKey + ) + } catch { + throw TurnkeySwiftError.failedToSignUpWithOAuth(underlying: error) + } + } + + /// Completes the OAuth flow by checking for an existing account and performing login or signup. + /// + /// Looks up the account using the OIDC token; if an organization exists, logs in, + /// otherwise creates a new sub-organization and completes signup. + /// + /// - Parameters: + /// - oidcToken: The OIDC token returned from the OAuth provider. + /// - publicKey: The public key bound to the session. + /// - providerName: The OAuth provider name (defaults to `"OpenID Connect Provider "`). + /// - invalidateExisting: Whether to invalidate any existing session (defaults to `false`). + /// - createSubOrgParams: Optional parameters for sub-organization creation. + /// - sessionKey: Optional session key returned from the OAuth redirect. + /// + /// - Returns: A `CompleteOAuthResult` describing whether a login or signup occurred. + /// + /// - Throws: `TurnkeySwiftError.missingAuthProxyConfiguration` if no client is configured, + /// or `TurnkeySwiftError.failedToCompleteOAuth` if the operation fails. + @discardableResult + public func completeOAuth( + oidcToken: String, + publicKey: String, + providerName: String? = nil, + invalidateExisting: Bool = false, + createSubOrgParams: CreateSubOrgParams? = nil, + sessionKey: String? = nil + ) async throws -> CompleteOAuthResult { + guard let client = client else { + throw TurnkeySwiftError.missingAuthProxyConfiguration + } + + do { + let account = try await client.proxyGetAccount(ProxyTGetAccountBody( + filterType: "OIDC_TOKEN", + filterValue: oidcToken + )) + + if let organizationId = account.organizationId, !organizationId.isEmpty { + + let result = try await loginWithOAuth( + oidcToken: oidcToken, + publicKey: publicKey, + organizationId: organizationId, + invalidateExisting: invalidateExisting, + sessionKey: sessionKey + ) + return CompleteOAuthResult(session: result.session, action: .login) + } else { + let result = try await signUpWithOAuth( + oidcToken: oidcToken, + publicKey: publicKey, + providerName: providerName, + createSubOrgParams: createSubOrgParams, + invalidateExisting: invalidateExisting, + sessionKey: sessionKey + ) + return CompleteOAuthResult(session: result.session, action: .signup) + } + } catch { + throw TurnkeySwiftError.failedToCompleteOAuth(underlying: error) + } + } + + /// Launches the Google OAuth flow, retrieves the OIDC token, and completes login or signup. + /// + /// Starts the OAuth flow in the system browser, handles the redirect response, + /// and either returns early via `onOAuthSuccess` or completes authentication internally. + /// + /// - Parameters: + /// - anchor: The presentation anchor for the OAuth web session. + /// - clientId: Optional Google OAuth client ID override. + /// - sessionKey: Optional session key returned from the OAuth redirect. + /// - additionalState: Optional key-value pairs appended to the OAuth request state. + /// - onOAuthSuccess: Optional callback invoked with the OIDC token and public key before auto-login. + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidConfiguration` if required provider settings are missing. + /// - `TurnkeySwiftError.failedToRetrieveOAuthCredential` if the OAuth session fails. + /// - `TurnkeySwiftError.failedToCompleteOAuth` if login or signup via Auth Proxy fails. + public func handleGoogleOAuth( + anchor: ASPresentationAnchor, + clientId: String? = nil, + sessionKey: String? = nil, + additionalState: [String: String]? = nil, + onOAuthSuccess: (@Sendable (OAuthSuccess) -> Void)? = nil + ) async throws { + + // we create a keypair and compute the nonce based on the publicKey + let publicKey = try createKeyPair() + let nonceData = Data(publicKey.utf8) + let nonce = SHA256.hash(data: nonceData).map { String(format: "%02x", $0) }.joined() + + // we resolve the provider settings + let settings = try getOAuthProviderSettings(provider: "google") + let clientId = clientId ?? settings.clientId + let scheme = settings.appScheme + + guard !clientId.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing clientId for Google OAuth") + } + guard !scheme.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing app scheme for OAuth redirect") + } + + // we start OAuth flow in the system browser and get an oidcToken + let oidcToken = try await runOAuthSession( + provider: "google", + clientId: clientId, + scheme: scheme, + anchor: anchor, + nonce: nonce, + additionalState: additionalState + ) + + // if onOAuthSuccess was passed in then we run the callback + // and then return early + if let callback = onOAuthSuccess { + callback(.init(oidcToken: oidcToken, providerName: "google", publicKey: publicKey)) + return + } + + // since theres no onOAuthSuccess then we handle auth for them + // via the authProxy + try await completeOAuth( + oidcToken: oidcToken, + publicKey: publicKey, + providerName: "google", + sessionKey: sessionKey + ) + } + + /// Launches the Apple OAuth flow, retrieves the OIDC token, and completes login or signup. + /// + /// Starts the OAuth flow in the system browser, handles the redirect response, + /// and either returns early via `onOAuthSuccess` or completes authentication internally. + /// + /// - Parameters: + /// - anchor: The presentation anchor for the OAuth web session. + /// - clientId: Optional Apple OAuth client ID override. + /// - sessionKey: Optional session key returned from the OAuth redirect. + /// - additionalState: Optional key-value pairs appended to the OAuth request state. + /// - onOAuthSuccess: Optional callback invoked with the OIDC token and public key before auto-login. + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidConfiguration` if required provider settings are missing. + /// - `TurnkeySwiftError.failedToRetrieveOAuthCredential` if the OAuth session fails. + /// - `TurnkeySwiftError.failedToCompleteOAuth` if login or signup via Auth Proxy fails. + public func handleAppleOAuth( + anchor: ASPresentationAnchor, + clientId: String? = nil, + sessionKey: String? = nil, + additionalState: [String: String]? = nil, + onOAuthSuccess: (@Sendable (OAuthSuccess) -> Void)? = nil + ) async throws { + // we create a keypair and compute the nonce based on the publicKey + let publicKey = try createKeyPair() + let nonceData = Data(publicKey.utf8) + let nonce = SHA256.hash(data: nonceData).map { String(format: "%02x", $0) }.joined() + + // we resolve the provider settings + let settings = try getOAuthProviderSettings(provider: "apple") + let clientId = clientId ?? settings.clientId + let scheme = settings.appScheme + + guard !clientId.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing clientId for Apple OAuth") + } + guard !scheme.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing app scheme for OAuth redirect") + } + + // we start OAuth flow in the system browser and get an oidcToken + let oidcToken = try await runOAuthSession( + provider: "apple", + clientId: clientId, + scheme: scheme, + anchor: anchor, + nonce: nonce, + additionalState: additionalState + ) + + // if onOAuthSuccess was passed in then we run the callback + // and then return early + if let callback = onOAuthSuccess { + callback(.init(oidcToken: oidcToken, providerName: "apple", publicKey: publicKey)) + return + } + + // since theres no onOAuthSuccess then we handle auth for them + // via the authProxy + try await completeOAuth( + oidcToken: oidcToken, + publicKey: publicKey, + providerName: "apple", + sessionKey: sessionKey + ) + } + + /// Launches the Discord OAuth (PKCE) flow, exchanges the authorization code via Auth Proxy, + /// and completes login or signup using the retrieved OIDC token. + /// + /// Builds the OAuth request with nonce and public key, opens the system browser, + /// exchanges the returned code, and either triggers `onOAuthSuccess` or finalizes authentication. + /// + /// - Parameters: + /// - anchor: The presentation anchor for the OAuth web session. + /// - clientId: Optional Discord OAuth client ID override. + /// - sessionKey: Optional session key returned from the OAuth redirect. + /// - additionalState: Optional key-value pairs appended to the OAuth request state. + /// - onOAuthSuccess: Optional callback invoked with the OIDC token and public key before auto-login. + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidConfiguration` if provider configuration is missing. + /// - `TurnkeySwiftError.missingAuthProxyConfiguration` if no client is configured. + /// - `TurnkeySwiftError.failedToRetrieveOAuthCredential` if the OAuth session fails. + /// - `TurnkeySwiftError.failedToCompleteOAuth` if login or signup via Auth Proxy fails. + public func handleDiscordOAuth( + anchor: ASPresentationAnchor, + clientId: String? = nil, + sessionKey: String? = nil, + additionalState: [String: String]? = nil, + onOAuthSuccess: (@Sendable (OAuthSuccess) -> Void)? = nil + ) async throws { + guard let client = client else { + throw TurnkeySwiftError.missingAuthProxyConfiguration + } + + // we create a keypair and compute the nonce based on the publicKey + let publicKey = try createKeyPair() + let nonceData = Data(publicKey.utf8) + let nonce = SHA256.hash(data: nonceData).map { String(format: "%02x", $0) }.joined() + + // we resolve the provider settings + let settings = try getOAuthProviderSettings(provider: "discord") + let clientId = clientId ?? settings.clientId + let redirectUri = settings.redirectUri + let scheme = settings.appScheme + + guard !clientId.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing clientId for Discord OAuth") + } + guard !redirectUri.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing redirectUri for OAuth") + } + guard !scheme.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing app scheme for OAuth redirect") + } + + // we generate a verifier and challenge pair + let pkce = try generatePKCEPair() + + // random state + let state = UUID().uuidString + + // we build the provider auth url + let discordAuthUrl = try buildOAuth2AuthURL( + baseURL: "https://discord.com/oauth2/authorize", + clientId: clientId, + redirectUri: redirectUri, + codeChallenge: pkce.challenge, + scope: "identify email", + state: state + ) + + // run system web auth to retrieve authorization code and state + let oauth = try await runOAuth2CodeSession(url: discordAuthUrl, scheme: scheme, anchor: anchor) + + // we validate that returned state matches what we sent + guard oauth.state == state else { + throw TurnkeySwiftError.failedToRetrieveOAuthCredential( + type: .authCode, + underlying: NSError( + domain: "TurnkeySwiftError", + code: -1, + userInfo: [NSLocalizedDescriptionKey: "OAuth state mismatch"] + ) + ) + } + + // we exchange the code for an oidcToken via the authProxy + let resp = try await client.proxyOAuth2Authenticate(ProxyTOAuth2AuthenticateBody( + authCode: oauth.code, + clientId: clientId, + codeVerifier: pkce.verifier, + nonce: nonce, + provider: .oauth2_provider_discord, + redirectUri: redirectUri + )) + + let oidcToken = resp.oidcToken + + // if onOAuthSuccess was passed in then we run the callback + // and then return early + if let callback = onOAuthSuccess { + callback(.init(oidcToken: oidcToken, providerName: "discord", publicKey: publicKey)) + return + } + + // since theres no onOAuthSuccess then we handle auth for them + // via the authProxy + try await completeOAuth( + oidcToken: oidcToken, + publicKey: publicKey, + providerName: "discord", + sessionKey: sessionKey + ) + } + + /// Launches the X (Twitter) OAuth (PKCE) flow, exchanges the authorization code via Auth Proxy, + /// and completes login or signup using the retrieved OIDC token. + /// + /// Builds the OAuth request with nonce and public key, opens the system browser, + /// exchanges the returned code, and either triggers `onOAuthSuccess` or finalizes authentication. + /// + /// - Parameters: + /// - anchor: The presentation anchor for the OAuth web session. + /// - clientId: Optional X OAuth client ID override. + /// - sessionKey: Optional session key returned from the OAuth redirect. + /// - sessionKey: Optional session storage key for the resulting session. + /// - additionalState: Optional key-value pairs appended to the OAuth request state. + /// - onOAuthSuccess: Optional callback invoked with the OIDC token and public key before auto-login. + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidConfiguration` if provider configuration is missing. + /// - `TurnkeySwiftError.missingAuthProxyConfiguration` if no client is configured. + /// - `TurnkeySwiftError.failedToRetrieveOAuthCredential` if the OAuth session fails. + /// - `TurnkeySwiftError.failedToCompleteOAuth` if login or signup via Auth Proxy fails. + public func handleXOauth( + anchor: ASPresentationAnchor, + clientId: String? = nil, + sessionKey: String? = nil, + additionalState: [String: String]? = nil, + onOAuthSuccess: (@Sendable (OAuthSuccess) -> Void)? = nil + ) async throws { + guard let client = client else { + throw TurnkeySwiftError.missingAuthProxyConfiguration + } + + // we create a keypair and compute the nonce based on the publicKey + let publicKey = try createKeyPair() + let nonceData = Data(publicKey.utf8) + let nonce = SHA256.hash(data: nonceData).map { String(format: "%02x", $0) }.joined() + + // we resolve the provider settings + let settings = try getOAuthProviderSettings(provider: "x") + let clientId = clientId ?? settings.clientId + let redirectUri = settings.redirectUri + let scheme = settings.appScheme + + guard !clientId.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing clientId for X OAuth") + } + guard !redirectUri.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing redirectUri for OAuth") + } + guard !scheme.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing app scheme for OAuth redirect") + } + + // we generate a verifier and challenge pair + let pkce = try generatePKCEPair() + + // random state + let state = UUID().uuidString + + // we build the provider auth url + let xAuthUrl = try buildOAuth2AuthURL( + baseURL: "https://x.com/i/oauth2/authorize", + clientId: clientId, + redirectUri: redirectUri, + codeChallenge:pkce.challenge, + scope: "tweet.read users.read", + state: state + ) + + // run system web auth to retrieve authorization code and state + let oauth = try await runOAuth2CodeSession(url: xAuthUrl, scheme: scheme, anchor: anchor) + + // we validate that returned state matches what we sent + guard oauth.state == state else { + throw TurnkeySwiftError.failedToRetrieveOAuthCredential( + type: .authCode, + underlying: NSError( + domain: "TurnkeySwiftError", + code: -1, + userInfo: [NSLocalizedDescriptionKey: "OAuth state mismatch"] + ) + ) + } + + // we exchange the code for an oidcToken via the authProxy + let resp = try await client.proxyOAuth2Authenticate(ProxyTOAuth2AuthenticateBody( + authCode: oauth.code, + clientId: clientId, + codeVerifier: pkce.verifier, + nonce: nonce, + provider: .oauth2_provider_x, + redirectUri: redirectUri + )) + + let oidcToken = resp.oidcToken + + // if onOAuthSuccess was passed in then we run the callback + // and then return early + if let callback = onOAuthSuccess { + callback(.init(oidcToken: oidcToken, providerName: "twitter", publicKey: publicKey)) + return + } + + // since theres no onOAuthSuccess then we handle auth for them + // via the authProxy + try await completeOAuth( + oidcToken: oidcToken, + publicKey: publicKey, + providerName: "twitter", + sessionKey: sessionKey + ) + } + + public func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { + oauthAnchor ?? ASPresentationAnchor() + } +} diff --git a/Sources/TurnkeySwift/Public/AuthProxy/TurnkeyContext+Otp.swift b/Sources/TurnkeySwift/Public/AuthProxy/TurnkeyContext+Otp.swift new file mode 100644 index 00000000..86e26c8f --- /dev/null +++ b/Sources/TurnkeySwift/Public/AuthProxy/TurnkeyContext+Otp.swift @@ -0,0 +1,275 @@ +import Foundation +import AuthenticationServices +import TurnkeyTypes +import TurnkeyHttp + +extension TurnkeyContext { + /// Initiates an OTP flow for the given contact and type. + /// + /// Sends an OTP to the specified contact using the configured Auth Proxy. + /// + /// - Parameters: + /// - contact: The user's contact (email or phone) to send the OTP to. + /// - otpType: The type of OTP to initiate (`.email` or `.sms`). + /// + /// - Returns: An `InitOtpResult` containing the `otpId` that uniquely identifies this OTP request. + /// + /// - Throws: + /// - `TurnkeySwiftError.missingAuthProxyConfiguration` if the Auth Proxy client is not configured. + /// - `TurnkeySwiftError.failedToInitOtp` if the OTP initiation request fails. + public func initOtp(contact: String, otpType: OtpType) async throws -> InitOtpResult { + + guard let client = client else { + throw TurnkeySwiftError.missingAuthProxyConfiguration + } + + do { + let resp = try await client.proxyInitOtp(ProxyTInitOtpBody( + contact: contact, + otpType: otpType.rawValue + )) + + return InitOtpResult(otpId: resp.otpId) + } catch { + throw TurnkeySwiftError.failedToInitOtp(underlying: error) + } + } + + /// Verifies a user-provided OTP code for a given OTP request. + /// + /// Validates the provided code and returns a verification token for subsequent login or signup. + /// + /// - Parameters: + /// - otpId: The unique identifier returned from `initOtp`. + /// - otpCode: The code entered by the user. + /// + /// - Returns: A `VerifyOtpResult` containing the verification token confirming that the OTP was validated. + /// + /// - Throws: + /// - `TurnkeySwiftError.missingAuthProxyConfiguration` if the Auth Proxy client is not configured. + /// - `TurnkeySwiftError.failedToVerifyOtp` if the verification request fails. + public func verifyOtp(otpId: String, otpCode: String) async throws -> VerifyOtpResult { + + guard let client = client else { + throw TurnkeySwiftError.missingAuthProxyConfiguration + } + + do { + let resp = try await client.proxyVerifyOtp(ProxyTVerifyOtpBody( + otpCode: otpCode, + otpId: otpId + )) + + return VerifyOtpResult(credentialBundle: resp.verificationToken) + } catch { + throw TurnkeySwiftError.failedToVerifyOtp(underlying: error) + } + } + + /// Logs in an existing user using a previously verified OTP. + /// + /// Exchanges the verification token for a new session and stores it in the session registry. + /// + /// - Parameters: + /// - verificationToken: The verification token returned from `verifyOtp`. + /// - publicKey: The public key used for the session (optional). + /// - organizationId: The ID of the organization associated with the user. + /// - invalidateExisting: Whether to invalidate any existing sessions. + /// - sessionKey: The key under which to store the new session (optional). + /// - Returns: A `BaseAuthResult` containing the created session. + /// + /// - Throws: + /// - `TurnkeySwiftError.missingAuthProxyConfiguration` if the Auth Proxy client is not configured. + /// - `TurnkeySwiftError.failedToLoginWithOtp` if the login request fails. + @discardableResult + public func loginWithOtp( + verificationToken: String, + publicKey: String?, + organizationId: String, + invalidateExisting: Bool, + sessionKey: String? + ) async throws -> BaseAuthResult { + guard let client = client else { + throw TurnkeySwiftError.missingAuthProxyConfiguration + } + + do { + let resolvedPublicKey = try publicKey ?? createKeyPair() + + let response = try await client.proxyOtpLogin(ProxyTOtpLoginBody( + invalidateExisting: invalidateExisting, + organizationId: organizationId, + publicKey: resolvedPublicKey, + verificationToken: verificationToken + )) + + let session = response.session + + try await storeSession(jwt: session, sessionKey: sessionKey) + + return BaseAuthResult(session: session) + } catch { + throw TurnkeySwiftError.failedToLoginWithOtp(underlying: error) + } + } + + /// Signs up a new user using an OTP-based flow. + /// + /// Creates a new sub-organization and user using the verified OTP, then performs automatic login. + /// + /// - Parameters: + /// - verificationToken: The verification token returned from `verifyOtp`. + /// - contact: The user’s contact (email or phone). + /// - otpType: The OTP type (`.email` or `.sms`). + /// - createSubOrgParams: Optional configuration for sub-organization creation. + /// - invalidateExisting: Whether to invalidate any existing sessions. + /// - sessionKey: Optional key to store the new session. + /// + /// - Returns: A `BaseAuthResult` containing the created session. + /// + /// - Throws: + /// - `TurnkeySwiftError.missingAuthProxyConfiguration` if the Auth Proxy client is not configured. + /// - `TurnkeySwiftError.failedToSignUpWithOtp` if signup fails. + @discardableResult + public func signUpWithOtp( + verificationToken: String, + contact: String, + otpType: OtpType, + createSubOrgParams: CreateSubOrgParams? = nil, + invalidateExisting: Bool = false, + sessionKey: String? = nil + ) async throws -> BaseAuthResult { + guard let client = client else { + throw TurnkeySwiftError.missingAuthProxyConfiguration + } + + do { + // generate the keypair up front + let publicKey = try createKeyPair() + + // merge userEmail / userPhoneNumber into params + var mergedParams = createSubOrgParams ?? CreateSubOrgParams() + mergedParams.verificationToken = verificationToken + if otpType == .email { + mergedParams.userEmail = contact + } else { + mergedParams.userPhoneNumber = contact + } + + // we always include at least one API key + // for the one tap signup + let newApiKey = CreateSubOrgParams.ApiKey( + apiKeyName: "api-key-\(Int(Date().timeIntervalSince1970))", + publicKey: publicKey, + curveType: .api_key_curve_p256, + expirationSeconds: nil + ) + + // Append to existing apiKeys or create new array if nil + mergedParams.apiKeys = (mergedParams.apiKeys ?? []) + [newApiKey] + + // build body and call proxySignup + let signupBody = buildSignUpBody(createSubOrgParams: mergedParams) + let response = try await client.proxySignup(signupBody) + + let organizationId = response.organizationId + + return try await loginWithOtp( + verificationToken: verificationToken, + publicKey: publicKey, + organizationId: organizationId, + invalidateExisting: invalidateExisting, + sessionKey: sessionKey + ) + + } catch { + throw TurnkeySwiftError.failedToSignUpWithOtp(underlying: error) + } + } + + /// Completes a full OTP-based authentication flow (login or signup). + /// + /// Determines whether the user already exists and performs the appropriate action: + /// logs in if an organization exists, otherwise signs up a new user. + /// + /// - Parameters: + /// - otpId: The unique identifier for the OTP request. + /// - otpCode: The OTP code provided by the user. + /// - contact: The contact associated with the OTP (email or phone). + /// - otpType: The OTP type (`.email` or `.sms`). + /// - publicKey: Optional public key to use during authentication. + /// - createSubOrgParams: Optional parameters for sub-organization creation. + /// - invalidateExisting: Whether to invalidate any existing sessions. + /// - sessionKey: Optional key to store the resulting session. + /// + /// - Returns: A `CompleteOtpResult` describing whether a login or signup occurred. + /// + /// - Throws: + /// - `TurnkeySwiftError.missingAuthProxyConfiguration` if the Auth Proxy client is not configured. + /// - `TurnkeySwiftError.failedToCompleteOtp` if the authentication flow fails. + @discardableResult + public func completeOtp( + otpId: String, + otpCode: String, + contact: String, + otpType: OtpType, + publicKey: String? = nil, + createSubOrgParams: CreateSubOrgParams? = nil, + invalidateExisting: Bool = false, + sessionKey: String? = nil + ) async throws -> CompleteOtpResult { + guard let client = client else { + throw TurnkeySwiftError.missingAuthProxyConfiguration + } + + do { + // we verify the otp code + let verifyResult = try await verifyOtp(otpId: otpId, otpCode: otpCode) + let verificationToken = verifyResult.credentialBundle + + // we check if org already exists + let response = try await client.proxyGetAccount(ProxyTGetAccountBody( + filterType: otpType == .email ? "EMAIL" : "PHONE_NUMBER", + filterValue: contact, + verificationToken: verificationToken + )) + + if let organizationId = response.organizationId, + !organizationId.isEmpty { + // there is an existing org so we login + let loginResp = try await loginWithOtp( + verificationToken: verificationToken, + publicKey: publicKey, + organizationId: organizationId, + invalidateExisting: invalidateExisting, + sessionKey: sessionKey + ) + + return CompleteOtpResult( + session: loginResp.session, + verificationToken: verificationToken, + action: .login + ) + } else { + // no org so we signup + let signUpResp = try await signUpWithOtp( + verificationToken: verificationToken, + contact: contact, + otpType: otpType, + createSubOrgParams: createSubOrgParams, + invalidateExisting: invalidateExisting, + sessionKey: sessionKey + ) + + return CompleteOtpResult( + session: signUpResp.session, + verificationToken: verificationToken, + action: .signup + ) + } + } catch { + throw TurnkeySwiftError.failedToCompleteOtp(underlying: error) + } + } + +} diff --git a/Sources/TurnkeySwift/Public/AuthProxy/TurnkeyContext+Passkey.swift b/Sources/TurnkeySwift/Public/AuthProxy/TurnkeyContext+Passkey.swift new file mode 100644 index 00000000..d327a8f8 --- /dev/null +++ b/Sources/TurnkeySwift/Public/AuthProxy/TurnkeyContext+Passkey.swift @@ -0,0 +1,180 @@ +import Foundation +import AuthenticationServices +import TurnkeyTypes +import TurnkeyHttp +import TurnkeyPasskeys +import TurnkeyCrypto + +extension TurnkeyContext { + + /// Logs in an existing user using a registered passkey (WebAuthn). + /// + /// Initiates a passkey assertion through the system passkey UI, + /// then sends the signed assertion to Turnkey to create a new authenticated session. + /// + /// - Parameters: + /// - anchor: The presentation anchor used to display the system passkey UI. + /// - publicKey: Optional public key to bind the session to (auto-generates if not provided). + /// - organizationId: Optional organization ID. If not provided, uses the configured value in `TurnkeyContext`. + /// - expirationSeconds: Optional duration (in seconds) for the session's lifetime. + /// - sessionKey: Optional session storage key for the resulting session. + /// + /// - Returns: A `PasskeyAuthResult` containing the created session and credential ID (currently empty). + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidConfiguration` if `rpId` or `organizationId` is missing. + /// - `TurnkeySwiftError.failedToLoginWithPasskey` if the login or stamping process fails. + @discardableResult + public func loginWithPasskey( + anchor: ASPresentationAnchor, + publicKey: String? = nil, + organizationId: String? = nil, + expirationSeconds: String? = nil, + sessionKey: String? = nil + ) async throws -> PasskeyAuthResult { + guard let rpId = self.rpId, !rpId.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing rpId; set via TurnkeyContext.configure(rpId:)") + } + let resolvedOrganizationId = organizationId ?? self.organizationId + guard let orgId = resolvedOrganizationId, !orgId.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing organizationId; pass as parameter or set via TurnkeyContext.configure(organizationId:)") + } + let client = TurnkeyClient( + rpId: rpId, + presentationAnchor: anchor, + baseUrl: apiUrl + ) + + let resolvedPublicKey = try publicKey ?? createKeyPair() + + do { + let resp = try await client.stampLogin(TStampLoginBody( + organizationId: orgId, + expirationSeconds: resolvedSessionExpirationSeconds(expirationSeconds: expirationSeconds), + publicKey: resolvedPublicKey + )) + + let resolvedRefreshedSessionTTLSeconds = runtimeConfig?.auth.autoRefreshSession == true + ? expirationSeconds + : nil + + let session = resp.session + try await storeSession(jwt: session, refreshedSessionTTLSeconds: resolvedRefreshedSessionTTLSeconds) + + // TODO: can we return the credentialId here? + // from a quick glance this is going to be difficult + // for now we return an empty string + return PasskeyAuthResult(session: session, credentialId: "") + } catch { + throw TurnkeySwiftError.failedToLoginWithPasskey(underlying: error) + } + } + + /// Signs up a new user and sub-organization using a passkey (WebAuthn). + /// + /// Creates a new passkey via the system UI, registers it with Turnkey as an authenticator, + /// and performs a one-tap login using a temporary API key generated during signup. + /// + /// - Parameters: + /// - anchor: The presentation anchor used to display the system passkey UI. + /// - passkeyDisplayName: Optional display name for the passkey (defaults to `"passkey-"`). + /// - challenge: Optional custom challenge string to use during passkey creation. + /// - expirationSeconds: Optional duration (in seconds) for the session's lifetime. + /// - createSubOrgParams: Optional configuration for sub-organization creation (merged with passkey and API key data). + /// - sessionKey: Optional session storage key for the resulting session. + /// - organizationId: Optional organization ID override (not typically required for sign-up). + /// + /// - Returns: A `PasskeyAuthResult` containing the new session and the registered passkey's credential ID. + /// + /// - Throws: + /// - `TurnkeySwiftError.missingAuthProxyConfiguration` if the Auth Proxy client is not initialized. + /// - `TurnkeySwiftError.invalidConfiguration` if `rpId` is missing. + /// - `TurnkeySwiftError.failedToSignUpWithPasskey` if signup or stamping fails. + @discardableResult + public func signUpWithPasskey( + anchor: ASPresentationAnchor, + passkeyDisplayName: String? = nil, + challenge: String? = nil, + expirationSeconds: String? = nil, + createSubOrgParams: CreateSubOrgParams? = nil, + sessionKey: String? = nil + ) async throws -> PasskeyAuthResult { + guard let client = client else { + throw TurnkeySwiftError.missingAuthProxyConfiguration + } + + guard let rpId = self.rpId, !rpId.isEmpty else { + throw TurnkeySwiftError.invalidConfiguration("Missing rpId; set via TurnkeyContext.configure(rpId:)") + } + + do { + + let passkeyName = passkeyDisplayName ?? "passkey-\(Int(Date().timeIntervalSince1970))" + + // for one-tap passkey sign-up, we generate a temporary API key pair + // which is added as an authentication method for the new sub-org user + // this allows us to stamp the session creation request immediately after + // without prompting the user + let (_, publicKeyCompressed: generatedPublicKey, privateKey) = TurnkeyCrypto.generateP256KeyPair() + + let passkey = try await createPasskey( + user: PasskeyUser(id: UUID().uuidString, name: passkeyName, displayName: passkeyName), + rp: RelyingParty(id: rpId, name: ""), + presentationAnchor: anchor + ) + + + // we build the signup body + var mergedParams = createSubOrgParams ?? CreateSubOrgParams() + + // Add the passkey authenticator (append to existing or create new array) + let newAuthenticator = CreateSubOrgParams.Authenticator( + authenticatorName: passkeyName, + challenge: passkey.challenge, + attestation: passkey.attestation + ) + mergedParams.authenticators = (mergedParams.authenticators ?? []) + [newAuthenticator] + + // Add the API key for session authentication (append to existing or create new array) + let newApiKey = CreateSubOrgParams.ApiKey( + apiKeyName: "passkey-auth-\(generatedPublicKey)", + publicKey: generatedPublicKey, + curveType: .api_key_curve_p256, + expirationSeconds: "60" + ) + mergedParams.apiKeys = (mergedParams.apiKeys ?? []) + [newApiKey] + + let signupBody = buildSignUpBody(createSubOrgParams: mergedParams) + let response = try await client.proxySignup(signupBody) + + let organizationId = response.organizationId + + let temporaryClient = TurnkeyClient( + apiPrivateKey: privateKey, + apiPublicKey: generatedPublicKey, + baseUrl: apiUrl + ) + + let newKeyPairResult = try createKeyPair() + + let loginResponse = try await temporaryClient.stampLogin(TStampLoginBody( + organizationId: organizationId, + expirationSeconds: resolvedSessionExpirationSeconds(expirationSeconds: expirationSeconds), + invalidateExisting: true, + publicKey: newKeyPairResult + )) + + let resolvedRefreshedSessionTTLSeconds = runtimeConfig?.auth.autoRefreshSession == true + ? expirationSeconds + : nil + + let session = loginResponse.session + try await storeSession(jwt: session, refreshedSessionTTLSeconds: resolvedRefreshedSessionTTLSeconds) + + return PasskeyAuthResult(session: session, credentialId: passkey.attestation.credentialId) + + } catch { + throw TurnkeySwiftError.failedToSignUpWithPasskey(underlying: error) + } + } +} diff --git a/Sources/TurnkeySwift/Public/TurnkeyContext+OAuth.swift b/Sources/TurnkeySwift/Public/TurnkeyContext+OAuth.swift deleted file mode 100644 index 429c6f34..00000000 --- a/Sources/TurnkeySwift/Public/TurnkeyContext+OAuth.swift +++ /dev/null @@ -1,82 +0,0 @@ -import Foundation -import AuthenticationServices -import TurnkeyHttp - -extension TurnkeyContext: ASWebAuthenticationPresentationContextProviding { - - /// Launches the Google OAuth flow and returns the OIDC token. - /// - /// - Parameters: - /// - clientId: The Google OAuth client ID. - /// - nonce: A unique string (must be `sha256(publicKey)`). - /// - scheme: The URL scheme used to return from the system browser. - /// - anchor: The presentation anchor for the authentication session. - /// - originUri: Optional override for the OAuth origin URL. - /// - redirectUri: Optional override for the OAuth redirect URL. - /// - /// - Returns: A valid Google-issued OIDC token. - /// - /// - Throws: `TurnkeySwiftError.oauthInvalidURL` if URL building fails, - /// `TurnkeySwiftError.oauthMissingIDToken` if token is not returned, - /// or `TurnkeySwiftError.oauthFailed` if the system session fails. - public func startGoogleOAuthFlow( - clientId: String, - nonce: String, - scheme: String, - anchor: ASPresentationAnchor, - originUri: String? = nil, - redirectUri: String? = nil - ) async throws -> String { - - self.oauthAnchor = anchor - - let finalOriginUri = originUri ?? Constants.Turnkey.oauthOriginUrl - let finalRedirectUri = redirectUri - ?? "\(Constants.Turnkey.oauthRedirectUrl)?scheme=\(scheme)" - - var comps = URLComponents(string: finalOriginUri)! - comps.queryItems = [ - URLQueryItem(name: "provider", value: "google"), - URLQueryItem(name: "clientId", value: clientId), - URLQueryItem(name: "redirectUri", value: finalRedirectUri), - URLQueryItem(name: "nonce", value: nonce) - ] - - guard let url = comps.url else { - throw TurnkeySwiftError.oauthInvalidURL - } - - return try await withCheckedThrowingContinuation { continuation in - let session = ASWebAuthenticationSession( - url: url, - callbackURLScheme: scheme - ) { callbackURL, error in - - if let error { - continuation.resume(throwing: TurnkeySwiftError.oauthFailed(underlying: error)) - return - } - - guard - let callbackURL, - let idToken = URLComponents(url: callbackURL, resolvingAgainstBaseURL: false)? - .queryItems? - .first(where: { $0.name == "id_token" })?.value - else { - continuation.resume(throwing: TurnkeySwiftError.oauthMissingIDToken) - return - } - - continuation.resume(returning: idToken) - } - - session.presentationContextProvider = self - session.prefersEphemeralWebBrowserSession = false - session.start() - } - } - - public func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { - oauthAnchor ?? ASPresentationAnchor() - } -} diff --git a/Sources/TurnkeySwift/Public/TurnkeyContext+Session.swift b/Sources/TurnkeySwift/Public/TurnkeyContext+Session.swift index 011513e3..de834e6a 100644 --- a/Sources/TurnkeySwift/Public/TurnkeyContext+Session.swift +++ b/Sources/TurnkeySwift/Public/TurnkeyContext+Session.swift @@ -1,39 +1,49 @@ import Foundation +import TurnkeyTypes import TurnkeyCrypto import TurnkeyHttp +import TurnkeyStamper extension TurnkeyContext { - /// Generates a new ephemeral key pair, stores it securely, and adds it to the pending list. + /// Generates a new ephemeral key pair, stores it securely, and adds it to the pending key registry. /// - /// - Returns: The public key string. - /// - Throws: An error if the key could not be saved. - @discardableResult + /// - Returns: The generated public key as a string. + /// + /// - Throws: + /// - `TurnkeySwiftError.failedToSaveKeyPair` if the key pair could not be persisted. + /// - Any underlying error from the secure storage layer. public func createKeyPair() throws -> String { - let (_, publicKey, privateKey) = TurnkeyCrypto.generateP256KeyPair() - try KeyPairStore.save(privateHex: privateKey, for: publicKey) + let publicKey = try Stamper.createOnDeviceKeyPair() try PendingKeysStore.add(publicKey) return publicKey } - /// Creates a new session from the provided JWT, persists its metadata, and (optionally) schedules auto-refresh. + /// Creates and stores a new session from the provided JWT. + /// + /// Decodes the session payload, persists its metadata, and optionally enables auto-refresh + /// based on runtime configuration or the provided TTL value. /// /// - Parameters: - /// - jwt: The JWT string returned by the Turnkey backend. - /// - sessionKey: An identifier under which to store this session. Defaults to `Constants.Session.defaultSessionKey`. - /// - refreshedSessionTTLSeconds: *Optional.* The duration (in seconds) that refreshed sessions will be valid for. - /// If provided, the SDK will automatically refresh this session near expiry using this value. Must be at least 30 seconds. + /// - jwt: The session token (JWT) returned by the Turnkey backend. + /// - sessionKey: Optional identifier under which to store the session. Defaults to `Constants.Session.defaultSessionKey`. + /// - refreshedSessionTTLSeconds: Optional session lifetime (in seconds) used for auto-refresh scheduling. /// /// - Throws: - /// - `TurnkeySwiftError.invalidRefreshTTL` if `refreshedSessionTTLSeconds` is provided but less than 30 seconds. + /// - `TurnkeySwiftError.invalidRefreshTTL` if `refreshedSessionTTLSeconds` is less than 30 seconds. /// - `TurnkeySwiftError.keyAlreadyExists` if a session with the same `sessionKey` already exists. - /// - `TurnkeySwiftError.failedToCreateSession` if decoding, persistence, or other internal operations fail. - public func createSession( + /// - `TurnkeySwiftError.failedToStoreSession` if decoding or persistence fails. + public func storeSession( jwt: String, - sessionKey: String = Constants.Session.defaultSessionKey, + sessionKey: String? = nil, refreshedSessionTTLSeconds: String? = nil ) async throws { + let resolvedSessionKey = sessionKey?.isEmpty == false + ? sessionKey! + : Constants.Session.defaultSessionKey + do { + // eventually we should verify that the jwt was signed by Turnkey // but for now we just assume it is @@ -45,61 +55,118 @@ extension TurnkeyContext { // we check if there is already an active session under that sessionKey // if so we throw an error - if let _ = try JwtSessionStore.load(key: sessionKey) { + if let _ = try JwtSessionStore.load(key: resolvedSessionKey) { throw TurnkeySwiftError.keyAlreadyExists } + + let stored = try JWTDecoder.decode(jwt, as: TurnkeySession.self) + + // determine if auto-refresh should be enabled and how to set the TTL + // - auto-refresh is enabled if either: + // (a) `refreshedSessionTTLSeconds` is explicitly provided, OR + // (b) `runtimeConfig.auth.autoRefreshSession` is true + // - if `refreshedSessionTTLSeconds` was passed in, we use it directly + // - if it wasn’t passed in but auto-refresh is enabled via config, + // then we calculate the TTL dynamically based on the current time and the + // JWT’s expiration (`exp - now`) + // + // Note: this calculated TTL will be slightly shorter than the actual session + // lifetime due to timing differences, but that’s acceptable because it’s + // stored inside `AutoRefreshStore` and reused for future refreshes, so this + // loss only occurs once + var ttlToStore: String? = refreshedSessionTTLSeconds + if ttlToStore == nil { + if runtimeConfig?.auth.autoRefreshSession == true { + let exp = stored.exp + let now = Date().timeIntervalSince1970 + let ttl = max(0, exp - now) + ttlToStore = String(Int(ttl)) + } + } - let dto = try JWTDecoder.decode(jwt, as: TurnkeySession.self) try persistSession( - dto: dto, - sessionKey: sessionKey, - refreshedSessionTTLSeconds: refreshedSessionTTLSeconds + stored: stored, + jwt: jwt, + sessionKey: resolvedSessionKey, + refreshedSessionTTLSeconds: ttlToStore ) if selectedSessionKey == nil { - _ = try await setSelectedSession(sessionKey: sessionKey) + try? SelectedSessionStore.save(resolvedSessionKey) + + let cli = try makeClientWithStamper(apiPublicKey: stored.publicKey) + + // Create and set session state + let session = Session( + exp: stored.exp, + publicKey: stored.publicKey, + sessionType: stored.sessionType, + userId: stored.userId, + organizationId: stored.organizationId, + token: jwt + ) + + await MainActor.run { + self.selectedSessionKey = resolvedSessionKey + self.client = cli + self.session = session + self.authState = .authenticated + } + + // we set user and wallet state + try? await refreshUser() + try? await refreshWallets() } - await MainActor.run { self.authState = .authenticated } } catch { - throw TurnkeySwiftError.failedToCreateSession(underlying: error) + throw TurnkeySwiftError.failedToStoreSession(underlying: error) } } - /// Sets the currently active session to the specified session key. + /// Activates the specified session and updates the current context. + /// + /// Loads the stored session and key material, configures a new `TurnkeyClient`, + /// and updates the runtime state to reflect the selected session. + /// + /// - Parameter sessionKey: The key of the session to activate. + /// + /// - Returns: A configured `TurnkeyClient` bound to the active session. /// - /// - Parameter sessionKey: The key identifying the session to activate. - /// - Returns: A configured `TurnkeyClient` for the session. - /// - Throws: `TurnkeySwiftError` if loading session details fails. - @discardableResult - public func setSelectedSession(sessionKey: String) async throws -> TurnkeyClient { + /// - Throws: + /// - `TurnkeySwiftError.keyNotFound` if the session key does not exist. + /// - `TurnkeySwiftError.failedToSetSelectedSession` if the operation fails. + public func setActiveSession(sessionKey: String) async throws -> TurnkeyClient { do { - guard let dto = try JwtSessionStore.load(key: sessionKey) else { + guard let storedJwtSession = try JwtSessionStore.load(key: sessionKey) else { throw TurnkeySwiftError.keyNotFound } - let privHex = try KeyPairStore.getPrivateHex(for: dto.publicKey) - - let cli = TurnkeyClient( - apiPrivateKey: privHex, - apiPublicKey: dto.publicKey, - baseUrl: apiUrl - ) + let stored = storedJwtSession.decoded + let jwt = storedJwtSession.jwt + + let client = try makeClientWithStamper(apiPublicKey: stored.publicKey) - let fetched = try await fetchSessionUser( - using: cli, - organizationId: dto.organizationId, - userId: dto.userId + let session = Session( + exp: stored.exp, + publicKey: stored.publicKey, + sessionType: stored.sessionType, + userId: stored.userId, + organizationId: stored.organizationId, + token: jwt ) await MainActor.run { try? SelectedSessionStore.save(sessionKey) self.selectedSessionKey = sessionKey - self.client = cli - self.user = fetched + self.client = client + self.session = session } - return cli + // we update user and wallet state + try? await refreshUser() + try? await refreshWallets() + + return client } catch { throw TurnkeySwiftError.failedToSetSelectedSession(underlying: error) } @@ -119,24 +186,29 @@ extension TurnkeyContext { if selectedSessionKey == sessionKey { authState = .unAuthenticated selectedSessionKey = nil - client = nil + client = self.makeAuthProxyClientIfNeeded() + session = nil user = nil + wallets = [] SelectedSessionStore.delete() } } } - /// Refreshes a session by generating a new key pair, stamping a login request, and updating stored metadata. + /// Refreshes an existing session by generating a new key pair and obtaining a new JWT. + /// + /// Issues a fresh session via `stampLogin`, replaces local key material, and updates stored metadata. /// /// - Parameters: - /// - expirationSeconds: The requested lifetime for the new session in seconds. Defaults to `Constants.Session.defaultExpirationSeconds`. - /// - sessionKey: The key of the session to refresh. If `nil`, the currently selected session is used. + /// - expirationSeconds: The desired session lifetime in seconds. Defaults to `Constants.Session.defaultExpirationSeconds`. + /// - sessionKey: The key of the session to refresh. Defaults to the currently selected session. /// - invalidateExisting: Whether to invalidate the previous session on the server. Defaults to `false`. + /// /// - Throws: - /// - `TurnkeySwiftError.keyNotFound` if no session exists under the given `sessionKey`. - /// - `TurnkeySwiftError.invalidSession` if the selected session is not initialized. - /// - `TurnkeySwiftError.failedToRefreshSession` if stamping or persistence fails.. + /// - `TurnkeySwiftError.keyNotFound` if the session key cannot be found. + /// - `TurnkeySwiftError.invalidSession` if no valid session is active. + /// - `TurnkeySwiftError.failedToRefreshSession` if stamping or persistence fails. public func refreshSession( expirationSeconds: String = Constants.Session.defaultExpirationSeconds, sessionKey: String? = nil, @@ -155,58 +227,70 @@ extension TurnkeyContext { if targetSessionKey == selectedSessionKey { // refreshing the selected session - guard let currentClient = self.client, - let currentUser = self.user - else { + guard authState == .authenticated, + let currentSession = self.session, + let client = self.client else { throw TurnkeySwiftError.invalidSession } - clientToUse = currentClient - orgId = currentUser.organizationId + + clientToUse = client + orgId = currentSession.organizationId } else { // refreshing a background session - guard let dto = try JwtSessionStore.load(key: targetSessionKey) else { + guard let storedJwtSession = try JwtSessionStore.load(key: targetSessionKey) else { throw TurnkeySwiftError.keyNotFound } - let privHex = try KeyPairStore.getPrivateHex(for: dto.publicKey) - clientToUse = TurnkeyClient( - apiPrivateKey: privHex, - apiPublicKey: dto.publicKey, + let stored = storedJwtSession.decoded + + clientToUse = try TurnkeyClient( + apiPublicKey: stored.publicKey, baseUrl: apiUrl ) - orgId = dto.organizationId + orgId = stored.organizationId } let newPublicKey = try createKeyPair() do { - let resp = try await clientToUse.stampLogin( + let resp = try await clientToUse.stampLogin(TStampLoginBody( organizationId: orgId, - publicKey: newPublicKey, expirationSeconds: expirationSeconds, - invalidateExisting: invalidateExisting - ) - guard - case let .json(body) = resp.body, - let jwt = body.activity.result.stampLoginResult?.session - else { - throw TurnkeySwiftError.invalidResponse - } + invalidateExisting: invalidateExisting, + publicKey: newPublicKey + )) + let jwt = resp.session - try await updateSession(jwt: jwt, sessionKey: targetSessionKey) + // we purge old key material but preserve the auto-refresh metadata stored + try purgeStoredSession(for: targetSessionKey, keepAutoRefresh: true) - // if this was the selected session, swap in the new client + let stored = try JWTDecoder.decode(jwt, as: TurnkeySession.self) + let nextDuration = AutoRefreshStore.durationSeconds(for: targetSessionKey) + try persistSession( + stored: stored, + jwt: jwt, + sessionKey: targetSessionKey, + refreshedSessionTTLSeconds: nextDuration + ) + + // if this was the selected session we update client and session state if targetSessionKey == selectedSessionKey { - let updatedDto = try JwtSessionStore.load(key: targetSessionKey)! - let privHex = try KeyPairStore.getPrivateHex(for: updatedDto.publicKey) - let newClient = TurnkeyClient( - apiPrivateKey: privHex, - apiPublicKey: updatedDto.publicKey, - baseUrl: apiUrl + + let newClient = try makeClientWithStamper(apiPublicKey: stored.publicKey) + + let newSession = Session( + exp: stored.exp, + publicKey: stored.publicKey, + sessionType: stored.sessionType, + userId: stored.userId, + organizationId: stored.organizationId, + token: jwt ) + await MainActor.run { self.client = newClient + self.session = newSession } } diff --git a/Sources/TurnkeySwift/Public/TurnkeyContext+Signing.swift b/Sources/TurnkeySwift/Public/TurnkeyContext+Signing.swift index 24b902ee..4db187a6 100644 --- a/Sources/TurnkeySwift/Public/TurnkeyContext+Signing.swift +++ b/Sources/TurnkeySwift/Public/TurnkeyContext+Signing.swift @@ -1,56 +1,159 @@ import Foundation +import TurnkeyTypes +import TurnkeyHttp extension TurnkeyContext { - - /// Signs a raw payload using the currently selected session's credentials. - /// - /// - Parameters: - /// - signWith: The key ID or alias to sign with. - /// - payload: The raw data to be signed. - /// - encoding: The encoding of the payload (e.g., `utf8`, `hex`, `base64url`). - /// - hashFunction: The hash function to apply prior to signing. - /// - /// - Returns: A `SignRawPayloadResult` containing the signature and metadata. - /// - /// - Throws: `TurnkeySwiftError.invalidSession` if no session is selected, - /// `TurnkeySwiftError.invalidResponse` if the server response is malformed, - /// or `TurnkeySwiftError.failedToSignPayload` if the signing operation fails. - public func signRawPayload( - signWith: String, - payload: String, - encoding: PayloadEncoding, - hashFunction: HashFunction - ) async throws -> SignRawPayloadResult { - - guard let client else { - throw TurnkeySwiftError.invalidSession + + /// Signs a raw payload using the currently selected session’s credentials. + /// + /// Uses the active session to sign arbitrary data with the specified key and encoding parameters. + /// + /// - Parameters: + /// - signWith: The key ID or alias to sign with. + /// - payload: The raw data to be signed. + /// - encoding: The encoding of the payload (e.g., `utf8`, `hex`, `base64url`). + /// - hashFunction: The hash function to apply before signing. + /// + /// - Returns: A `SignRawPayloadResult` containing the signature components and metadata. + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidSession` if no active session is found. + /// - `TurnkeySwiftError.invalidResponse` if the server response is malformed. + /// - `TurnkeySwiftError.failedToSignPayload` if the signing operation fails. + public func signRawPayload( + signWith: String, + payload: String, + encoding: PayloadEncoding, + hashFunction: HashFunction + ) async throws -> SignRawPayloadResult { + + guard + authState == .authenticated, + let client = client, + let sessionKey = selectedSessionKey, + let stored = try JwtSessionStore.load(key: sessionKey) + else { + throw TurnkeySwiftError.invalidSession + } + + + do { + let resp = try await client.signRawPayload(TSignRawPayloadBody( + organizationId: stored.decoded.organizationId, + encoding: encoding, + hashFunction: hashFunction, + payload: payload, + signWith: signWith + )) + + return SignRawPayloadResult(r: resp.r, s: resp.s, v: resp.v) + + } catch { + throw TurnkeySwiftError.failedToSignPayload(underlying: error) + } } - - guard let sessionKey = selectedSessionKey else { - throw TurnkeySwiftError.invalidSession - } - - guard let dto = try JwtSessionStore.load(key: sessionKey) else { - throw TurnkeySwiftError.invalidSession + + /// Signs a plaintext message using the currently selected session’s credentials. + /// + /// Determines the encoding and hash function based on the provided wallet account and applies + /// optional Ethereum message prefixing before signing. + /// + /// - Parameters: + /// - signWith: The wallet account to use for signing. + /// - message: The plaintext message to sign. + /// - encoding: Optional override for payload encoding. + /// - hashFunction: Optional override for hash function. + /// - addEthereumPrefix: Optional flag to prefix Ethereum messages (defaults to true for Ethereum accounts). + /// + /// - Returns: A `SignRawPayloadResult` containing the signature components. + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidSession` if no active session is found. + /// - `TurnkeySwiftError.invalidResponse` if the server response is malformed. + /// - `TurnkeySwiftError.failedToSignPayload` if the signing operation fails. + public func signMessage( + signWith account: WalletAccount, + message: String, + encoding: PayloadEncoding? = nil, + hashFunction: HashFunction? = nil, + addEthereumPrefix: Bool? = nil + ) async throws -> SignRawPayloadResult { + return try await signMessage( + signWith: account.address, + addressFormat: account.addressFormat, + message: message, + encoding: encoding, + hashFunction: hashFunction, + addEthereumPrefix: addEthereumPrefix + ) } - - do { - let resp = try await client.signRawPayload( - organizationId: dto.organizationId, - signWith: signWith, - payload: payload, - encoding: encoding, - hashFunction: hashFunction - ) - - guard let result = try resp.body.json.activity.result.signRawPayloadResult else { - throw TurnkeySwiftError.invalidResponse - } - - return result - - } catch { - throw TurnkeySwiftError.failedToSignPayload(underlying: error) + + /// Signs a plaintext message using the currently selected session’s credentials. + /// + /// Resolves encoding and hashing defaults from the address format, applies Ethereum + /// prefixing when required, and performs signing using the selected session key. + /// + /// - Parameters: + /// - signWith: The address or key identifier to sign with. + /// - addressFormat: The address format associated with the signing key. + /// - message: The plaintext message to sign. + /// - encoding: Optional override for payload encoding. + /// - hashFunction: Optional override for hash function. + /// - addEthereumPrefix: Optional flag to prefix Ethereum messages (defaults to true for Ethereum accounts). + /// + /// - Returns: A `SignRawPayloadResult` containing the signature components. + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidSession` if no active session is found. + /// - `TurnkeySwiftError.invalidResponse` if the server response is malformed. + /// - `TurnkeySwiftError.failedToSignPayload` if the signing operation fails. + public func signMessage( + signWith: String, + addressFormat: AddressFormat, + message: String, + encoding: PayloadEncoding? = nil, + hashFunction: HashFunction? = nil, + addEthereumPrefix: Bool? = nil + ) async throws -> SignRawPayloadResult { + guard + authState == .authenticated, + let client = client, + let sessionKey = selectedSessionKey, + let stored = try JwtSessionStore.load(key: sessionKey) + else { + throw TurnkeySwiftError.invalidSession + } + + // Determine defaults from address format + let defaults = AddressFormatDefaults.defaults(for: addressFormat) + let finalEncoding = encoding ?? defaults.encoding + let finalHash = hashFunction ?? defaults.hashFunction + + // Start with UTF-8 message bytes + var messageBytes = Data(message.utf8) + + // Apply Ethereum prefix if applicable + if addressFormat == .address_format_ethereum { + let shouldPrefix = addEthereumPrefix ?? true + if shouldPrefix { + messageBytes = MessageEncodingHelper.ethereumPrefixed(messageData: messageBytes) + } + } + + let payload = MessageEncodingHelper.encodeMessageBytes(messageBytes, as: finalEncoding) + + do { + let resp = try await client.signRawPayload(TSignRawPayloadBody( + organizationId: stored.decoded.organizationId, + encoding: finalEncoding, + hashFunction: finalHash, + payload: payload, + signWith: signWith + )) + + return SignRawPayloadResult(r: resp.r, s: resp.s, v: resp.v) + } catch { + throw TurnkeySwiftError.failedToSignPayload(underlying: error) + } } - } } diff --git a/Sources/TurnkeySwift/Public/TurnkeyContext+User.swift b/Sources/TurnkeySwift/Public/TurnkeyContext+User.swift index 90ff4757..b1917296 100644 --- a/Sources/TurnkeySwift/Public/TurnkeyContext+User.swift +++ b/Sources/TurnkeySwift/Public/TurnkeyContext+User.swift @@ -1,129 +1,125 @@ import Foundation +import TurnkeyTypes import TurnkeyHttp extension TurnkeyContext { - /// Refreshes the current user and associated wallet data. + /// Fetches user data for the currently active session. /// - /// This method uses the currently selected session to refetch user data - /// from the Turnkey API and updates the internal state. + /// Retrieves user metadata from the Turnkey API using the current session’s credentials. /// - /// If no valid session is found, the method silently returns. - public func refreshUser() async { + /// - Returns: A `v1User` object containing user information and metadata. + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidSession` if no active session is found. + /// - `TurnkeySwiftError.failedToFetchUser` if the request or decoding fails. + public func fetchUser() async throws -> v1User { guard - let client, - let sessionKey = selectedSessionKey, - let dto = try? JwtSessionStore.load(key: sessionKey) + authState == .authenticated, + let client = client, + let session = session else { - return + throw TurnkeySwiftError.invalidSession } - if let updated = try? await fetchSessionUser( - using: client, - organizationId: dto.organizationId, - userId: dto.userId - ) { - await MainActor.run { - self.user = updated - } + do { + let userResp = try await client.getUser(TGetUserBody( + organizationId: session.organizationId, + userId: session.userId + )) + return userResp.user + } catch { + throw TurnkeySwiftError.failedToFetchUser(underlying: error) } } - /// Updates the contact information for the user associated with the currently selected session. + /// Refreshes and updates the current user data. /// - /// - Parameters: - /// - email: Optional email address to update. - /// - phone: Optional phone number to update. + /// Refetches user metadata from the Turnkey API using the active session + /// and updates the local user state on the main thread. /// - /// - Throws: `TurnkeySwiftError.invalidSession` if no session is selected, - /// or `TurnkeySwiftError.failedToUpdateUser` if the update fails. - public func updateUser(email: String? = nil, phone: String? = nil) async throws { - guard let client, let user else { - throw TurnkeySwiftError.invalidSession - } - - let trimmedEmail = email?.trimmingCharacters(in: .whitespacesAndNewlines).nonEmpty - let trimmedPhone = phone?.trimmingCharacters(in: .whitespacesAndNewlines).nonEmpty - - do { - let resp = try await client.updateUser( - organizationId: user.organizationId, - userId: user.id, - userName: nil, - userEmail: trimmedEmail, - userTagIds: [], - userPhoneNumber: trimmedPhone - ) - - if try resp.body.json.activity.result.updateUserResult?.userId != nil { - await refreshUser() - } - - } catch { - throw TurnkeySwiftError.failedToUpdateUser(underlying: error) + /// - Throws: + /// - `TurnkeySwiftError.failedToFetchUser` if the request or decoding fails. + public func refreshUser() async throws { + // TODO: we currently throw a failedToFetchUser error which breaks our convention + // this should be failedToRefreshUser + let user = try await fetchUser() + await MainActor.run { + self.user = user } } - /// Updates the email address for the user associated with the currently selected session. + /// Updates the user’s email address for the currently active session. /// - /// If a verification token is provided, the email will be marked as verified. Otherwise, it will be considered unverified. - /// Passing an empty string ("") will delete the user's email address. + /// If a verification token is provided, the email will be marked as verified. + /// Passing an empty string (`""`) will remove the existing email address. /// /// - Parameters: - /// - email: The new email address to update, or an empty string to delete it. + /// - email: The new email address to set, or `""` to delete it. /// - verificationToken: Optional verification token to mark the email as verified. /// - /// - Throws: `TurnkeySwiftError.invalidSession` if no session is selected, - /// or `TurnkeySwiftError.failedToUpdateUserEmail` if the update fails. + /// - Throws: + /// - `TurnkeySwiftError.invalidSession` if no active session is found. + /// - `TurnkeySwiftError.failedToUpdateUserEmail` if the update operation fails. public func updateUserEmail(email: String, verificationToken: String? = nil ) async throws { - guard let client, let user else { + guard + authState == .authenticated, + let client = client, + let user = user, + let session = session + else { throw TurnkeySwiftError.invalidSession } - + + do { - let resp = try await client.updateUserEmail( - organizationId: user.organizationId, - userId: user.id, + _ = try await client.updateUserEmail(TUpdateUserEmailBody( + organizationId: session.organizationId, userEmail: email, + userId: user.userId, verificationToken: verificationToken - ) + )) - if try resp.body.json.activity.result.updateUserEmailResult?.userId != nil { - await refreshUser() - } + try await refreshUser() } catch { throw TurnkeySwiftError.failedToUpdateUserEmail(underlying: error) } } - /// Updates the phone number for the user associated with the currently selected session. + /// Updates the user’s phone number for the currently active session. /// - /// If a verification token is provided, the phone number will be marked as verified. Otherwise, it will be considered unverified. - /// Passing an empty string ("") will delete the user's phone number. + /// If a verification token is provided, the phone number will be marked as verified. + /// Passing an empty string (`""`) will remove the existing phone number. /// /// - Parameters: - /// - phone: The new phone number to update, or an empty string to delete it. + /// - phone: The new phone number to set, or `""` to delete it. /// - verificationToken: Optional verification token to mark the phone number as verified. /// - /// - Throws: `TurnkeySwiftError.invalidSession` if no session is selected, - /// or `TurnkeySwiftError.failedToUpdateUserPhoneNumber` if the update fails. + /// - Throws: + /// - `TurnkeySwiftError.invalidSession` if no active session is found. + /// - `TurnkeySwiftError.failedToUpdateUserPhoneNumber` if the update operation fails. public func updateUserPhoneNumber(phone: String, verificationToken: String? = nil ) async throws { - guard let client, let user else { + guard + authState == .authenticated, + let client = client, + let user = user, + let session = session + else { throw TurnkeySwiftError.invalidSession } - + + + do { - let resp = try await client.updateUserPhoneNumber( - organizationId: user.organizationId, - userId: user.id, + _ = try await client.updateUserPhoneNumber(TUpdateUserPhoneNumberBody( + organizationId: session.organizationId, + userId: user.userId, userPhoneNumber: phone, verificationToken: verificationToken - ) + )) - if try resp.body.json.activity.result.updateUserPhoneNumberResult?.userId != nil { - await refreshUser() - } + try await refreshUser() } catch { throw TurnkeySwiftError.failedToUpdateUserPhoneNumber(underlying: error) diff --git a/Sources/TurnkeySwift/Public/TurnkeyContext+Wallet.swift b/Sources/TurnkeySwift/Public/TurnkeyContext+Wallet.swift index 7b5ce3f3..926f2db0 100644 --- a/Sources/TurnkeySwift/Public/TurnkeyContext+Wallet.swift +++ b/Sources/TurnkeySwift/Public/TurnkeyContext+Wallet.swift @@ -1,140 +1,237 @@ import Foundation +import TurnkeyTypes import TurnkeyCrypto extension TurnkeyContext { - - /// Creates a new wallet with the given name and accounts. - /// - /// - Parameters: - /// - walletName: Name to assign to the new wallet. - /// - accounts: List of wallet accounts to generate. - /// - mnemonicLength: Optional mnemonic length (e.g. 12, 24). - /// - /// - Throws: `TurnkeySwiftError.invalidSession` if no session is selected, - /// or `TurnkeySwiftError.failedToCreateWallet` on failure. - public func createWallet( - walletName: String, - accounts: [WalletAccountParams], - mnemonicLength: Int32? = nil - ) async throws { - guard let client, let user else { - throw TurnkeySwiftError.invalidSession - } - - do { - let resp = try await client.createWallet( - organizationId: user.organizationId, - walletName: walletName, - accounts: accounts, - mnemonicLength: mnemonicLength - ) - - if try resp.body.json.activity.result.createWalletResult?.walletId != nil { - await refreshUser() - } - } catch { - throw TurnkeySwiftError.failedToCreateWallet(underlying: error) + + /// Fetches all wallets and their associated accounts for the active session. + /// + /// Retrieves wallet metadata and concurrently fetches account details for each wallet. + /// + /// - Returns: An array of `Wallet` objects including their accounts. + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidSession` if no active session is found. + /// - `TurnkeySwiftError.failedToFetchWallets` if fetching wallets or accounts fails. + public func fetchWallets() async throws -> [Wallet] { + guard + authState == .authenticated, + let client = client, + let session = session + else { + throw TurnkeySwiftError.invalidSession + } + + do { + let resp = try await client.getWallets(TGetWalletsBody(organizationId: session.organizationId)) + + // fetch wallet accounts concurrently + let detailed = try await withThrowingTaskGroup(of: Wallet.self) { group in + for w in resp.wallets { + group.addTask { + let accounts = try await client.getWalletAccounts(TGetWalletAccountsBody( + organizationId: session.organizationId, + walletId: w.walletId + )).accounts + + return Wallet( + walletId: w.walletId, + walletName: w.walletName, + createdAt: w.createdAt.seconds, + updatedAt: w.updatedAt.seconds, + exported: w.exported, + imported: w.imported, + accounts: accounts + ) + } + } + + var res: [Wallet] = [] + for try await item in group { res.append(item) } + return res + } + + return detailed + + } catch { + throw TurnkeySwiftError.failedToFetchWallets(underlying: error) + } + + } - } - - /// Exports the mnemonic phrase for the specified wallet. - /// - /// - Parameter walletId: The wallet identifier to export. - /// - /// - Returns: The decrypted mnemonic phrase. - /// - /// - Throws: `TurnkeySwiftError.invalidSession` if no session is selected, - /// `TurnkeySwiftError.invalidResponse` if response is malformed, - /// or `TurnkeySwiftError.failedToExportWallet` if export fails. - public func exportWallet(walletId: String) async throws -> String { - let (targetPublicKey, _, embeddedPriv) = TurnkeyCrypto.generateP256KeyPair() - guard let client, let user else { - throw TurnkeySwiftError.invalidSession + + /// Refreshes the wallet list for the active session. + /// + /// Refetches all wallets and their accounts from the Turnkey API + /// and updates the local wallet state on the main thread. + /// + /// - Throws: + /// - `TurnkeySwiftError.failedToFetchWallets` if the refresh operation fails. + public func refreshWallets() async throws { + // TODO: we currently throw a failedToFetchWallets error which breaks our convention + // this should be failedToRefreshWallets + let wallets = try await fetchWallets() + await MainActor.run { + self.wallets = wallets + } } - - do { - let resp = try await client.exportWallet( - organizationId: user.organizationId, - walletId: walletId, - targetPublicKey: targetPublicKey, - language: nil - ) - - guard let bundle = try resp.body.json.activity.result.exportWalletResult?.exportBundle - else { - throw TurnkeySwiftError.invalidResponse - } - - return try TurnkeyCrypto.decryptExportBundle( - exportBundle: bundle, - organizationId: user.organizationId, - embeddedPrivateKey: embeddedPriv, - returnMnemonic: true - ) - } catch { - throw TurnkeySwiftError.failedToExportWallet(underlying: error) + + /// Creates a new wallet under the active organization. + /// + /// Generates a wallet with the specified name, account parameters, and optional mnemonic length. + /// + /// - Parameters: + /// - walletName: The name to assign to the new wallet. + /// - accounts: The list of account parameters to generate under this wallet. + /// - mnemonicLength: Optional mnemonic phrase length (e.g. `12` or `24`). + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidSession` if no active session is found. + /// - `TurnkeySwiftError.failedToCreateWallet` if wallet creation fails. + public func createWallet( + walletName: String, + accounts: [WalletAccountParams], + mnemonicLength: Int32? = nil + ) async throws { + + guard + authState == .authenticated, + let client = client, + let session = session + else { + throw TurnkeySwiftError.invalidSession + } + + + + do { + _ = try await client.createWallet(TCreateWalletBody( + organizationId: session.organizationId, + accounts: accounts, + mnemonicLength: mnemonicLength.map(Int.init), + walletName: walletName + )) + + try await refreshWallets() + } catch { + throw TurnkeySwiftError.failedToCreateWallet(underlying: error) + } } - } - - /// Imports an existing wallet using the provided mnemonic and account list. - /// - /// - Parameters: - /// - walletName: Name to assign to the imported wallet. - /// - mnemonic: The recovery phrase to import. - /// - accounts: List of wallet accounts to generate. - /// - /// - Returns: The resulting `Activity` object from the import. - /// - /// - Throws: `TurnkeySwiftError.invalidSession` if no session is selected, - /// `TurnkeySwiftError.invalidResponse` if response is malformed, - /// or `TurnkeySwiftError.failedToImportWallet` if import fails. - @discardableResult - public func importWallet( - walletName: String, - mnemonic: String, - accounts: [WalletAccountParams] - ) async throws -> Activity { - guard let client, let user else { - throw TurnkeySwiftError.invalidSession + + /// Imports an existing wallet using a mnemonic phrase. + /// + /// Initializes an import bundle, encrypts the mnemonic, and sends it to the Turnkey API. + /// The imported wallet is automatically added to the current session’s organization. + /// + /// - Parameters: + /// - walletName: The name to assign to the imported wallet. + /// - mnemonic: The recovery phrase to import. + /// - accounts: The list of wallet accounts to generate. + /// + /// - Returns: The ID of the imported wallet. + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidSession` if no active session is found. + /// - `TurnkeySwiftError.invalidResponse` if the API response is malformed. + /// - `TurnkeySwiftError.failedToImportWallet` if the import operation fails. + @discardableResult + public func importWallet( + walletName: String, + mnemonic: String, + accounts: [WalletAccountParams] + ) async throws -> String { + + guard + authState == .authenticated, + let client = client, + let session = session, + let user = user + else { + throw TurnkeySwiftError.invalidSession + } + + + + do { + let initResp = try await client.initImportWallet(TInitImportWalletBody( + organizationId: session.organizationId, + userId: user.userId + )) + + let importBundle = initResp.importBundle + + let encrypted = try TurnkeyCrypto.encryptWalletToBundle( + mnemonic: mnemonic, + importBundle: importBundle, + userId: user.userId, + organizationId: session.organizationId + ) + + let resp = try await client.importWallet(TImportWalletBody( + organizationId: session.organizationId, + accounts: accounts, + encryptedBundle: encrypted, + userId: user.userId, + walletName: walletName + )) + + try await refreshWallets() + + return resp.walletId + } catch { + throw TurnkeySwiftError.failedToImportWallet(underlying: error) + } } - - do { - let initResp = try await client.initImportWallet( - organizationId: user.organizationId, - userId: user.id - ) - - guard - let importBundle = try initResp.body.json - .activity.result.initImportWalletResult?.importBundle - else { - throw TurnkeySwiftError.invalidResponse - } - - let encrypted = try TurnkeyCrypto.encryptWalletToBundle( - mnemonic: mnemonic, - importBundle: importBundle, - userId: user.id, - organizationId: user.organizationId - ) - - let resp = try await client.importWallet( - organizationId: user.organizationId, - userId: user.id, - walletName: walletName, - encryptedBundle: encrypted, - accounts: accounts - ) - - let activity = try resp.body.json.activity - - if activity.result.importWalletResult?.walletId != nil { - await refreshUser() - } - - return activity - } catch { - throw TurnkeySwiftError.failedToImportWallet(underlying: error) + + + /// Exports a wallet’s mnemonic phrase. + /// + /// Generates an ephemeral key pair, requests an export bundle, and decrypts it locally. + /// + /// - Parameters: + /// - walletId: The wallet identifier to export. + /// - dangerouslyOverrideSignerPublicKey: Optional public key override for advanced use. + /// - returnMnemonic: Whether to return the mnemonic phrase (defaults to `true`). + /// + /// - Returns: The decrypted mnemonic phrase or export data. + /// + /// - Throws: + /// - `TurnkeySwiftError.invalidSession` if no active session is found. + /// - `TurnkeySwiftError.invalidResponse` if the API response is malformed. + /// - `TurnkeySwiftError.failedToExportWallet` if decryption or export fails. + public func exportWallet(walletId: String, dangerouslyOverrideSignerPublicKey: String? = nil, returnMnemonic: Bool = true) async throws -> String { + let (targetPublicKey, _, embeddedPriv) = TurnkeyCrypto.generateP256KeyPair() + + guard + authState == .authenticated, + let client = client, + let session = session + else { + throw TurnkeySwiftError.invalidSession + } + + + + do { + let resp = try await client.exportWallet(TExportWalletBody( + organizationId: session.organizationId, + targetPublicKey: targetPublicKey, + walletId: walletId + )) + + let bundle = resp.exportBundle + + let decrypted = try TurnkeyCrypto.decryptExportBundle( + exportBundle: bundle, + organizationId: session.organizationId, + embeddedPrivateKey: embeddedPriv, + dangerouslyOverrideSignerPublicKey: dangerouslyOverrideSignerPublicKey, + returnMnemonic: returnMnemonic + ) + + return decrypted + } catch { + throw TurnkeySwiftError.failedToExportWallet(underlying: error) + } } - } } diff --git a/Sources/TurnkeySwift/Public/TurnkeyContext.swift b/Sources/TurnkeySwift/Public/TurnkeyContext.swift index 628fd8ca..2ab61052 100644 --- a/Sources/TurnkeySwift/Public/TurnkeyContext.swift +++ b/Sources/TurnkeySwift/Public/TurnkeyContext.swift @@ -2,40 +2,66 @@ import Combine import CryptoKit import Foundation import AuthenticationServices +import TurnkeyTypes import TurnkeyHttp public final class TurnkeyContext: NSObject, ObservableObject { // public state @Published public internal(set) var authState: AuthState = .loading + + /// this is `nil` if no `authProxyConfigId` is provided in the configuration + /// and there are no active sessions @Published public internal(set) var client: TurnkeyClient? + @Published public internal(set) var selectedSessionKey: String? - @Published public internal(set) var user: SessionUser? + @Published public internal(set) var session: Session? + @Published public internal(set) var user: v1User? + @Published public internal(set) var wallets: [Wallet] = [] + @Published internal var runtimeConfig: TurnkeyRuntimeConfig? // internal state internal var expiryTasks: [String: DispatchSourceTimer] = [:] + internal let userConfig: TurnkeyConfig internal let apiUrl: String - - // configurable base URL - private static var _apiUrl: String = Constants.Turnkey.defaultApiUrl - + internal let authProxyUrl: String + internal let authProxyConfigId: String? + internal let rpId: String? + internal let organizationId: String? internal weak var oauthAnchor: ASPresentationAnchor? - public static func configure(apiUrl: String) { - _apiUrl = apiUrl + // Single user config captured at configure-time + private static var _config: TurnkeyConfig = TurnkeyConfig() + + public static func configure(_ config: TurnkeyConfig) { + _config = config } + - public static let shared: TurnkeyContext = TurnkeyContext(apiUrl: _apiUrl) + public static let shared = TurnkeyContext(config: _config) private override init() { - self.apiUrl = Constants.Turnkey.defaultApiUrl + let cfg = TurnkeyConfig() + self.apiUrl = cfg.apiUrl + self.authProxyUrl = cfg.authProxyUrl + self.authProxyConfigId = cfg.authProxyConfigId + self.rpId = cfg.rpId + self.organizationId = cfg.organizationId + self.userConfig = cfg + self.client = nil super.init() self.postInitSetup() } - private init(apiUrl: String) { - self.apiUrl = apiUrl + private init(config: TurnkeyConfig) { + self.apiUrl = config.apiUrl + self.authProxyUrl = config.authProxyUrl + self.authProxyConfigId = config.authProxyConfigId + self.rpId = config.rpId + self.organizationId = config.organizationId + self.userConfig = config super.init() + self.client = self.makeAuthProxyClientIfNeeded() self.postInitSetup() } @@ -43,12 +69,17 @@ public final class TurnkeyContext: NSObject, ObservableObject { // clean up expired sessions and pending keys SessionRegistryStore.purgeExpiredSessions() PendingKeysStore.purge() - - - // restore session and timers after launch + + + // build runtime configuration, restore session and timers after launch Task { [weak self] in await self?.rescheduleAllSessionExpiries() await self?.restoreSelectedSession() + + // we call this last because `restoreSelectedSession()` sets the authentication + // state and we don't want this to slow that down + // TODO: how should this affect authentication state if this fails? + await self?.initializeRuntimeConfig() } // clean up periodically when app enters foreground diff --git a/Sources/TurnkeySwift/README.md b/Sources/TurnkeySwift/README.md index 2d2f3b76..95ac0931 100644 --- a/Sources/TurnkeySwift/README.md +++ b/Sources/TurnkeySwift/README.md @@ -37,8 +37,31 @@ Then in your views, access it via: --- +## Key Storage + +Session keys are automatically stored securely based on device capabilities: + +### 1. Secure Enclave (Default) + +When available, private keys are generated and stored inside the **Secure Enclave** - Apple's dedicated secure coprocessor. + +* **Private keys never leave the Secure Enclave** +* Hardware-isolated cryptographic operations +* Available on iPhone 5s and later, iPad Air and later, Macs with Apple Silicon or T2 chip + +### 2. Secure Storage (Fallback) + +If Secure Enclave is not available, keys are stored in the device's **Keychain** using Secure Storage. + +* Private keys stored in local Keychain +* Protected by device passcode/biometrics + +--- + ## Session Storage Keys +Session metadata is stored in **local storage** (UserDefaults) using the following keys: + * `com.turnkey.sdk.session`: Default session key for JWT payloads * `com.turnkey.sdk.sessionKeys`: Registry of stored sessions * `com.turnkey.sdk.pendingList`: Pending ephemeral key list @@ -51,106 +74,189 @@ Then in your views, access it via: ### Session Management -* `createKeyPair() -> String` - +* `createKeyPair() throws -> String` * Generates a new ephemeral key pair and saves the private key securely. -* `createSession(jwt:sessionKey:refreshedSessionTTLSeconds:)` - +* `storeSession(jwt:sessionKey:refreshedSessionTTLSeconds:)` * Creates and stores a session from a JWT. * Optionally sets up automatic refresh behavior if `refreshedSessionTTLSeconds` is provided. This value defines how long each refreshed session will last and must be at least 30 seconds. -* `setSelectedSession(sessionKey:) -> TurnkeyClient` - - * Selects a previously saved session and returns a usable client. +* `setActiveSession(sessionKey:) async throws -> TurnkeyClient` + * Activates a previously saved session and returns a usable client. * `clearSession(for:)` - * Clears the specified session and resets state. -* `refreshSession(expirationSeconds:sessionKey:invalidateExisting:)` - +* `refreshSession(expirationSeconds:sessionKey:invalidateExisting:) async throws` * Manually refreshes the selected session. Useful when rotating credentials. -### User Management +### Authentication -* `refreshUser()` +#### Direct API (No Auth Proxy Required) - * Re-fetches the user data from the API. +* `loginWithPasskey(sessionKey:expirationSeconds:invalidateExisting:) async throws -> BaseAuthResult` + * Authenticates using a passkey and creates a new session. -* `updateUser(email:phone:)` +* `handleGoogleOAuth(clientId:originUrl:redirectUrl:sessionKey:expirationSeconds:invalidateExisting:) async throws -> CompleteOAuthResult` + * Authenticates using Google OAuth. Can work without auth proxy if `oauthSuccess` redirect is provided. - * Updates the user contact details. +* `handleAppleOAuth(clientId:originUrl:redirectUrl:sessionKey:expirationSeconds:invalidateExisting:) async throws -> CompleteOAuthResult` + * Authenticates using Apple OAuth. Can work without auth proxy if `oauthSuccess` redirect is provided. -* `updateUserEmail(email:verificationToken:)` +#### Requires Auth Proxy - * Updates the user's email address. If a verification token is provided, the email is marked as verified. Passing an empty string will delete the user's email. +* `signUpWithPasskey(userName:passkeyName:email:phone:sessionKey:expirationSeconds:) async throws -> BaseAuthResult` + * Creates a new user account with passkey authentication. + +* `initOtp(contact:otpType:) async throws -> InitOtpResult` + * Initiates an OTP flow by sending a code to the specified contact. + +* `verifyOtp(otpId:otpCode:) async throws -> VerifyOtpResult` + * Verifies an OTP code and returns a verification token. + +* `loginWithOtp(verificationToken:publicKey:organizationId:invalidateExisting:sessionKey:) async throws -> BaseAuthResult` + * Logs in using a verified OTP token. + +* `signUpWithOtp(verificationToken:userName:publicKey:expirationSeconds:sessionKey:) async throws -> BaseAuthResult` + * Creates a new user account using a verified OTP token. + +* `completeOtp(otpId:otpCode:contact:otpType:publicKey:createSubOrgParams:invalidateExisting:sessionKey:) async throws -> CompleteOtpResult` + * Complete flow that verifies OTP and either logs in or signs up automatically. + +* `handleDiscordOAuth(clientId:originUrl:redirectUrl:sessionKey:expirationSeconds:invalidateExisting:) async throws -> CompleteOAuthResult` + * Authenticates using Discord OAuth. -* `updateUserPhoneNumber(phone:verificationToken:)` +* `handleXOauth(clientId:originUrl:redirectUrl:sessionKey:expirationSeconds:invalidateExisting:) async throws -> CompleteOAuthResult` + * Authenticates using X (Twitter) OAuth. +* `completeOAuth(oidcToken:publicKey:organizationId:invalidateExisting:sessionKey:expirationSeconds:) async throws -> CompleteOAuthResult` + * Completes OAuth flow with an OIDC token. + +### User Management + +* `fetchUser() async throws -> v1User` + * Fetches user data for the currently active session. + +* `refreshUser() async throws` + * Re-fetches and updates the current user data. + +* `updateUserEmail(email:verificationToken:) async throws` + * Updates the user's email address. If a verification token is provided, the email is marked as verified. Passing an empty string will delete the user's email. + +* `updateUserPhoneNumber(phone:verificationToken:) async throws` * Updates the user's phone number. If a verification token is provided, the phone number is marked as verified. Passing an empty string will delete the user's phone number. ### Wallet Management -* `createWallet(walletName:accounts:mnemonicLength:)` - - * Creates a wallet with optional mnemonic generation. +* `fetchWallets() async throws -> [Wallet]` + * Fetches all wallets for the current user. -* `importWallet(walletName:mnemonic:accounts:) -> Activity` +* `refreshWallets() async throws` + * Re-fetches and updates the wallets list. - * Imports an existing wallet using mnemonic phrase. +* `createWallet(walletName:accounts:mnemonicLength:) async throws` + * Creates a new wallet with optional mnemonic generation. -* `exportWallet(walletId:) -> String` +* `importWallet(walletName:mnemonic:accounts:) async throws` + * Imports an existing wallet using a mnemonic phrase. +* `exportWallet(walletId:dangerouslyOverrideSignerPublicKey:returnMnemonic:) async throws -> String` * Exports the mnemonic phrase for the specified wallet. ### Signing -* `signRawPayload(signWith:payload:encoding:hashFunction:) -> SignRawPayloadResult` - +* `signRawPayload(signWith:payload:encoding:hashFunction:) async throws -> SignRawPayloadResult` * Signs a raw payload using the current session. -### OAuth - -* `startGoogleOAuthFlow(clientId:nonce:scheme:anchor:originUri:redirectUri:) -> String` +* `signMessage(walletAddress:message:) async throws -> String` + * Signs a message with a specific wallet address. - * Launches the Google OAuth flow in a secure system browser window and returns an OIDC token. +* `signMessage(account:message:) async throws -> String` + * Signs a message with a specific account. --- -## Supported Types +## State Management -Common types used in the SDK are directly re-exported: +The `TurnkeyContext` publishes several properties that automatically update throughout the application lifecycle. You can observe these in SwiftUI views or using Combine: ```swift -public typealias PayloadEncoding = Components.Schemas.PayloadEncoding -public typealias HashFunction = Components.Schemas.HashFunction -public typealias Curve = Components.Schemas.Curve -public typealias PathFormat = Components.Schemas.PathFormat -public typealias AddressFormat = Components.Schemas.AddressFormat -public typealias Timestamp = Components.Schemas.external_period_data_period_v1_period_Timestamp +@Published public internal(set) var authState: AuthState ``` +* Current authentication state: `.loading`, `.unauthenticated`, or `.authenticated` +* Automatically updates when sessions are created, selected, or cleared ---- +```swift +@Published public internal(set) var selectedSessionKey: String? +``` +* The key of the currently active session +* `nil` when no session is selected -## Session Expiry Handling +```swift +@Published public internal(set) var session: Session? +``` +* Current session metadata including expiration, public key, user ID, and organization ID +* Automatically updates when sessions change -Each session schedules a timer to automatically clear itself 5 seconds before JWT expiry. If `refreshedSessionTTLSeconds` was provided when creating the session, the SDK will automatically refresh the session before it expires, as long as the app is active. +```swift +@Published public internal(set) var user: v1User? +``` +* Current user data including email, phone, and associated wallets +* Automatically refreshed after authentication and user updates +* Access via `turnkey.user?.userEmail`, `turnkey.user?.userPhoneNumber`, etc. -You can optionally observe session state via `@Published` properties on `TurnkeyContext`: +```swift +@Published public internal(set) var wallets: [Wallet] +``` +* Array of all wallets for the current user +* Automatically refreshed after authentication and wallet operations +* Each wallet includes accounts, addresses, and metadata ```swift -@Published public internal(set) var authState: AuthState -@Published public internal(set) var selectedSessionKey: String? -@Published public internal(set) var user: SessionUser? @Published public internal(set) var client: TurnkeyClient? ``` +* Configured API client for making authenticated requests +* Automatically created when a session is selected + +### Example Usage + +```swift +struct MyView: View { + @EnvironmentObject private var turnkey: TurnkeyContext + + var body: some View { + VStack { + if turnkey.authState == .authenticated { + Text("Welcome, \(turnkey.user?.userEmail ?? "User")") + + ForEach(turnkey.wallets) { wallet in + Text(wallet.walletName) + } + } + } + } +} +``` + +--- + +## Session Expiry Handling + +Each session schedules a timer to automatically clear itself 5 seconds before JWT expiry. If `refreshedSessionTTLSeconds` was provided when creating the session, the SDK will automatically refresh the session before it expires, as long as the app is active. --- ## Demo App -A sample SwiftUI demo app is included in the repository to showcase usage. +A complete SwiftUI demo wallet app is included in the repository at [`Examples/swift-demo-wallet`](../../Examples/swift-demo-wallet). It showcases: + +* Passkey and OTP authentication +* Session management +* Wallet creation and import +* Transaction signing +* User profile management + +See the [demo app README](../../Examples/swift-demo-wallet/README.md) for setup instructions. --- diff --git a/Sources/TurnkeyTypes/Generated/Types.swift b/Sources/TurnkeyTypes/Generated/Types.swift new file mode 100644 index 00000000..6536c75e --- /dev/null +++ b/Sources/TurnkeyTypes/Generated/Types.swift @@ -0,0 +1,12951 @@ +// @generated by Typegen. DO NOT EDIT BY HAND + +import Foundation + +// MARK: - Base Types from Swagger Definitions + +public struct apiApiKeyParams: Codable, Sendable { + /// Human-readable name for an API Key. + public let apiKeyName: String + /// Optional window (in seconds) indicating how long the API Key should last. + public let expirationSeconds: String? + /// The public component of a cryptographic key pair used to sign messages and transactions. + public let publicKey: String + + public init( + apiKeyName: String, + expirationSeconds: String? = nil, + publicKey: String + ) { + self.apiKeyName = apiKeyName + self.expirationSeconds = expirationSeconds + self.publicKey = publicKey + } +} + +public struct billingActivateBillingTierIntent: Codable, Sendable { + /// The product that the customer wants to subscribe to. + public let productId: String + + public init( + productId: String + ) { + self.productId = productId + } +} + +public struct billingActivateBillingTierResult: Codable, Sendable { + /// The id of the product being subscribed to. + public let productId: String + + public init( + productId: String + ) { + self.productId = productId + } +} + +public struct billingDeletePaymentMethodIntent: Codable, Sendable { + /// The payment method that the customer wants to remove. + public let paymentMethodId: String + + public init( + paymentMethodId: String + ) { + self.paymentMethodId = paymentMethodId + } +} + +public struct billingDeletePaymentMethodResult: Codable, Sendable { + /// The payment method that was removed. + public let paymentMethodId: String + + public init( + paymentMethodId: String + ) { + self.paymentMethodId = paymentMethodId + } +} + +public struct billingSetPaymentMethodIntent: Codable, Sendable { + /// The email that will receive invoices for the credit card. + public let cardHolderEmail: String + /// The name associated with the credit card. + public let cardHolderName: String + /// The verification digits of the customer's credit card. + public let cvv: String + /// The month that the credit card expires. + public let expiryMonth: String + /// The year that the credit card expires. + public let expiryYear: String + /// The account number of the customer's credit card. + public let number: String + + public init( + cardHolderEmail: String, + cardHolderName: String, + cvv: String, + expiryMonth: String, + expiryYear: String, + number: String + ) { + self.cardHolderEmail = cardHolderEmail + self.cardHolderName = cardHolderName + self.cvv = cvv + self.expiryMonth = expiryMonth + self.expiryYear = expiryYear + self.number = number + } +} + +public struct billingSetPaymentMethodIntentV2: Codable, Sendable { + /// The email that will receive invoices for the credit card. + public let cardHolderEmail: String + /// The name associated with the credit card. + public let cardHolderName: String + /// The id of the payment method that was created clientside. + public let paymentMethodId: String + + public init( + cardHolderEmail: String, + cardHolderName: String, + paymentMethodId: String + ) { + self.cardHolderEmail = cardHolderEmail + self.cardHolderName = cardHolderName + self.paymentMethodId = paymentMethodId + } +} + +public struct billingSetPaymentMethodResult: Codable, Sendable { + /// The email address associated with the payment method. + public let cardHolderEmail: String + /// The name associated with the payment method. + public let cardHolderName: String + /// The last four digits of the credit card added. + public let lastFour: String + + public init( + cardHolderEmail: String, + cardHolderName: String, + lastFour: String + ) { + self.cardHolderEmail = cardHolderEmail + self.cardHolderName = cardHolderName + self.lastFour = lastFour + } +} + +public struct datav1Tag: Codable, Sendable { + public let createdAt: externaldatav1Timestamp + /// Unique identifier for a given Tag. + public let tagId: String + /// Human-readable name for a Tag. + public let tagName: String + public let tagType: v1TagType + public let updatedAt: externaldatav1Timestamp + + public init( + createdAt: externaldatav1Timestamp, + tagId: String, + tagName: String, + tagType: v1TagType, + updatedAt: externaldatav1Timestamp + ) { + self.createdAt = createdAt + self.tagId = tagId + self.tagName = tagName + self.tagType = tagType + self.updatedAt = updatedAt + } +} + +public struct externalactivityv1PolicyEvaluation: Codable, Sendable { + /// Unique identifier for a given Activity. + public let activityId: String + public let createdAt: externaldatav1Timestamp + /// Unique identifier for a given policy evaluation. + public let id: String + /// Unique identifier for the Organization the Activity belongs to. + public let organizationId: String + /// Detailed evaluation result for each Policy that was run. + public let policyEvaluations: [immutablecommonv1PolicyEvaluation] + /// Unique identifier for the Vote associated with this policy evaluation. + public let voteId: String + + public init( + activityId: String, + createdAt: externaldatav1Timestamp, + id: String, + organizationId: String, + policyEvaluations: [immutablecommonv1PolicyEvaluation], + voteId: String + ) { + self.activityId = activityId + self.createdAt = createdAt + self.id = id + self.organizationId = organizationId + self.policyEvaluations = policyEvaluations + self.voteId = voteId + } +} + +public struct externaldatav1Address: Codable, Sendable { + public let address: String? + public let format: v1AddressFormat? + + public init( + address: String? = nil, + format: v1AddressFormat? = nil + ) { + self.address = address + self.format = format + } +} + +public struct externaldatav1Credential: Codable, Sendable { + /// The public component of a cryptographic key pair used to sign messages and transactions. + public let publicKey: String + public let type: v1CredentialType + + public init( + publicKey: String, + type: v1CredentialType + ) { + self.publicKey = publicKey + self.type = type + } +} + +public struct externaldatav1Quorum: Codable, Sendable { + /// Count of unique approvals required to meet quorum. + public let threshold: Int + /// Unique identifiers of quorum set members. + public let userIds: [String] + + public init( + threshold: Int, + userIds: [String] + ) { + self.threshold = threshold + self.userIds = userIds + } +} + +public struct externaldatav1Timestamp: Codable, Sendable { + public let nanos: String + public let seconds: String + + public init( + nanos: String, + seconds: String + ) { + self.nanos = nanos + self.seconds = seconds + } +} + +public struct immutableactivityv1Address: Codable, Sendable { + public let address: String? + public let format: v1AddressFormat? + + public init( + address: String? = nil, + format: v1AddressFormat? = nil + ) { + self.address = address + self.format = format + } +} + +public struct immutablecommonv1PolicyEvaluation: Codable, Sendable { + public let outcome: v1Outcome? + public let policyId: String? + + public init( + outcome: v1Outcome? = nil, + policyId: String? = nil + ) { + self.outcome = outcome + self.policyId = policyId + } +} + +public struct protobufAny: Codable, Sendable { + public let attype: String? + + public init( + attype: String? = nil + ) { + self.attype = attype + } + + private enum CodingKeys: String, CodingKey { + case attype = "@type" + } + + // Note: Additional properties supported +} + +public struct rpcStatus: Codable, Sendable { + public let code: Int? + public let details: [protobufAny]? + public let message: String? + + public init( + code: Int? = nil, + details: [protobufAny]? = nil, + message: String? = nil + ) { + self.code = code + self.details = details + self.message = message + } +} + +public struct v1AcceptInvitationIntent: Codable, Sendable { + /// WebAuthN hardware devices that can be used to log in to the Turnkey web app. + public let authenticator: v1AuthenticatorParams + /// Unique identifier for a given Invitation object. + public let invitationId: String + /// Unique identifier for a given User. + public let userId: String + + public init( + authenticator: v1AuthenticatorParams, + invitationId: String, + userId: String + ) { + self.authenticator = authenticator + self.invitationId = invitationId + self.userId = userId + } +} + +public struct v1AcceptInvitationIntentV2: Codable, Sendable { + /// WebAuthN hardware devices that can be used to log in to the Turnkey web app. + public let authenticator: v1AuthenticatorParamsV2 + /// Unique identifier for a given Invitation object. + public let invitationId: String + /// Unique identifier for a given User. + public let userId: String + + public init( + authenticator: v1AuthenticatorParamsV2, + invitationId: String, + userId: String + ) { + self.authenticator = authenticator + self.invitationId = invitationId + self.userId = userId + } +} + +public struct v1AcceptInvitationResult: Codable, Sendable { + /// Unique identifier for a given Invitation. + public let invitationId: String + /// Unique identifier for a given User. + public let userId: String + + public init( + invitationId: String, + userId: String + ) { + self.invitationId = invitationId + self.userId = userId + } +} + +public enum v1AccessType: String, Codable, Sendable { + case access_type_web = "ACCESS_TYPE_WEB" + case access_type_api = "ACCESS_TYPE_API" + case access_type_all = "ACCESS_TYPE_ALL" +} + +public struct v1Activity: Codable, Sendable { + /// A list of app proofs generated by enclaves during activity execution, providing verifiable attestations of performed operations. + public let appProofs: [v1AppProof]? + public let canApprove: Bool + public let canReject: Bool + public let createdAt: externaldatav1Timestamp + /// Failure reason of the intended action. + public let failure: rpcStatus? + /// An artifact verifying a User's action. + public let fingerprint: String + /// Unique identifier for a given Activity object. + public let id: String + /// Intent object crafted by Turnkey based on the user request, used to assess the permissibility of an action. + public let intent: v1Intent + /// Unique identifier for a given Organization. + public let organizationId: String + /// Result of the intended action. + public let result: v1Result + /// The current processing status of a specified Activity. + public let status: v1ActivityStatus + /// Type of Activity, such as Add User, or Sign Transaction. + public let type: v1ActivityType + public let updatedAt: externaldatav1Timestamp + /// A list of objects representing a particular User's approval or rejection of a Consensus request, including all relevant metadata. + public let votes: [v1Vote] + + public init( + appProofs: [v1AppProof]? = nil, + canApprove: Bool, + canReject: Bool, + createdAt: externaldatav1Timestamp, + failure: rpcStatus? = nil, + fingerprint: String, + id: String, + intent: v1Intent, + organizationId: String, + result: v1Result, + status: v1ActivityStatus, + type: v1ActivityType, + updatedAt: externaldatav1Timestamp, + votes: [v1Vote] + ) { + self.appProofs = appProofs + self.canApprove = canApprove + self.canReject = canReject + self.createdAt = createdAt + self.failure = failure + self.fingerprint = fingerprint + self.id = id + self.intent = intent + self.organizationId = organizationId + self.result = result + self.status = status + self.type = type + self.updatedAt = updatedAt + self.votes = votes + } +} + +public struct v1ActivityResponse: Codable, Sendable { + /// An action that can be taken within the Turnkey infrastructure. + public let activity: v1Activity + + public init( + activity: v1Activity + ) { + self.activity = activity + } +} + +public enum v1ActivityStatus: String, Codable, Sendable { + case activity_status_created = "ACTIVITY_STATUS_CREATED" + case activity_status_pending = "ACTIVITY_STATUS_PENDING" + case activity_status_completed = "ACTIVITY_STATUS_COMPLETED" + case activity_status_failed = "ACTIVITY_STATUS_FAILED" + case activity_status_consensus_needed = "ACTIVITY_STATUS_CONSENSUS_NEEDED" + case activity_status_rejected = "ACTIVITY_STATUS_REJECTED" +} + +public enum v1ActivityType: String, Codable, Sendable { + case activity_type_create_api_keys = "ACTIVITY_TYPE_CREATE_API_KEYS" + case activity_type_create_users = "ACTIVITY_TYPE_CREATE_USERS" + case activity_type_create_private_keys = "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS" + case activity_type_sign_raw_payload = "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD" + case activity_type_create_invitations = "ACTIVITY_TYPE_CREATE_INVITATIONS" + case activity_type_accept_invitation = "ACTIVITY_TYPE_ACCEPT_INVITATION" + case activity_type_create_policy = "ACTIVITY_TYPE_CREATE_POLICY" + case activity_type_disable_private_key = "ACTIVITY_TYPE_DISABLE_PRIVATE_KEY" + case activity_type_delete_users = "ACTIVITY_TYPE_DELETE_USERS" + case activity_type_delete_api_keys = "ACTIVITY_TYPE_DELETE_API_KEYS" + case activity_type_delete_invitation = "ACTIVITY_TYPE_DELETE_INVITATION" + case activity_type_delete_organization = "ACTIVITY_TYPE_DELETE_ORGANIZATION" + case activity_type_delete_policy = "ACTIVITY_TYPE_DELETE_POLICY" + case activity_type_create_user_tag = "ACTIVITY_TYPE_CREATE_USER_TAG" + case activity_type_delete_user_tags = "ACTIVITY_TYPE_DELETE_USER_TAGS" + case activity_type_create_organization = "ACTIVITY_TYPE_CREATE_ORGANIZATION" + case activity_type_sign_transaction = "ACTIVITY_TYPE_SIGN_TRANSACTION" + case activity_type_approve_activity = "ACTIVITY_TYPE_APPROVE_ACTIVITY" + case activity_type_reject_activity = "ACTIVITY_TYPE_REJECT_ACTIVITY" + case activity_type_delete_authenticators = "ACTIVITY_TYPE_DELETE_AUTHENTICATORS" + case activity_type_create_authenticators = "ACTIVITY_TYPE_CREATE_AUTHENTICATORS" + case activity_type_create_private_key_tag = "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG" + case activity_type_delete_private_key_tags = "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS" + case activity_type_set_payment_method = "ACTIVITY_TYPE_SET_PAYMENT_METHOD" + case activity_type_activate_billing_tier = "ACTIVITY_TYPE_ACTIVATE_BILLING_TIER" + case activity_type_delete_payment_method = "ACTIVITY_TYPE_DELETE_PAYMENT_METHOD" + case activity_type_create_policy_v2 = "ACTIVITY_TYPE_CREATE_POLICY_V2" + case activity_type_create_policy_v3 = "ACTIVITY_TYPE_CREATE_POLICY_V3" + case activity_type_create_api_only_users = "ACTIVITY_TYPE_CREATE_API_ONLY_USERS" + case activity_type_update_root_quorum = "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM" + case activity_type_update_user_tag = "ACTIVITY_TYPE_UPDATE_USER_TAG" + case activity_type_update_private_key_tag = "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG" + case activity_type_create_authenticators_v2 = "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2" + case activity_type_create_organization_v2 = "ACTIVITY_TYPE_CREATE_ORGANIZATION_V2" + case activity_type_create_users_v2 = "ACTIVITY_TYPE_CREATE_USERS_V2" + case activity_type_accept_invitation_v2 = "ACTIVITY_TYPE_ACCEPT_INVITATION_V2" + case activity_type_create_sub_organization = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION" + case activity_type_create_sub_organization_v2 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2" + case activity_type_update_allowed_origins = "ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS" + case activity_type_create_private_keys_v2 = "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2" + case activity_type_update_user = "ACTIVITY_TYPE_UPDATE_USER" + case activity_type_update_policy = "ACTIVITY_TYPE_UPDATE_POLICY" + case activity_type_set_payment_method_v2 = "ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2" + case activity_type_create_sub_organization_v3 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3" + case activity_type_create_wallet = "ACTIVITY_TYPE_CREATE_WALLET" + case activity_type_create_wallet_accounts = "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS" + case activity_type_init_user_email_recovery = "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY" + case activity_type_recover_user = "ACTIVITY_TYPE_RECOVER_USER" + case activity_type_set_organization_feature = "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE" + case activity_type_remove_organization_feature = "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE" + case activity_type_sign_raw_payload_v2 = "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2" + case activity_type_sign_transaction_v2 = "ACTIVITY_TYPE_SIGN_TRANSACTION_V2" + case activity_type_export_private_key = "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY" + case activity_type_export_wallet = "ACTIVITY_TYPE_EXPORT_WALLET" + case activity_type_create_sub_organization_v4 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4" + case activity_type_email_auth = "ACTIVITY_TYPE_EMAIL_AUTH" + case activity_type_export_wallet_account = "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT" + case activity_type_init_import_wallet = "ACTIVITY_TYPE_INIT_IMPORT_WALLET" + case activity_type_import_wallet = "ACTIVITY_TYPE_IMPORT_WALLET" + case activity_type_init_import_private_key = "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY" + case activity_type_import_private_key = "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY" + case activity_type_create_policies = "ACTIVITY_TYPE_CREATE_POLICIES" + case activity_type_sign_raw_payloads = "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS" + case activity_type_create_read_only_session = "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION" + case activity_type_create_oauth_providers = "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS" + case activity_type_delete_oauth_providers = "ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS" + case activity_type_create_sub_organization_v5 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5" + case activity_type_oauth = "ACTIVITY_TYPE_OAUTH" + case activity_type_create_api_keys_v2 = "ACTIVITY_TYPE_CREATE_API_KEYS_V2" + case activity_type_create_read_write_session = "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION" + case activity_type_email_auth_v2 = "ACTIVITY_TYPE_EMAIL_AUTH_V2" + case activity_type_create_sub_organization_v6 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6" + case activity_type_delete_private_keys = "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS" + case activity_type_delete_wallets = "ACTIVITY_TYPE_DELETE_WALLETS" + case activity_type_create_read_write_session_v2 = "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2" + case activity_type_delete_sub_organization = "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION" + case activity_type_init_otp_auth = "ACTIVITY_TYPE_INIT_OTP_AUTH" + case activity_type_otp_auth = "ACTIVITY_TYPE_OTP_AUTH" + case activity_type_create_sub_organization_v7 = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7" + case activity_type_update_wallet = "ACTIVITY_TYPE_UPDATE_WALLET" + case activity_type_update_policy_v2 = "ACTIVITY_TYPE_UPDATE_POLICY_V2" + case activity_type_create_users_v3 = "ACTIVITY_TYPE_CREATE_USERS_V3" + case activity_type_init_otp_auth_v2 = "ACTIVITY_TYPE_INIT_OTP_AUTH_V2" + case activity_type_init_otp = "ACTIVITY_TYPE_INIT_OTP" + case activity_type_verify_otp = "ACTIVITY_TYPE_VERIFY_OTP" + case activity_type_otp_login = "ACTIVITY_TYPE_OTP_LOGIN" + case activity_type_stamp_login = "ACTIVITY_TYPE_STAMP_LOGIN" + case activity_type_oauth_login = "ACTIVITY_TYPE_OAUTH_LOGIN" + case activity_type_update_user_name = "ACTIVITY_TYPE_UPDATE_USER_NAME" + case activity_type_update_user_email = "ACTIVITY_TYPE_UPDATE_USER_EMAIL" + case activity_type_update_user_phone_number = "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER" + case activity_type_init_fiat_on_ramp = "ACTIVITY_TYPE_INIT_FIAT_ON_RAMP" + case activity_type_create_smart_contract_interface = + "ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE" + case activity_type_delete_smart_contract_interface = + "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE" + case activity_type_enable_auth_proxy = "ACTIVITY_TYPE_ENABLE_AUTH_PROXY" + case activity_type_disable_auth_proxy = "ACTIVITY_TYPE_DISABLE_AUTH_PROXY" + case activity_type_update_auth_proxy_config = "ACTIVITY_TYPE_UPDATE_AUTH_PROXY_CONFIG" + case activity_type_create_oauth2_credential = "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL" + case activity_type_update_oauth2_credential = "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL" + case activity_type_delete_oauth2_credential = "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL" + case activity_type_oauth2_authenticate = "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE" + case activity_type_delete_wallet_accounts = "ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS" + case activity_type_delete_policies = "ACTIVITY_TYPE_DELETE_POLICIES" +} + +public enum v1AddressFormat: String, Codable, Sendable { + case address_format_uncompressed = "ADDRESS_FORMAT_UNCOMPRESSED" + case address_format_compressed = "ADDRESS_FORMAT_COMPRESSED" + case address_format_ethereum = "ADDRESS_FORMAT_ETHEREUM" + case address_format_solana = "ADDRESS_FORMAT_SOLANA" + case address_format_cosmos = "ADDRESS_FORMAT_COSMOS" + case address_format_tron = "ADDRESS_FORMAT_TRON" + case address_format_sui = "ADDRESS_FORMAT_SUI" + case address_format_aptos = "ADDRESS_FORMAT_APTOS" + case address_format_bitcoin_mainnet_p2pkh = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH" + case address_format_bitcoin_mainnet_p2sh = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH" + case address_format_bitcoin_mainnet_p2wpkh = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH" + case address_format_bitcoin_mainnet_p2wsh = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH" + case address_format_bitcoin_mainnet_p2tr = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR" + case address_format_bitcoin_testnet_p2pkh = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH" + case address_format_bitcoin_testnet_p2sh = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH" + case address_format_bitcoin_testnet_p2wpkh = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH" + case address_format_bitcoin_testnet_p2wsh = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH" + case address_format_bitcoin_testnet_p2tr = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR" + case address_format_bitcoin_signet_p2pkh = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH" + case address_format_bitcoin_signet_p2sh = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH" + case address_format_bitcoin_signet_p2wpkh = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH" + case address_format_bitcoin_signet_p2wsh = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH" + case address_format_bitcoin_signet_p2tr = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR" + case address_format_bitcoin_regtest_p2pkh = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH" + case address_format_bitcoin_regtest_p2sh = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH" + case address_format_bitcoin_regtest_p2wpkh = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH" + case address_format_bitcoin_regtest_p2wsh = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH" + case address_format_bitcoin_regtest_p2tr = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR" + case address_format_sei = "ADDRESS_FORMAT_SEI" + case address_format_xlm = "ADDRESS_FORMAT_XLM" + case address_format_doge_mainnet = "ADDRESS_FORMAT_DOGE_MAINNET" + case address_format_doge_testnet = "ADDRESS_FORMAT_DOGE_TESTNET" + case address_format_ton_v3r2 = "ADDRESS_FORMAT_TON_V3R2" + case address_format_ton_v4r2 = "ADDRESS_FORMAT_TON_V4R2" + case address_format_ton_v5r1 = "ADDRESS_FORMAT_TON_V5R1" + case address_format_xrp = "ADDRESS_FORMAT_XRP" +} + +public struct v1ApiKey: Codable, Sendable { + /// Unique identifier for a given API Key. + public let apiKeyId: String + /// Human-readable name for an API Key. + public let apiKeyName: String + public let createdAt: externaldatav1Timestamp + /// A User credential that can be used to authenticate to Turnkey. + public let credential: externaldatav1Credential + /// Optional window (in seconds) indicating how long the API Key should last. + public let expirationSeconds: String? + public let updatedAt: externaldatav1Timestamp + + public init( + apiKeyId: String, + apiKeyName: String, + createdAt: externaldatav1Timestamp, + credential: externaldatav1Credential, + expirationSeconds: String? = nil, + updatedAt: externaldatav1Timestamp + ) { + self.apiKeyId = apiKeyId + self.apiKeyName = apiKeyName + self.createdAt = createdAt + self.credential = credential + self.expirationSeconds = expirationSeconds + self.updatedAt = updatedAt + } +} + +public enum v1ApiKeyCurve: String, Codable, Sendable { + case api_key_curve_p256 = "API_KEY_CURVE_P256" + case api_key_curve_secp256k1 = "API_KEY_CURVE_SECP256K1" + case api_key_curve_ed25519 = "API_KEY_CURVE_ED25519" +} + +public struct v1ApiKeyParamsV2: Codable, Sendable { + /// Human-readable name for an API Key. + public let apiKeyName: String + /// The curve type to be used for processing API key signatures. + public let curveType: v1ApiKeyCurve + /// Optional window (in seconds) indicating how long the API Key should last. + public let expirationSeconds: String? + /// The public component of a cryptographic key pair used to sign messages and transactions. + public let publicKey: String + + public init( + apiKeyName: String, + curveType: v1ApiKeyCurve, + expirationSeconds: String? = nil, + publicKey: String + ) { + self.apiKeyName = apiKeyName + self.curveType = curveType + self.expirationSeconds = expirationSeconds + self.publicKey = publicKey + } +} + +public struct v1ApiOnlyUserParams: Codable, Sendable { + /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. + public let apiKeys: [apiApiKeyParams] + /// The email address for this API-only User (optional). + public let userEmail: String? + /// The name of the new API-only User. + public let userName: String + /// A list of tags assigned to the new API-only User. This field, if not needed, should be an empty array in your request body. + public let userTags: [String] + + public init( + apiKeys: [apiApiKeyParams], + userEmail: String? = nil, + userName: String, + userTags: [String] + ) { + self.apiKeys = apiKeys + self.userEmail = userEmail + self.userName = userName + self.userTags = userTags + } +} + +public struct v1AppProof: Codable, Sendable { + /// JSON serialized AppProofPayload. + public let proofPayload: String + /// Ephemeral public key. + public let publicKey: String + /// Scheme of signing key. + public let scheme: v1SignatureScheme + /// Signature over hashed proof_payload. + public let signature: String + + public init( + proofPayload: String, + publicKey: String, + scheme: v1SignatureScheme, + signature: String + ) { + self.proofPayload = proofPayload + self.publicKey = publicKey + self.scheme = scheme + self.signature = signature + } +} + +public struct v1ApproveActivityIntent: Codable, Sendable { + /// An artifact verifying a User's action. + public let fingerprint: String + + public init( + fingerprint: String + ) { + self.fingerprint = fingerprint + } +} + +public struct v1ApproveActivityRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1ApproveActivityIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1ApproveActivityIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1Attestation: Codable, Sendable { + /// A base64 url encoded payload containing authenticator data and any attestation the webauthn provider chooses. + public let attestationObject: String + /// A base64 url encoded payload containing metadata about the signing context and the challenge. + public let clientDataJson: String + /// The cbor encoded then base64 url encoded id of the credential. + public let credentialId: String + /// The type of authenticator transports. + public let transports: [v1AuthenticatorTransport] + + public init( + attestationObject: String, + clientDataJson: String, + credentialId: String, + transports: [v1AuthenticatorTransport] + ) { + self.attestationObject = attestationObject + self.clientDataJson = clientDataJson + self.credentialId = credentialId + self.transports = transports + } +} + +public struct v1Authenticator: Codable, Sendable { + /// Identifier indicating the type of the Security Key. + public let aaguid: String + public let attestationType: String + /// Unique identifier for a given Authenticator. + public let authenticatorId: String + /// Human-readable name for an Authenticator. + public let authenticatorName: String + public let createdAt: externaldatav1Timestamp + /// A User credential that can be used to authenticate to Turnkey. + public let credential: externaldatav1Credential + /// Unique identifier for a WebAuthn credential. + public let credentialId: String + /// The type of Authenticator device. + public let model: String + /// Types of transports that may be used by an Authenticator (e.g., USB, NFC, BLE). + public let transports: [v1AuthenticatorTransport] + public let updatedAt: externaldatav1Timestamp + + public init( + aaguid: String, + attestationType: String, + authenticatorId: String, + authenticatorName: String, + createdAt: externaldatav1Timestamp, + credential: externaldatav1Credential, + credentialId: String, + model: String, + transports: [v1AuthenticatorTransport], + updatedAt: externaldatav1Timestamp + ) { + self.aaguid = aaguid + self.attestationType = attestationType + self.authenticatorId = authenticatorId + self.authenticatorName = authenticatorName + self.createdAt = createdAt + self.credential = credential + self.credentialId = credentialId + self.model = model + self.transports = transports + self.updatedAt = updatedAt + } +} + +public struct v1AuthenticatorAttestationResponse: Codable, Sendable { + public let attestationObject: String + public let authenticatorAttachment: String? + public let clientDataJson: String + public let transports: [v1AuthenticatorTransport]? + + public init( + attestationObject: String, + authenticatorAttachment: String? = nil, + clientDataJson: String, + transports: [v1AuthenticatorTransport]? = nil + ) { + self.attestationObject = attestationObject + self.authenticatorAttachment = authenticatorAttachment + self.clientDataJson = clientDataJson + self.transports = transports + } +} + +public struct v1AuthenticatorParams: Codable, Sendable { + public let attestation: v1PublicKeyCredentialWithAttestation + /// Human-readable name for an Authenticator. + public let authenticatorName: String + /// Challenge presented for authentication purposes. + public let challenge: String + /// Unique identifier for a given User. + public let userId: String + + public init( + attestation: v1PublicKeyCredentialWithAttestation, + authenticatorName: String, + challenge: String, + userId: String + ) { + self.attestation = attestation + self.authenticatorName = authenticatorName + self.challenge = challenge + self.userId = userId + } +} + +public struct v1AuthenticatorParamsV2: Codable, Sendable { + /// The attestation that proves custody of the authenticator and provides metadata about it. + public let attestation: v1Attestation + /// Human-readable name for an Authenticator. + public let authenticatorName: String + /// Challenge presented for authentication purposes. + public let challenge: String + + public init( + attestation: v1Attestation, + authenticatorName: String, + challenge: String + ) { + self.attestation = attestation + self.authenticatorName = authenticatorName + self.challenge = challenge + } +} + +public enum v1AuthenticatorTransport: String, Codable, Sendable { + case authenticator_transport_ble = "AUTHENTICATOR_TRANSPORT_BLE" + case authenticator_transport_internal = "AUTHENTICATOR_TRANSPORT_INTERNAL" + case authenticator_transport_nfc = "AUTHENTICATOR_TRANSPORT_NFC" + case authenticator_transport_usb = "AUTHENTICATOR_TRANSPORT_USB" + case authenticator_transport_hybrid = "AUTHENTICATOR_TRANSPORT_HYBRID" +} + +public struct v1BootProof: Codable, Sendable { + /// The DER encoded COSE Sign1 struct Attestation doc. + public let awsAttestationDocB64: String + public let createdAt: externaldatav1Timestamp + /// The label under which the enclave app was deployed. + public let deploymentLabel: String + /// Name of the enclave app + public let enclaveApp: String + /// The hex encoded Ephemeral Public Key. + public let ephemeralPublicKeyHex: String + /// Owner of the app i.e. 'tkhq' + public let owner: String + /// The borsch serialized base64 encoded Manifest. + public let qosManifestB64: String + /// The borsch serialized base64 encoded Manifest Envelope. + public let qosManifestEnvelopeB64: String + + public init( + awsAttestationDocB64: String, + createdAt: externaldatav1Timestamp, + deploymentLabel: String, + enclaveApp: String, + ephemeralPublicKeyHex: String, + owner: String, + qosManifestB64: String, + qosManifestEnvelopeB64: String + ) { + self.awsAttestationDocB64 = awsAttestationDocB64 + self.createdAt = createdAt + self.deploymentLabel = deploymentLabel + self.enclaveApp = enclaveApp + self.ephemeralPublicKeyHex = ephemeralPublicKeyHex + self.owner = owner + self.qosManifestB64 = qosManifestB64 + self.qosManifestEnvelopeB64 = qosManifestEnvelopeB64 + } +} + +public struct v1BootProofResponse: Codable, Sendable { + public let bootProof: v1BootProof + + public init( + bootProof: v1BootProof + ) { + self.bootProof = bootProof + } +} + +public struct v1Config: Codable, Sendable { + public let features: [v1Feature]? + public let quorum: externaldatav1Quorum? + + public init( + features: [v1Feature]? = nil, + quorum: externaldatav1Quorum? = nil + ) { + self.features = features + self.quorum = quorum + } +} + +public struct v1CreateApiKeysIntent: Codable, Sendable { + /// A list of API Keys. + public let apiKeys: [apiApiKeyParams] + /// Unique identifier for a given User. + public let userId: String + + public init( + apiKeys: [apiApiKeyParams], + userId: String + ) { + self.apiKeys = apiKeys + self.userId = userId + } +} + +public struct v1CreateApiKeysIntentV2: Codable, Sendable { + /// A list of API Keys. + public let apiKeys: [v1ApiKeyParamsV2] + /// Unique identifier for a given User. + public let userId: String + + public init( + apiKeys: [v1ApiKeyParamsV2], + userId: String + ) { + self.apiKeys = apiKeys + self.userId = userId + } +} + +public struct v1CreateApiKeysRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateApiKeysIntentV2 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateApiKeysIntentV2, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateApiKeysResult: Codable, Sendable { + /// A list of API Key IDs. + public let apiKeyIds: [String] + + public init( + apiKeyIds: [String] + ) { + self.apiKeyIds = apiKeyIds + } +} + +public struct v1CreateApiOnlyUsersIntent: Codable, Sendable { + /// A list of API-only Users to create. + public let apiOnlyUsers: [v1ApiOnlyUserParams] + + public init( + apiOnlyUsers: [v1ApiOnlyUserParams] + ) { + self.apiOnlyUsers = apiOnlyUsers + } +} + +public struct v1CreateApiOnlyUsersRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateApiOnlyUsersIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateApiOnlyUsersIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateApiOnlyUsersResult: Codable, Sendable { + /// A list of API-only User IDs. + public let userIds: [String] + + public init( + userIds: [String] + ) { + self.userIds = userIds + } +} + +public struct v1CreateAuthenticatorsIntent: Codable, Sendable { + /// A list of Authenticators. + public let authenticators: [v1AuthenticatorParams] + /// Unique identifier for a given User. + public let userId: String + + public init( + authenticators: [v1AuthenticatorParams], + userId: String + ) { + self.authenticators = authenticators + self.userId = userId + } +} + +public struct v1CreateAuthenticatorsIntentV2: Codable, Sendable { + /// A list of Authenticators. + public let authenticators: [v1AuthenticatorParamsV2] + /// Unique identifier for a given User. + public let userId: String + + public init( + authenticators: [v1AuthenticatorParamsV2], + userId: String + ) { + self.authenticators = authenticators + self.userId = userId + } +} + +public struct v1CreateAuthenticatorsRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateAuthenticatorsIntentV2 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateAuthenticatorsIntentV2, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateAuthenticatorsResult: Codable, Sendable { + /// A list of Authenticator IDs. + public let authenticatorIds: [String] + + public init( + authenticatorIds: [String] + ) { + self.authenticatorIds = authenticatorIds + } +} + +public struct v1CreateInvitationsIntent: Codable, Sendable { + /// A list of Invitations. + public let invitations: [v1InvitationParams] + + public init( + invitations: [v1InvitationParams] + ) { + self.invitations = invitations + } +} + +public struct v1CreateInvitationsRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateInvitationsIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateInvitationsIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateInvitationsResult: Codable, Sendable { + /// A list of Invitation IDs + public let invitationIds: [String] + + public init( + invitationIds: [String] + ) { + self.invitationIds = invitationIds + } +} + +public struct v1CreateOauth2CredentialIntent: Codable, Sendable { + /// The Client ID issued by the OAuth 2.0 provider + public let clientId: String + /// The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key + public let encryptedClientSecret: String + /// The OAuth 2.0 provider + public let provider: v1Oauth2Provider + + public init( + clientId: String, + encryptedClientSecret: String, + provider: v1Oauth2Provider + ) { + self.clientId = clientId + self.encryptedClientSecret = encryptedClientSecret + self.provider = provider + } +} + +public struct v1CreateOauth2CredentialRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateOauth2CredentialIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateOauth2CredentialIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateOauth2CredentialResult: Codable, Sendable { + /// Unique identifier of the OAuth 2.0 credential that was created + public let oauth2CredentialId: String + + public init( + oauth2CredentialId: String + ) { + self.oauth2CredentialId = oauth2CredentialId + } +} + +public struct v1CreateOauthProvidersIntent: Codable, Sendable { + /// A list of Oauth providers. + public let oauthProviders: [v1OauthProviderParams] + /// The ID of the User to add an Oauth provider to + public let userId: String + + public init( + oauthProviders: [v1OauthProviderParams], + userId: String + ) { + self.oauthProviders = oauthProviders + self.userId = userId + } +} + +public struct v1CreateOauthProvidersRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateOauthProvidersIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateOauthProvidersIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateOauthProvidersResult: Codable, Sendable { + /// A list of unique identifiers for Oauth Providers + public let providerIds: [String] + + public init( + providerIds: [String] + ) { + self.providerIds = providerIds + } +} + +public struct v1CreateOrganizationIntent: Codable, Sendable { + /// Human-readable name for an Organization. + public let organizationName: String + /// The root user's Authenticator. + public let rootAuthenticator: v1AuthenticatorParams + /// The root user's email address. + public let rootEmail: String + /// Unique identifier for the root user object. + public let rootUserId: String? + + public init( + organizationName: String, + rootAuthenticator: v1AuthenticatorParams, + rootEmail: String, + rootUserId: String? = nil + ) { + self.organizationName = organizationName + self.rootAuthenticator = rootAuthenticator + self.rootEmail = rootEmail + self.rootUserId = rootUserId + } +} + +public struct v1CreateOrganizationIntentV2: Codable, Sendable { + /// Human-readable name for an Organization. + public let organizationName: String + /// The root user's Authenticator. + public let rootAuthenticator: v1AuthenticatorParamsV2 + /// The root user's email address. + public let rootEmail: String + /// Unique identifier for the root user object. + public let rootUserId: String? + + public init( + organizationName: String, + rootAuthenticator: v1AuthenticatorParamsV2, + rootEmail: String, + rootUserId: String? = nil + ) { + self.organizationName = organizationName + self.rootAuthenticator = rootAuthenticator + self.rootEmail = rootEmail + self.rootUserId = rootUserId + } +} + +public struct v1CreateOrganizationResult: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1CreatePoliciesIntent: Codable, Sendable { + /// An array of policy intents to be created. + public let policies: [v1CreatePolicyIntentV3] + + public init( + policies: [v1CreatePolicyIntentV3] + ) { + self.policies = policies + } +} + +public struct v1CreatePoliciesRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreatePoliciesIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreatePoliciesIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreatePoliciesResult: Codable, Sendable { + /// A list of unique identifiers for the created policies. + public let policyIds: [String] + + public init( + policyIds: [String] + ) { + self.policyIds = policyIds + } +} + +public struct v1CreatePolicyIntent: Codable, Sendable { + /// The instruction to DENY or ALLOW a particular activity following policy selector(s). + public let effect: v1Effect + public let notes: String? + /// Human-readable name for a Policy. + public let policyName: String + /// A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details. + public let selectors: [v1Selector] + + public init( + effect: v1Effect, + notes: String? = nil, + policyName: String, + selectors: [v1Selector] + ) { + self.effect = effect + self.notes = notes + self.policyName = policyName + self.selectors = selectors + } +} + +public struct v1CreatePolicyIntentV2: Codable, Sendable { + /// Whether to ALLOW or DENY requests that match the condition and consensus requirements. + public let effect: v1Effect + public let notes: String? + /// Human-readable name for a Policy. + public let policyName: String + /// A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details. + public let selectors: [v1SelectorV2] + + public init( + effect: v1Effect, + notes: String? = nil, + policyName: String, + selectors: [v1SelectorV2] + ) { + self.effect = effect + self.notes = notes + self.policyName = policyName + self.selectors = selectors + } +} + +public struct v1CreatePolicyIntentV3: Codable, Sendable { + /// The condition expression that triggers the Effect + public let condition: String? + /// The consensus expression that triggers the Effect + public let consensus: String? + /// The instruction to DENY or ALLOW an activity. + public let effect: v1Effect + public let notes: String? + /// Human-readable name for a Policy. + public let policyName: String + + public init( + condition: String? = nil, + consensus: String? = nil, + effect: v1Effect, + notes: String? = nil, + policyName: String + ) { + self.condition = condition + self.consensus = consensus + self.effect = effect + self.notes = notes + self.policyName = policyName + } +} + +public struct v1CreatePolicyRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreatePolicyIntentV3 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreatePolicyIntentV3, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreatePolicyResult: Codable, Sendable { + /// Unique identifier for a given Policy. + public let policyId: String + + public init( + policyId: String + ) { + self.policyId = policyId + } +} + +public struct v1CreatePrivateKeyTagIntent: Codable, Sendable { + /// A list of Private Key IDs. + public let privateKeyIds: [String] + /// Human-readable name for a Private Key Tag. + public let privateKeyTagName: String + + public init( + privateKeyIds: [String], + privateKeyTagName: String + ) { + self.privateKeyIds = privateKeyIds + self.privateKeyTagName = privateKeyTagName + } +} + +public struct v1CreatePrivateKeyTagRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreatePrivateKeyTagIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreatePrivateKeyTagIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreatePrivateKeyTagResult: Codable, Sendable { + /// A list of Private Key IDs. + public let privateKeyIds: [String] + /// Unique identifier for a given Private Key Tag. + public let privateKeyTagId: String + + public init( + privateKeyIds: [String], + privateKeyTagId: String + ) { + self.privateKeyIds = privateKeyIds + self.privateKeyTagId = privateKeyTagId + } +} + +public struct v1CreatePrivateKeysIntent: Codable, Sendable { + /// A list of Private Keys. + public let privateKeys: [v1PrivateKeyParams] + + public init( + privateKeys: [v1PrivateKeyParams] + ) { + self.privateKeys = privateKeys + } +} + +public struct v1CreatePrivateKeysIntentV2: Codable, Sendable { + /// A list of Private Keys. + public let privateKeys: [v1PrivateKeyParams] + + public init( + privateKeys: [v1PrivateKeyParams] + ) { + self.privateKeys = privateKeys + } +} + +public struct v1CreatePrivateKeysRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreatePrivateKeysIntentV2 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreatePrivateKeysIntentV2, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreatePrivateKeysResult: Codable, Sendable { + /// A list of Private Key IDs. + public let privateKeyIds: [String] + + public init( + privateKeyIds: [String] + ) { + self.privateKeyIds = privateKeyIds + } +} + +public struct v1CreatePrivateKeysResultV2: Codable, Sendable { + /// A list of Private Key IDs and addresses. + public let privateKeys: [v1PrivateKeyResult] + + public init( + privateKeys: [v1PrivateKeyResult] + ) { + self.privateKeys = privateKeys + } +} + +public struct v1CreateReadOnlySessionIntent: Codable, Sendable { + public init() {} +} + +public struct v1CreateReadOnlySessionRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateReadOnlySessionIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateReadOnlySessionIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateReadOnlySessionResult: Codable, Sendable { + /// Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. + public let organizationId: String + /// Human-readable name for an Organization. + public let organizationName: String + /// String representing a read only session + public let session: String + /// UTC timestamp in seconds representing the expiry time for the read only session. + public let sessionExpiry: String + /// Unique identifier for a given User. + public let userId: String + /// Human-readable name for a User. + public let username: String + + public init( + organizationId: String, + organizationName: String, + session: String, + sessionExpiry: String, + userId: String, + username: String + ) { + self.organizationId = organizationId + self.organizationName = organizationName + self.session = session + self.sessionExpiry = sessionExpiry + self.userId = userId + self.username = username + } +} + +public struct v1CreateReadWriteSessionIntent: Codable, Sendable { + /// Optional human-readable name for an API Key. If none provided, default to Read Write Session - + public let apiKeyName: String? + /// Email of the user to create a read write session for + public let email: String + /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted. + public let targetPublicKey: String + + public init( + apiKeyName: String? = nil, + email: String, + expirationSeconds: String? = nil, + targetPublicKey: String + ) { + self.apiKeyName = apiKeyName + self.email = email + self.expirationSeconds = expirationSeconds + self.targetPublicKey = targetPublicKey + } +} + +public struct v1CreateReadWriteSessionIntentV2: Codable, Sendable { + /// Optional human-readable name for an API Key. If none provided, default to Read Write Session - + public let apiKeyName: String? + /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated ReadWriteSession API keys + public let invalidateExisting: Bool? + /// Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted. + public let targetPublicKey: String + /// Unique identifier for a given User. + public let userId: String? + + public init( + apiKeyName: String? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + targetPublicKey: String, + userId: String? = nil + ) { + self.apiKeyName = apiKeyName + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.targetPublicKey = targetPublicKey + self.userId = userId + } +} + +public struct v1CreateReadWriteSessionRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateReadWriteSessionIntentV2 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateReadWriteSessionIntentV2, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateReadWriteSessionResult: Codable, Sendable { + /// Unique identifier for the created API key. + public let apiKeyId: String + /// HPKE encrypted credential bundle + public let credentialBundle: String + /// Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. + public let organizationId: String + /// Human-readable name for an Organization. + public let organizationName: String + /// Unique identifier for a given User. + public let userId: String + /// Human-readable name for a User. + public let username: String + + public init( + apiKeyId: String, + credentialBundle: String, + organizationId: String, + organizationName: String, + userId: String, + username: String + ) { + self.apiKeyId = apiKeyId + self.credentialBundle = credentialBundle + self.organizationId = organizationId + self.organizationName = organizationName + self.userId = userId + self.username = username + } +} + +public struct v1CreateReadWriteSessionResultV2: Codable, Sendable { + /// Unique identifier for the created API key. + public let apiKeyId: String + /// HPKE encrypted credential bundle + public let credentialBundle: String + /// Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. + public let organizationId: String + /// Human-readable name for an Organization. + public let organizationName: String + /// Unique identifier for a given User. + public let userId: String + /// Human-readable name for a User. + public let username: String + + public init( + apiKeyId: String, + credentialBundle: String, + organizationId: String, + organizationName: String, + userId: String, + username: String + ) { + self.apiKeyId = apiKeyId + self.credentialBundle = credentialBundle + self.organizationId = organizationId + self.organizationName = organizationName + self.userId = userId + self.username = username + } +} + +public struct v1CreateSmartContractInterfaceIntent: Codable, Sendable { + /// Human-readable name for a Smart Contract Interface. + public let label: String + /// Notes for a Smart Contract Interface. + public let notes: String? + /// Corresponding contract address or program ID + public let smartContractAddress: String + /// ABI/IDL as a JSON string + public let smartContractInterface: String + public let type: v1SmartContractInterfaceType + + public init( + label: String, + notes: String? = nil, + smartContractAddress: String, + smartContractInterface: String, + type: v1SmartContractInterfaceType + ) { + self.label = label + self.notes = notes + self.smartContractAddress = smartContractAddress + self.smartContractInterface = smartContractInterface + self.type = type + } +} + +public struct v1CreateSmartContractInterfaceRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateSmartContractInterfaceIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateSmartContractInterfaceIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateSmartContractInterfaceResult: Codable, Sendable { + /// The ID of the created Smart Contract Interface. + public let smartContractInterfaceId: String + + public init( + smartContractInterfaceId: String + ) { + self.smartContractInterfaceId = smartContractInterfaceId + } +} + +public struct v1CreateSubOrganizationIntent: Codable, Sendable { + /// Name for this sub-organization + public let name: String + /// Root User authenticator for this new sub-organization + public let rootAuthenticator: v1AuthenticatorParamsV2 + + public init( + name: String, + rootAuthenticator: v1AuthenticatorParamsV2 + ) { + self.name = name + self.rootAuthenticator = rootAuthenticator + } +} + +public struct v1CreateSubOrganizationIntentV2: Codable, Sendable { + /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users + public let rootQuorumThreshold: Int + /// Root users to create within this sub-organization + public let rootUsers: [v1RootUserParams] + /// Name for this sub-organization + public let subOrganizationName: String + + public init( + rootQuorumThreshold: Int, + rootUsers: [v1RootUserParams], + subOrganizationName: String + ) { + self.rootQuorumThreshold = rootQuorumThreshold + self.rootUsers = rootUsers + self.subOrganizationName = subOrganizationName + } +} + +public struct v1CreateSubOrganizationIntentV3: Codable, Sendable { + /// A list of Private Keys. + public let privateKeys: [v1PrivateKeyParams] + /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users + public let rootQuorumThreshold: Int + /// Root users to create within this sub-organization + public let rootUsers: [v1RootUserParams] + /// Name for this sub-organization + public let subOrganizationName: String + + public init( + privateKeys: [v1PrivateKeyParams], + rootQuorumThreshold: Int, + rootUsers: [v1RootUserParams], + subOrganizationName: String + ) { + self.privateKeys = privateKeys + self.rootQuorumThreshold = rootQuorumThreshold + self.rootUsers = rootUsers + self.subOrganizationName = subOrganizationName + } +} + +public struct v1CreateSubOrganizationIntentV4: Codable, Sendable { + /// Disable email auth for the sub-organization + public let disableEmailAuth: Bool? + /// Disable email recovery for the sub-organization + public let disableEmailRecovery: Bool? + /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users + public let rootQuorumThreshold: Int + /// Root users to create within this sub-organization + public let rootUsers: [v1RootUserParams] + /// Name for this sub-organization + public let subOrganizationName: String + /// The wallet to create for the sub-organization + public let wallet: v1WalletParams? + + public init( + disableEmailAuth: Bool? = nil, + disableEmailRecovery: Bool? = nil, + rootQuorumThreshold: Int, + rootUsers: [v1RootUserParams], + subOrganizationName: String, + wallet: v1WalletParams? = nil + ) { + self.disableEmailAuth = disableEmailAuth + self.disableEmailRecovery = disableEmailRecovery + self.rootQuorumThreshold = rootQuorumThreshold + self.rootUsers = rootUsers + self.subOrganizationName = subOrganizationName + self.wallet = wallet + } +} + +public struct v1CreateSubOrganizationIntentV5: Codable, Sendable { + /// Disable email auth for the sub-organization + public let disableEmailAuth: Bool? + /// Disable email recovery for the sub-organization + public let disableEmailRecovery: Bool? + /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users + public let rootQuorumThreshold: Int + /// Root users to create within this sub-organization + public let rootUsers: [v1RootUserParamsV2] + /// Name for this sub-organization + public let subOrganizationName: String + /// The wallet to create for the sub-organization + public let wallet: v1WalletParams? + + public init( + disableEmailAuth: Bool? = nil, + disableEmailRecovery: Bool? = nil, + rootQuorumThreshold: Int, + rootUsers: [v1RootUserParamsV2], + subOrganizationName: String, + wallet: v1WalletParams? = nil + ) { + self.disableEmailAuth = disableEmailAuth + self.disableEmailRecovery = disableEmailRecovery + self.rootQuorumThreshold = rootQuorumThreshold + self.rootUsers = rootUsers + self.subOrganizationName = subOrganizationName + self.wallet = wallet + } +} + +public struct v1CreateSubOrganizationIntentV6: Codable, Sendable { + /// Disable email auth for the sub-organization + public let disableEmailAuth: Bool? + /// Disable email recovery for the sub-organization + public let disableEmailRecovery: Bool? + /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users + public let rootQuorumThreshold: Int + /// Root users to create within this sub-organization + public let rootUsers: [v1RootUserParamsV3] + /// Name for this sub-organization + public let subOrganizationName: String + /// The wallet to create for the sub-organization + public let wallet: v1WalletParams? + + public init( + disableEmailAuth: Bool? = nil, + disableEmailRecovery: Bool? = nil, + rootQuorumThreshold: Int, + rootUsers: [v1RootUserParamsV3], + subOrganizationName: String, + wallet: v1WalletParams? = nil + ) { + self.disableEmailAuth = disableEmailAuth + self.disableEmailRecovery = disableEmailRecovery + self.rootQuorumThreshold = rootQuorumThreshold + self.rootUsers = rootUsers + self.subOrganizationName = subOrganizationName + self.wallet = wallet + } +} + +public struct v1CreateSubOrganizationIntentV7: Codable, Sendable { + /// Disable email auth for the sub-organization + public let disableEmailAuth: Bool? + /// Disable email recovery for the sub-organization + public let disableEmailRecovery: Bool? + /// Disable OTP email auth for the sub-organization + public let disableOtpEmailAuth: Bool? + /// Disable OTP SMS auth for the sub-organization + public let disableSmsAuth: Bool? + /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users + public let rootQuorumThreshold: Int + /// Root users to create within this sub-organization + public let rootUsers: [v1RootUserParamsV4] + /// Name for this sub-organization + public let subOrganizationName: String + /// Signed JWT containing a unique id, expiry, verification type, contact + public let verificationToken: String? + /// The wallet to create for the sub-organization + public let wallet: v1WalletParams? + + public init( + disableEmailAuth: Bool? = nil, + disableEmailRecovery: Bool? = nil, + disableOtpEmailAuth: Bool? = nil, + disableSmsAuth: Bool? = nil, + rootQuorumThreshold: Int, + rootUsers: [v1RootUserParamsV4], + subOrganizationName: String, + verificationToken: String? = nil, + wallet: v1WalletParams? = nil + ) { + self.disableEmailAuth = disableEmailAuth + self.disableEmailRecovery = disableEmailRecovery + self.disableOtpEmailAuth = disableOtpEmailAuth + self.disableSmsAuth = disableSmsAuth + self.rootQuorumThreshold = rootQuorumThreshold + self.rootUsers = rootUsers + self.subOrganizationName = subOrganizationName + self.verificationToken = verificationToken + self.wallet = wallet + } +} + +public struct v1CreateSubOrganizationRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateSubOrganizationIntentV7 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateSubOrganizationIntentV7, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateSubOrganizationResult: Codable, Sendable { + public let rootUserIds: [String]? + public let subOrganizationId: String + + public init( + rootUserIds: [String]? = nil, + subOrganizationId: String + ) { + self.rootUserIds = rootUserIds + self.subOrganizationId = subOrganizationId + } +} + +public struct v1CreateSubOrganizationResultV3: Codable, Sendable { + /// A list of Private Key IDs and addresses. + public let privateKeys: [v1PrivateKeyResult] + public let rootUserIds: [String]? + public let subOrganizationId: String + + public init( + privateKeys: [v1PrivateKeyResult], + rootUserIds: [String]? = nil, + subOrganizationId: String + ) { + self.privateKeys = privateKeys + self.rootUserIds = rootUserIds + self.subOrganizationId = subOrganizationId + } +} + +public struct v1CreateSubOrganizationResultV4: Codable, Sendable { + public let rootUserIds: [String]? + public let subOrganizationId: String + public let wallet: v1WalletResult? + + public init( + rootUserIds: [String]? = nil, + subOrganizationId: String, + wallet: v1WalletResult? = nil + ) { + self.rootUserIds = rootUserIds + self.subOrganizationId = subOrganizationId + self.wallet = wallet + } +} + +public struct v1CreateSubOrganizationResultV5: Codable, Sendable { + public let rootUserIds: [String]? + public let subOrganizationId: String + public let wallet: v1WalletResult? + + public init( + rootUserIds: [String]? = nil, + subOrganizationId: String, + wallet: v1WalletResult? = nil + ) { + self.rootUserIds = rootUserIds + self.subOrganizationId = subOrganizationId + self.wallet = wallet + } +} + +public struct v1CreateSubOrganizationResultV6: Codable, Sendable { + public let rootUserIds: [String]? + public let subOrganizationId: String + public let wallet: v1WalletResult? + + public init( + rootUserIds: [String]? = nil, + subOrganizationId: String, + wallet: v1WalletResult? = nil + ) { + self.rootUserIds = rootUserIds + self.subOrganizationId = subOrganizationId + self.wallet = wallet + } +} + +public struct v1CreateSubOrganizationResultV7: Codable, Sendable { + public let rootUserIds: [String]? + public let subOrganizationId: String + public let wallet: v1WalletResult? + + public init( + rootUserIds: [String]? = nil, + subOrganizationId: String, + wallet: v1WalletResult? = nil + ) { + self.rootUserIds = rootUserIds + self.subOrganizationId = subOrganizationId + self.wallet = wallet + } +} + +public struct v1CreateUserTagIntent: Codable, Sendable { + /// A list of User IDs. + public let userIds: [String] + /// Human-readable name for a User Tag. + public let userTagName: String + + public init( + userIds: [String], + userTagName: String + ) { + self.userIds = userIds + self.userTagName = userTagName + } +} + +public struct v1CreateUserTagRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateUserTagIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateUserTagIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateUserTagResult: Codable, Sendable { + /// A list of User IDs. + public let userIds: [String] + /// Unique identifier for a given User Tag. + public let userTagId: String + + public init( + userIds: [String], + userTagId: String + ) { + self.userIds = userIds + self.userTagId = userTagId + } +} + +public struct v1CreateUsersIntent: Codable, Sendable { + /// A list of Users. + public let users: [v1UserParams] + + public init( + users: [v1UserParams] + ) { + self.users = users + } +} + +public struct v1CreateUsersIntentV2: Codable, Sendable { + /// A list of Users. + public let users: [v1UserParamsV2] + + public init( + users: [v1UserParamsV2] + ) { + self.users = users + } +} + +public struct v1CreateUsersIntentV3: Codable, Sendable { + /// A list of Users. + public let users: [v1UserParamsV3] + + public init( + users: [v1UserParamsV3] + ) { + self.users = users + } +} + +public struct v1CreateUsersRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateUsersIntentV3 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateUsersIntentV3, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateUsersResult: Codable, Sendable { + /// A list of User IDs. + public let userIds: [String] + + public init( + userIds: [String] + ) { + self.userIds = userIds + } +} + +public struct v1CreateWalletAccountsIntent: Codable, Sendable { + /// A list of wallet Accounts. + public let accounts: [v1WalletAccountParams] + /// Indicates if the wallet accounts should be persisted. This is helpful if you'd like to see the addresses of different derivation paths without actually creating the accounts. Defaults to true. + public let persist: Bool? + /// Unique identifier for a given Wallet. + public let walletId: String + + public init( + accounts: [v1WalletAccountParams], + persist: Bool? = nil, + walletId: String + ) { + self.accounts = accounts + self.persist = persist + self.walletId = walletId + } +} + +public struct v1CreateWalletAccountsRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateWalletAccountsIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateWalletAccountsIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateWalletAccountsResult: Codable, Sendable { + /// A list of derived addresses. + public let addresses: [String] + + public init( + addresses: [String] + ) { + self.addresses = addresses + } +} + +public struct v1CreateWalletIntent: Codable, Sendable { + /// A list of wallet Accounts. This field, if not needed, should be an empty array in your request body. + public let accounts: [v1WalletAccountParams] + /// Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24. + public let mnemonicLength: Int? + /// Human-readable name for a Wallet. + public let walletName: String + + public init( + accounts: [v1WalletAccountParams], + mnemonicLength: Int? = nil, + walletName: String + ) { + self.accounts = accounts + self.mnemonicLength = mnemonicLength + self.walletName = walletName + } +} + +public struct v1CreateWalletRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1CreateWalletIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1CreateWalletIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1CreateWalletResult: Codable, Sendable { + /// A list of account addresses. + public let addresses: [String] + /// Unique identifier for a Wallet. + public let walletId: String + + public init( + addresses: [String], + walletId: String + ) { + self.addresses = addresses + self.walletId = walletId + } +} + +public struct v1CredPropsAuthenticationExtensionsClientOutputs: Codable, Sendable { + public let rk: Bool + + public init( + rk: Bool + ) { + self.rk = rk + } +} + +public enum v1CredentialType: String, Codable, Sendable { + case credential_type_webauthn_authenticator = "CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR" + case credential_type_api_key_p256 = "CREDENTIAL_TYPE_API_KEY_P256" + case credential_type_recover_user_key_p256 = "CREDENTIAL_TYPE_RECOVER_USER_KEY_P256" + case credential_type_api_key_secp256k1 = "CREDENTIAL_TYPE_API_KEY_SECP256K1" + case credential_type_email_auth_key_p256 = "CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256" + case credential_type_api_key_ed25519 = "CREDENTIAL_TYPE_API_KEY_ED25519" + case credential_type_otp_auth_key_p256 = "CREDENTIAL_TYPE_OTP_AUTH_KEY_P256" + case credential_type_read_write_session_key_p256 = "CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256" + case credential_type_oauth_key_p256 = "CREDENTIAL_TYPE_OAUTH_KEY_P256" + case credential_type_login = "CREDENTIAL_TYPE_LOGIN" +} + +public enum v1Curve: String, Codable, Sendable { + case curve_secp256k1 = "CURVE_SECP256K1" + case curve_ed25519 = "CURVE_ED25519" +} + +public struct v1DeleteApiKeysIntent: Codable, Sendable { + /// A list of API Key IDs. + public let apiKeyIds: [String] + /// Unique identifier for a given User. + public let userId: String + + public init( + apiKeyIds: [String], + userId: String + ) { + self.apiKeyIds = apiKeyIds + self.userId = userId + } +} + +public struct v1DeleteApiKeysRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeleteApiKeysIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeleteApiKeysIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeleteApiKeysResult: Codable, Sendable { + /// A list of API Key IDs. + public let apiKeyIds: [String] + + public init( + apiKeyIds: [String] + ) { + self.apiKeyIds = apiKeyIds + } +} + +public struct v1DeleteAuthenticatorsIntent: Codable, Sendable { + /// A list of Authenticator IDs. + public let authenticatorIds: [String] + /// Unique identifier for a given User. + public let userId: String + + public init( + authenticatorIds: [String], + userId: String + ) { + self.authenticatorIds = authenticatorIds + self.userId = userId + } +} + +public struct v1DeleteAuthenticatorsRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeleteAuthenticatorsIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeleteAuthenticatorsIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeleteAuthenticatorsResult: Codable, Sendable { + /// Unique identifier for a given Authenticator. + public let authenticatorIds: [String] + + public init( + authenticatorIds: [String] + ) { + self.authenticatorIds = authenticatorIds + } +} + +public struct v1DeleteInvitationIntent: Codable, Sendable { + /// Unique identifier for a given Invitation object. + public let invitationId: String + + public init( + invitationId: String + ) { + self.invitationId = invitationId + } +} + +public struct v1DeleteInvitationRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeleteInvitationIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeleteInvitationIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeleteInvitationResult: Codable, Sendable { + /// Unique identifier for a given Invitation. + public let invitationId: String + + public init( + invitationId: String + ) { + self.invitationId = invitationId + } +} + +public struct v1DeleteOauth2CredentialIntent: Codable, Sendable { + /// The ID of the OAuth 2.0 credential to delete + public let oauth2CredentialId: String + + public init( + oauth2CredentialId: String + ) { + self.oauth2CredentialId = oauth2CredentialId + } +} + +public struct v1DeleteOauth2CredentialRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeleteOauth2CredentialIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeleteOauth2CredentialIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeleteOauth2CredentialResult: Codable, Sendable { + /// Unique identifier of the OAuth 2.0 credential that was deleted + public let oauth2CredentialId: String + + public init( + oauth2CredentialId: String + ) { + self.oauth2CredentialId = oauth2CredentialId + } +} + +public struct v1DeleteOauthProvidersIntent: Codable, Sendable { + /// Unique identifier for a given Provider. + public let providerIds: [String] + /// The ID of the User to remove an Oauth provider from + public let userId: String + + public init( + providerIds: [String], + userId: String + ) { + self.providerIds = providerIds + self.userId = userId + } +} + +public struct v1DeleteOauthProvidersRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeleteOauthProvidersIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeleteOauthProvidersIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeleteOauthProvidersResult: Codable, Sendable { + /// A list of unique identifiers for Oauth Providers + public let providerIds: [String] + + public init( + providerIds: [String] + ) { + self.providerIds = providerIds + } +} + +public struct v1DeleteOrganizationIntent: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1DeleteOrganizationResult: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1DeletePoliciesIntent: Codable, Sendable { + /// List of unique identifiers for policies within an organization + public let policyIds: [String] + + public init( + policyIds: [String] + ) { + self.policyIds = policyIds + } +} + +public struct v1DeletePoliciesRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeletePoliciesIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeletePoliciesIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeletePoliciesResult: Codable, Sendable { + /// A list of unique identifiers for the deleted policies. + public let policyIds: [String] + + public init( + policyIds: [String] + ) { + self.policyIds = policyIds + } +} + +public struct v1DeletePolicyIntent: Codable, Sendable { + /// Unique identifier for a given Policy. + public let policyId: String + + public init( + policyId: String + ) { + self.policyId = policyId + } +} + +public struct v1DeletePolicyRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeletePolicyIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeletePolicyIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeletePolicyResult: Codable, Sendable { + /// Unique identifier for a given Policy. + public let policyId: String + + public init( + policyId: String + ) { + self.policyId = policyId + } +} + +public struct v1DeletePrivateKeyTagsIntent: Codable, Sendable { + /// A list of Private Key Tag IDs. + public let privateKeyTagIds: [String] + + public init( + privateKeyTagIds: [String] + ) { + self.privateKeyTagIds = privateKeyTagIds + } +} + +public struct v1DeletePrivateKeyTagsRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeletePrivateKeyTagsIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeletePrivateKeyTagsIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeletePrivateKeyTagsResult: Codable, Sendable { + /// A list of Private Key IDs. + public let privateKeyIds: [String] + /// A list of Private Key Tag IDs. + public let privateKeyTagIds: [String] + + public init( + privateKeyIds: [String], + privateKeyTagIds: [String] + ) { + self.privateKeyIds = privateKeyIds + self.privateKeyTagIds = privateKeyTagIds + } +} + +public struct v1DeletePrivateKeysIntent: Codable, Sendable { + /// Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored. + public let deleteWithoutExport: Bool? + /// List of unique identifiers for private keys within an organization + public let privateKeyIds: [String] + + public init( + deleteWithoutExport: Bool? = nil, + privateKeyIds: [String] + ) { + self.deleteWithoutExport = deleteWithoutExport + self.privateKeyIds = privateKeyIds + } +} + +public struct v1DeletePrivateKeysRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeletePrivateKeysIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeletePrivateKeysIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeletePrivateKeysResult: Codable, Sendable { + /// A list of private key unique identifiers that were removed + public let privateKeyIds: [String] + + public init( + privateKeyIds: [String] + ) { + self.privateKeyIds = privateKeyIds + } +} + +public struct v1DeleteSmartContractInterfaceIntent: Codable, Sendable { + /// The ID of a Smart Contract Interface intended for deletion. + public let smartContractInterfaceId: String + + public init( + smartContractInterfaceId: String + ) { + self.smartContractInterfaceId = smartContractInterfaceId + } +} + +public struct v1DeleteSmartContractInterfaceRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeleteSmartContractInterfaceIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeleteSmartContractInterfaceIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeleteSmartContractInterfaceResult: Codable, Sendable { + /// The ID of the deleted Smart Contract Interface. + public let smartContractInterfaceId: String + + public init( + smartContractInterfaceId: String + ) { + self.smartContractInterfaceId = smartContractInterfaceId + } +} + +public struct v1DeleteSubOrganizationIntent: Codable, Sendable { + /// Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false. + public let deleteWithoutExport: Bool? + + public init( + deleteWithoutExport: Bool? = nil + ) { + self.deleteWithoutExport = deleteWithoutExport + } +} + +public struct v1DeleteSubOrganizationRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeleteSubOrganizationIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeleteSubOrganizationIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeleteSubOrganizationResult: Codable, Sendable { + /// Unique identifier of the sub organization that was removed + public let subOrganizationUuid: String + + public init( + subOrganizationUuid: String + ) { + self.subOrganizationUuid = subOrganizationUuid + } +} + +public struct v1DeleteUserTagsIntent: Codable, Sendable { + /// A list of User Tag IDs. + public let userTagIds: [String] + + public init( + userTagIds: [String] + ) { + self.userTagIds = userTagIds + } +} + +public struct v1DeleteUserTagsRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeleteUserTagsIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeleteUserTagsIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeleteUserTagsResult: Codable, Sendable { + /// A list of User IDs. + public let userIds: [String] + /// A list of User Tag IDs. + public let userTagIds: [String] + + public init( + userIds: [String], + userTagIds: [String] + ) { + self.userIds = userIds + self.userTagIds = userTagIds + } +} + +public struct v1DeleteUsersIntent: Codable, Sendable { + /// A list of User IDs. + public let userIds: [String] + + public init( + userIds: [String] + ) { + self.userIds = userIds + } +} + +public struct v1DeleteUsersRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeleteUsersIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeleteUsersIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeleteUsersResult: Codable, Sendable { + /// A list of User IDs. + public let userIds: [String] + + public init( + userIds: [String] + ) { + self.userIds = userIds + } +} + +public struct v1DeleteWalletAccountsIntent: Codable, Sendable { + /// Optional parameter for deleting the wallet accounts, even if any have not been previously exported. If they have been exported, this field is ignored. + public let deleteWithoutExport: Bool? + /// List of unique identifiers for wallet accounts within an organization + public let walletAccountIds: [String] + + public init( + deleteWithoutExport: Bool? = nil, + walletAccountIds: [String] + ) { + self.deleteWithoutExport = deleteWithoutExport + self.walletAccountIds = walletAccountIds + } +} + +public struct v1DeleteWalletAccountsRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeleteWalletAccountsIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeleteWalletAccountsIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeleteWalletAccountsResult: Codable, Sendable { + /// A list of wallet account unique identifiers that were removed + public let walletAccountIds: [String] + + public init( + walletAccountIds: [String] + ) { + self.walletAccountIds = walletAccountIds + } +} + +public struct v1DeleteWalletsIntent: Codable, Sendable { + /// Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored. + public let deleteWithoutExport: Bool? + /// List of unique identifiers for wallets within an organization + public let walletIds: [String] + + public init( + deleteWithoutExport: Bool? = nil, + walletIds: [String] + ) { + self.deleteWithoutExport = deleteWithoutExport + self.walletIds = walletIds + } +} + +public struct v1DeleteWalletsRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1DeleteWalletsIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1DeleteWalletsIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1DeleteWalletsResult: Codable, Sendable { + /// A list of wallet unique identifiers that were removed + public let walletIds: [String] + + public init( + walletIds: [String] + ) { + self.walletIds = walletIds + } +} + +public struct v1DisableAuthProxyIntent: Codable, Sendable { + public init() {} +} + +public struct v1DisableAuthProxyResult: Codable, Sendable { + public init() {} +} + +public struct v1DisablePrivateKeyIntent: Codable, Sendable { + /// Unique identifier for a given Private Key. + public let privateKeyId: String + + public init( + privateKeyId: String + ) { + self.privateKeyId = privateKeyId + } +} + +public struct v1DisablePrivateKeyResult: Codable, Sendable { + /// Unique identifier for a given Private Key. + public let privateKeyId: String + + public init( + privateKeyId: String + ) { + self.privateKeyId = privateKeyId + } +} + +public enum v1Effect: String, Codable, Sendable { + case effect_allow = "EFFECT_ALLOW" + case effect_deny = "EFFECT_DENY" +} + +public struct v1EmailAuthIntent: Codable, Sendable { + /// Optional human-readable name for an API Key. If none provided, default to Email Auth - + public let apiKeyName: String? + /// Email of the authenticating user. + public let email: String + /// Optional parameters for customizing emails. If not provided, the default email will be used. + public let emailCustomization: v1EmailCustomizationParams? + /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated Email Auth API keys + public let invalidateExisting: Bool? + /// Optional custom email address to use as reply-to + public let replyToEmailAddress: String? + /// Optional custom email address from which to send the email + public let sendFromEmailAddress: String? + /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + public let sendFromEmailSenderName: String? + /// Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted. + public let targetPublicKey: String + + public init( + apiKeyName: String? = nil, + email: String, + emailCustomization: v1EmailCustomizationParams? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + replyToEmailAddress: String? = nil, + sendFromEmailAddress: String? = nil, + sendFromEmailSenderName: String? = nil, + targetPublicKey: String + ) { + self.apiKeyName = apiKeyName + self.email = email + self.emailCustomization = emailCustomization + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.replyToEmailAddress = replyToEmailAddress + self.sendFromEmailAddress = sendFromEmailAddress + self.sendFromEmailSenderName = sendFromEmailSenderName + self.targetPublicKey = targetPublicKey + } +} + +public struct v1EmailAuthIntentV2: Codable, Sendable { + /// Optional human-readable name for an API Key. If none provided, default to Email Auth - + public let apiKeyName: String? + /// Email of the authenticating user. + public let email: String + /// Optional parameters for customizing emails. If not provided, the default email will be used. + public let emailCustomization: v1EmailCustomizationParams? + /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated Email Auth API keys + public let invalidateExisting: Bool? + /// Optional custom email address to use as reply-to + public let replyToEmailAddress: String? + /// Optional custom email address from which to send the email + public let sendFromEmailAddress: String? + /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + public let sendFromEmailSenderName: String? + /// Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted. + public let targetPublicKey: String + + public init( + apiKeyName: String? = nil, + email: String, + emailCustomization: v1EmailCustomizationParams? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + replyToEmailAddress: String? = nil, + sendFromEmailAddress: String? = nil, + sendFromEmailSenderName: String? = nil, + targetPublicKey: String + ) { + self.apiKeyName = apiKeyName + self.email = email + self.emailCustomization = emailCustomization + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.replyToEmailAddress = replyToEmailAddress + self.sendFromEmailAddress = sendFromEmailAddress + self.sendFromEmailSenderName = sendFromEmailSenderName + self.targetPublicKey = targetPublicKey + } +} + +public struct v1EmailAuthRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1EmailAuthIntentV2 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1EmailAuthIntentV2, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1EmailAuthResult: Codable, Sendable { + /// Unique identifier for the created API key. + public let apiKeyId: String + /// Unique identifier for the authenticating User. + public let userId: String + + public init( + apiKeyId: String, + userId: String + ) { + self.apiKeyId = apiKeyId + self.userId = userId + } +} + +public struct v1EmailCustomizationParams: Codable, Sendable { + /// The name of the application. + public let appName: String? + /// A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px. + public let logoUrl: String? + /// A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`. + public let magicLinkTemplate: String? + /// Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template. + public let templateId: String? + /// JSON object containing key/value pairs to be used with custom templates. + public let templateVariables: String? + + public init( + appName: String? = nil, + logoUrl: String? = nil, + magicLinkTemplate: String? = nil, + templateId: String? = nil, + templateVariables: String? = nil + ) { + self.appName = appName + self.logoUrl = logoUrl + self.magicLinkTemplate = magicLinkTemplate + self.templateId = templateId + self.templateVariables = templateVariables + } +} + +public struct v1EnableAuthProxyIntent: Codable, Sendable { + public init() {} +} + +public struct v1EnableAuthProxyResult: Codable, Sendable { + /// A User ID with permission to initiate authentication. + public let userId: String + + public init( + userId: String + ) { + self.userId = userId + } +} + +public struct v1ExportPrivateKeyIntent: Codable, Sendable { + /// Unique identifier for a given Private Key. + public let privateKeyId: String + /// Client-side public key generated by the user, to which the export bundle will be encrypted. + public let targetPublicKey: String + + public init( + privateKeyId: String, + targetPublicKey: String + ) { + self.privateKeyId = privateKeyId + self.targetPublicKey = targetPublicKey + } +} + +public struct v1ExportPrivateKeyRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1ExportPrivateKeyIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1ExportPrivateKeyIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1ExportPrivateKeyResult: Codable, Sendable { + /// Export bundle containing a private key encrypted to the client's target public key. + public let exportBundle: String + /// Unique identifier for a given Private Key. + public let privateKeyId: String + + public init( + exportBundle: String, + privateKeyId: String + ) { + self.exportBundle = exportBundle + self.privateKeyId = privateKeyId + } +} + +public struct v1ExportWalletAccountIntent: Codable, Sendable { + /// Address to identify Wallet Account. + public let address: String + /// Client-side public key generated by the user, to which the export bundle will be encrypted. + public let targetPublicKey: String + + public init( + address: String, + targetPublicKey: String + ) { + self.address = address + self.targetPublicKey = targetPublicKey + } +} + +public struct v1ExportWalletAccountRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1ExportWalletAccountIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1ExportWalletAccountIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1ExportWalletAccountResult: Codable, Sendable { + /// Address to identify Wallet Account. + public let address: String + /// Export bundle containing a private key encrypted by the client's target public key. + public let exportBundle: String + + public init( + address: String, + exportBundle: String + ) { + self.address = address + self.exportBundle = exportBundle + } +} + +public struct v1ExportWalletIntent: Codable, Sendable { + /// The language of the mnemonic to export. Defaults to English. + public let language: v1MnemonicLanguage? + /// Client-side public key generated by the user, to which the export bundle will be encrypted. + public let targetPublicKey: String + /// Unique identifier for a given Wallet. + public let walletId: String + + public init( + language: v1MnemonicLanguage? = nil, + targetPublicKey: String, + walletId: String + ) { + self.language = language + self.targetPublicKey = targetPublicKey + self.walletId = walletId + } +} + +public struct v1ExportWalletRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1ExportWalletIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1ExportWalletIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1ExportWalletResult: Codable, Sendable { + /// Export bundle containing a wallet mnemonic + optional newline passphrase encrypted by the client's target public key. + public let exportBundle: String + /// Unique identifier for a given Wallet. + public let walletId: String + + public init( + exportBundle: String, + walletId: String + ) { + self.exportBundle = exportBundle + self.walletId = walletId + } +} + +public struct v1Feature: Codable, Sendable { + public let name: v1FeatureName? + public let value: String? + + public init( + name: v1FeatureName? = nil, + value: String? = nil + ) { + self.name = name + self.value = value + } +} + +public enum v1FeatureName: String, Codable, Sendable { + case feature_name_root_user_email_recovery = "FEATURE_NAME_ROOT_USER_EMAIL_RECOVERY" + case feature_name_webauthn_origins = "FEATURE_NAME_WEBAUTHN_ORIGINS" + case feature_name_email_auth = "FEATURE_NAME_EMAIL_AUTH" + case feature_name_email_recovery = "FEATURE_NAME_EMAIL_RECOVERY" + case feature_name_webhook = "FEATURE_NAME_WEBHOOK" + case feature_name_sms_auth = "FEATURE_NAME_SMS_AUTH" + case feature_name_otp_email_auth = "FEATURE_NAME_OTP_EMAIL_AUTH" + case feature_name_auth_proxy = "FEATURE_NAME_AUTH_PROXY" +} + +public enum v1FiatOnRampBlockchainNetwork: String, Codable, Sendable { + case fiat_on_ramp_blockchain_network_bitcoin = "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BITCOIN" + case fiat_on_ramp_blockchain_network_ethereum = "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_ETHEREUM" + case fiat_on_ramp_blockchain_network_solana = "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_SOLANA" + case fiat_on_ramp_blockchain_network_base = "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BASE" +} + +public enum v1FiatOnRampCryptoCurrency: String, Codable, Sendable { + case fiat_on_ramp_crypto_currency_btc = "FIAT_ON_RAMP_CRYPTO_CURRENCY_BTC" + case fiat_on_ramp_crypto_currency_eth = "FIAT_ON_RAMP_CRYPTO_CURRENCY_ETH" + case fiat_on_ramp_crypto_currency_sol = "FIAT_ON_RAMP_CRYPTO_CURRENCY_SOL" + case fiat_on_ramp_crypto_currency_usdc = "FIAT_ON_RAMP_CRYPTO_CURRENCY_USDC" +} + +public enum v1FiatOnRampCurrency: String, Codable, Sendable { + case fiat_on_ramp_currency_aud = "FIAT_ON_RAMP_CURRENCY_AUD" + case fiat_on_ramp_currency_bgn = "FIAT_ON_RAMP_CURRENCY_BGN" + case fiat_on_ramp_currency_brl = "FIAT_ON_RAMP_CURRENCY_BRL" + case fiat_on_ramp_currency_cad = "FIAT_ON_RAMP_CURRENCY_CAD" + case fiat_on_ramp_currency_chf = "FIAT_ON_RAMP_CURRENCY_CHF" + case fiat_on_ramp_currency_cop = "FIAT_ON_RAMP_CURRENCY_COP" + case fiat_on_ramp_currency_czk = "FIAT_ON_RAMP_CURRENCY_CZK" + case fiat_on_ramp_currency_dkk = "FIAT_ON_RAMP_CURRENCY_DKK" + case fiat_on_ramp_currency_dop = "FIAT_ON_RAMP_CURRENCY_DOP" + case fiat_on_ramp_currency_egp = "FIAT_ON_RAMP_CURRENCY_EGP" + case fiat_on_ramp_currency_eur = "FIAT_ON_RAMP_CURRENCY_EUR" + case fiat_on_ramp_currency_gbp = "FIAT_ON_RAMP_CURRENCY_GBP" + case fiat_on_ramp_currency_hkd = "FIAT_ON_RAMP_CURRENCY_HKD" + case fiat_on_ramp_currency_idr = "FIAT_ON_RAMP_CURRENCY_IDR" + case fiat_on_ramp_currency_ils = "FIAT_ON_RAMP_CURRENCY_ILS" + case fiat_on_ramp_currency_jod = "FIAT_ON_RAMP_CURRENCY_JOD" + case fiat_on_ramp_currency_kes = "FIAT_ON_RAMP_CURRENCY_KES" + case fiat_on_ramp_currency_kwd = "FIAT_ON_RAMP_CURRENCY_KWD" + case fiat_on_ramp_currency_lkr = "FIAT_ON_RAMP_CURRENCY_LKR" + case fiat_on_ramp_currency_mxn = "FIAT_ON_RAMP_CURRENCY_MXN" + case fiat_on_ramp_currency_ngn = "FIAT_ON_RAMP_CURRENCY_NGN" + case fiat_on_ramp_currency_nok = "FIAT_ON_RAMP_CURRENCY_NOK" + case fiat_on_ramp_currency_nzd = "FIAT_ON_RAMP_CURRENCY_NZD" + case fiat_on_ramp_currency_omr = "FIAT_ON_RAMP_CURRENCY_OMR" + case fiat_on_ramp_currency_pen = "FIAT_ON_RAMP_CURRENCY_PEN" + case fiat_on_ramp_currency_pln = "FIAT_ON_RAMP_CURRENCY_PLN" + case fiat_on_ramp_currency_ron = "FIAT_ON_RAMP_CURRENCY_RON" + case fiat_on_ramp_currency_sek = "FIAT_ON_RAMP_CURRENCY_SEK" + case fiat_on_ramp_currency_thb = "FIAT_ON_RAMP_CURRENCY_THB" + case fiat_on_ramp_currency_try = "FIAT_ON_RAMP_CURRENCY_TRY" + case fiat_on_ramp_currency_twd = "FIAT_ON_RAMP_CURRENCY_TWD" + case fiat_on_ramp_currency_usd = "FIAT_ON_RAMP_CURRENCY_USD" + case fiat_on_ramp_currency_vnd = "FIAT_ON_RAMP_CURRENCY_VND" + case fiat_on_ramp_currency_zar = "FIAT_ON_RAMP_CURRENCY_ZAR" +} + +public enum v1FiatOnRampPaymentMethod: String, Codable, Sendable { + case fiat_on_ramp_payment_method_credit_debit_card = + "FIAT_ON_RAMP_PAYMENT_METHOD_CREDIT_DEBIT_CARD" + case fiat_on_ramp_payment_method_apple_pay = "FIAT_ON_RAMP_PAYMENT_METHOD_APPLE_PAY" + case fiat_on_ramp_payment_method_gbp_bank_transfer = + "FIAT_ON_RAMP_PAYMENT_METHOD_GBP_BANK_TRANSFER" + case fiat_on_ramp_payment_method_gbp_open_banking_payment = + "FIAT_ON_RAMP_PAYMENT_METHOD_GBP_OPEN_BANKING_PAYMENT" + case fiat_on_ramp_payment_method_google_pay = "FIAT_ON_RAMP_PAYMENT_METHOD_GOOGLE_PAY" + case fiat_on_ramp_payment_method_sepa_bank_transfer = + "FIAT_ON_RAMP_PAYMENT_METHOD_SEPA_BANK_TRANSFER" + case fiat_on_ramp_payment_method_pix_instant_payment = + "FIAT_ON_RAMP_PAYMENT_METHOD_PIX_INSTANT_PAYMENT" + case fiat_on_ramp_payment_method_paypal = "FIAT_ON_RAMP_PAYMENT_METHOD_PAYPAL" + case fiat_on_ramp_payment_method_venmo = "FIAT_ON_RAMP_PAYMENT_METHOD_VENMO" + case fiat_on_ramp_payment_method_moonpay_balance = "FIAT_ON_RAMP_PAYMENT_METHOD_MOONPAY_BALANCE" + case fiat_on_ramp_payment_method_crypto_account = "FIAT_ON_RAMP_PAYMENT_METHOD_CRYPTO_ACCOUNT" + case fiat_on_ramp_payment_method_fiat_wallet = "FIAT_ON_RAMP_PAYMENT_METHOD_FIAT_WALLET" + case fiat_on_ramp_payment_method_ach_bank_account = "FIAT_ON_RAMP_PAYMENT_METHOD_ACH_BANK_ACCOUNT" +} + +public enum v1FiatOnRampProvider: String, Codable, Sendable { + case fiat_on_ramp_provider_coinbase = "FIAT_ON_RAMP_PROVIDER_COINBASE" + case fiat_on_ramp_provider_moonpay = "FIAT_ON_RAMP_PROVIDER_MOONPAY" +} + +public struct v1GetActivitiesRequest: Codable, Sendable { + /// Array of activity statuses filtering which activities will be listed in the response. + public let filterByStatus: [v1ActivityStatus]? + /// Array of activity types filtering which activities will be listed in the response. + public let filterByType: [v1ActivityType]? + /// Unique identifier for a given organization. + public let organizationId: String + /// Parameters used for cursor-based pagination. + public let paginationOptions: v1Pagination? + + public init( + filterByStatus: [v1ActivityStatus]? = nil, + filterByType: [v1ActivityType]? = nil, + organizationId: String, + paginationOptions: v1Pagination? = nil + ) { + self.filterByStatus = filterByStatus + self.filterByType = filterByType + self.organizationId = organizationId + self.paginationOptions = paginationOptions + } +} + +public struct v1GetActivitiesResponse: Codable, Sendable { + /// A list of activities. + public let activities: [v1Activity] + + public init( + activities: [v1Activity] + ) { + self.activities = activities + } +} + +public struct v1GetActivityRequest: Codable, Sendable { + /// Unique identifier for a given activity object. + public let activityId: String + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + activityId: String, + organizationId: String + ) { + self.activityId = activityId + self.organizationId = organizationId + } +} + +public struct v1GetApiKeyRequest: Codable, Sendable { + /// Unique identifier for a given API key. + public let apiKeyId: String + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + apiKeyId: String, + organizationId: String + ) { + self.apiKeyId = apiKeyId + self.organizationId = organizationId + } +} + +public struct v1GetApiKeyResponse: Codable, Sendable { + /// An API key. + public let apiKey: v1ApiKey + + public init( + apiKey: v1ApiKey + ) { + self.apiKey = apiKey + } +} + +public struct v1GetApiKeysRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + /// Unique identifier for a given user. + public let userId: String? + + public init( + organizationId: String, + userId: String? = nil + ) { + self.organizationId = organizationId + self.userId = userId + } +} + +public struct v1GetApiKeysResponse: Codable, Sendable { + /// A list of API keys. + public let apiKeys: [v1ApiKey] + + public init( + apiKeys: [v1ApiKey] + ) { + self.apiKeys = apiKeys + } +} + +public struct v1GetAppProofsRequest: Codable, Sendable { + /// Unique identifier for a given activity. + public let activityId: String + /// Unique identifier for a given Organization. + public let organizationId: String + + public init( + activityId: String, + organizationId: String + ) { + self.activityId = activityId + self.organizationId = organizationId + } +} + +public struct v1GetAppProofsResponse: Codable, Sendable { + public let appProofs: [v1AppProof] + + public init( + appProofs: [v1AppProof] + ) { + self.appProofs = appProofs + } +} + +public struct v1GetAttestationDocumentRequest: Codable, Sendable { + /// The enclave type, one of: ump, notarizer, signer, evm-parser. + public let enclaveType: String + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + enclaveType: String, + organizationId: String + ) { + self.enclaveType = enclaveType + self.organizationId = organizationId + } +} + +public struct v1GetAttestationDocumentResponse: Codable, Sendable { + /// Raw (CBOR-encoded) attestation document. + public let attestationDocument: String + + public init( + attestationDocument: String + ) { + self.attestationDocument = attestationDocument + } +} + +public struct v1GetAuthenticatorRequest: Codable, Sendable { + /// Unique identifier for a given authenticator. + public let authenticatorId: String + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + authenticatorId: String, + organizationId: String + ) { + self.authenticatorId = authenticatorId + self.organizationId = organizationId + } +} + +public struct v1GetAuthenticatorResponse: Codable, Sendable { + /// An authenticator. + public let authenticator: v1Authenticator + + public init( + authenticator: v1Authenticator + ) { + self.authenticator = authenticator + } +} + +public struct v1GetAuthenticatorsRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + /// Unique identifier for a given user. + public let userId: String + + public init( + organizationId: String, + userId: String + ) { + self.organizationId = organizationId + self.userId = userId + } +} + +public struct v1GetAuthenticatorsResponse: Codable, Sendable { + /// A list of authenticators. + public let authenticators: [v1Authenticator] + + public init( + authenticators: [v1Authenticator] + ) { + self.authenticators = authenticators + } +} + +public struct v1GetBootProofRequest: Codable, Sendable { + /// Hex encoded ephemeral public key. + public let ephemeralKey: String + /// Unique identifier for a given Organization. + public let organizationId: String + + public init( + ephemeralKey: String, + organizationId: String + ) { + self.ephemeralKey = ephemeralKey + self.organizationId = organizationId + } +} + +public struct v1GetLatestBootProofRequest: Codable, Sendable { + /// Name of enclave app. + public let appName: String + /// Unique identifier for a given Organization. + public let organizationId: String + + public init( + appName: String, + organizationId: String + ) { + self.appName = appName + self.organizationId = organizationId + } +} + +public struct v1GetOauth2CredentialRequest: Codable, Sendable { + /// Unique identifier for a given OAuth 2.0 Credential. + public let oauth2CredentialId: String + /// Unique identifier for a given Organization. + public let organizationId: String + + public init( + oauth2CredentialId: String, + organizationId: String + ) { + self.oauth2CredentialId = oauth2CredentialId + self.organizationId = organizationId + } +} + +public struct v1GetOauth2CredentialResponse: Codable, Sendable { + public let oauth2Credential: v1Oauth2Credential + + public init( + oauth2Credential: v1Oauth2Credential + ) { + self.oauth2Credential = oauth2Credential + } +} + +public struct v1GetOauthProvidersRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + /// Unique identifier for a given user. + public let userId: String? + + public init( + organizationId: String, + userId: String? = nil + ) { + self.organizationId = organizationId + self.userId = userId + } +} + +public struct v1GetOauthProvidersResponse: Codable, Sendable { + /// A list of Oauth providers. + public let oauthProviders: [v1OauthProvider] + + public init( + oauthProviders: [v1OauthProvider] + ) { + self.oauthProviders = oauthProviders + } +} + +public struct v1GetOrganizationConfigsRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1GetOrganizationConfigsResponse: Codable, Sendable { + /// Organization configs including quorum settings and organization features. + public let configs: v1Config + + public init( + configs: v1Config + ) { + self.configs = configs + } +} + +public struct v1GetOrganizationRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1GetOrganizationResponse: Codable, Sendable { + /// Object representing the full current and deleted / disabled collection of users, policies, private keys, and invitations attributable to a particular organization. + public let organizationData: v1OrganizationData + + public init( + organizationData: v1OrganizationData + ) { + self.organizationData = organizationData + } +} + +public struct v1GetPoliciesRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1GetPoliciesResponse: Codable, Sendable { + /// A list of policies. + public let policies: [v1Policy] + + public init( + policies: [v1Policy] + ) { + self.policies = policies + } +} + +public struct v1GetPolicyEvaluationsRequest: Codable, Sendable { + /// Unique identifier for a given activity. + public let activityId: String + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + activityId: String, + organizationId: String + ) { + self.activityId = activityId + self.organizationId = organizationId + } +} + +public struct v1GetPolicyEvaluationsResponse: Codable, Sendable { + public let policyEvaluations: [externalactivityv1PolicyEvaluation] + + public init( + policyEvaluations: [externalactivityv1PolicyEvaluation] + ) { + self.policyEvaluations = policyEvaluations + } +} + +public struct v1GetPolicyRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + /// Unique identifier for a given policy. + public let policyId: String + + public init( + organizationId: String, + policyId: String + ) { + self.organizationId = organizationId + self.policyId = policyId + } +} + +public struct v1GetPolicyResponse: Codable, Sendable { + /// Object that codifies rules defining the actions that are permissible within an organization. + public let policy: v1Policy + + public init( + policy: v1Policy + ) { + self.policy = policy + } +} + +public struct v1GetPrivateKeyRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + /// Unique identifier for a given private key. + public let privateKeyId: String + + public init( + organizationId: String, + privateKeyId: String + ) { + self.organizationId = organizationId + self.privateKeyId = privateKeyId + } +} + +public struct v1GetPrivateKeyResponse: Codable, Sendable { + /// Cryptographic public/private key pair that can be used for cryptocurrency needs or more generalized encryption. + public let privateKey: v1PrivateKey + + public init( + privateKey: v1PrivateKey + ) { + self.privateKey = privateKey + } +} + +public struct v1GetPrivateKeysRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1GetPrivateKeysResponse: Codable, Sendable { + /// A list of private keys. + public let privateKeys: [v1PrivateKey] + + public init( + privateKeys: [v1PrivateKey] + ) { + self.privateKeys = privateKeys + } +} + +public struct v1GetSmartContractInterfaceRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + /// Unique identifier for a given smart contract interface. + public let smartContractInterfaceId: String + + public init( + organizationId: String, + smartContractInterfaceId: String + ) { + self.organizationId = organizationId + self.smartContractInterfaceId = smartContractInterfaceId + } +} + +public struct v1GetSmartContractInterfaceResponse: Codable, Sendable { + /// Object to be used in conjunction with policies to guard transaction signing. + public let smartContractInterface: v1SmartContractInterface + + public init( + smartContractInterface: v1SmartContractInterface + ) { + self.smartContractInterface = smartContractInterface + } +} + +public struct v1GetSmartContractInterfacesRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1GetSmartContractInterfacesResponse: Codable, Sendable { + /// A list of smart contract interfaces. + public let smartContractInterfaces: [v1SmartContractInterface] + + public init( + smartContractInterfaces: [v1SmartContractInterface] + ) { + self.smartContractInterfaces = smartContractInterfaces + } +} + +public struct v1GetSubOrgIdsRequest: Codable, Sendable { + /// Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN', 'WALLET_ACCOUNT_ADDRESS' or 'PUBLIC_KEY' + public let filterType: String? + /// The value of the filter to apply for the specified type. For example, a specific email or name string. + public let filterValue: String? + /// Unique identifier for the parent organization. This is used to find sub-organizations within it. + public let organizationId: String + /// Parameters used for cursor-based pagination. + public let paginationOptions: v1Pagination? + + public init( + filterType: String? = nil, + filterValue: String? = nil, + organizationId: String, + paginationOptions: v1Pagination? = nil + ) { + self.filterType = filterType + self.filterValue = filterValue + self.organizationId = organizationId + self.paginationOptions = paginationOptions + } +} + +public struct v1GetSubOrgIdsResponse: Codable, Sendable { + /// List of unique identifiers for the matching sub-organizations. + public let organizationIds: [String] + + public init( + organizationIds: [String] + ) { + self.organizationIds = organizationIds + } +} + +public struct v1GetUserRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + /// Unique identifier for a given user. + public let userId: String + + public init( + organizationId: String, + userId: String + ) { + self.organizationId = organizationId + self.userId = userId + } +} + +public struct v1GetUserResponse: Codable, Sendable { + /// Web and/or API user within your organization. + public let user: v1User + + public init( + user: v1User + ) { + self.user = user + } +} + +public struct v1GetUsersRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1GetUsersResponse: Codable, Sendable { + /// A list of users. + public let users: [v1User] + + public init( + users: [v1User] + ) { + self.users = users + } +} + +public struct v1GetVerifiedSubOrgIdsRequest: Codable, Sendable { + /// Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'. + public let filterType: String? + /// The value of the filter to apply for the specified type. For example, a specific email or phone number string. + public let filterValue: String? + /// Unique identifier for the parent organization. This is used to find sub-organizations within it. + public let organizationId: String + /// Parameters used for cursor-based pagination. + public let paginationOptions: v1Pagination? + + public init( + filterType: String? = nil, + filterValue: String? = nil, + organizationId: String, + paginationOptions: v1Pagination? = nil + ) { + self.filterType = filterType + self.filterValue = filterValue + self.organizationId = organizationId + self.paginationOptions = paginationOptions + } +} + +public struct v1GetVerifiedSubOrgIdsResponse: Codable, Sendable { + /// List of unique identifiers for the matching sub-organizations. + public let organizationIds: [String] + + public init( + organizationIds: [String] + ) { + self.organizationIds = organizationIds + } +} + +public struct v1GetWalletAccountRequest: Codable, Sendable { + /// Address corresponding to a wallet account. + public let address: String? + /// Unique identifier for a given organization. + public let organizationId: String + /// Path corresponding to a wallet account. + public let path: String? + /// Unique identifier for a given wallet. + public let walletId: String + + public init( + address: String? = nil, + organizationId: String, + path: String? = nil, + walletId: String + ) { + self.address = address + self.organizationId = organizationId + self.path = path + self.walletId = walletId + } +} + +public struct v1GetWalletAccountResponse: Codable, Sendable { + /// The resulting wallet account. + public let account: v1WalletAccount + + public init( + account: v1WalletAccount + ) { + self.account = account + } +} + +public struct v1GetWalletAccountsRequest: Codable, Sendable { + /// Optional flag to specify if the wallet details should be included in the response. Default = false. + public let includeWalletDetails: Bool? + /// Unique identifier for a given organization. + public let organizationId: String + /// Parameters used for cursor-based pagination. + public let paginationOptions: v1Pagination? + /// Unique identifier for a given wallet. If not provided, all accounts for the organization will be returned. + public let walletId: String? + + public init( + includeWalletDetails: Bool? = nil, + organizationId: String, + paginationOptions: v1Pagination? = nil, + walletId: String? = nil + ) { + self.includeWalletDetails = includeWalletDetails + self.organizationId = organizationId + self.paginationOptions = paginationOptions + self.walletId = walletId + } +} + +public struct v1GetWalletAccountsResponse: Codable, Sendable { + /// A list of accounts generated from a wallet that share a common seed. + public let accounts: [v1WalletAccount] + + public init( + accounts: [v1WalletAccount] + ) { + self.accounts = accounts + } +} + +public struct v1GetWalletRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + /// Unique identifier for a given wallet. + public let walletId: String + + public init( + organizationId: String, + walletId: String + ) { + self.organizationId = organizationId + self.walletId = walletId + } +} + +public struct v1GetWalletResponse: Codable, Sendable { + /// A collection of deterministically generated cryptographic public / private key pairs that share a common seed. + public let wallet: v1Wallet + + public init( + wallet: v1Wallet + ) { + self.wallet = wallet + } +} + +public struct v1GetWalletsRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1GetWalletsResponse: Codable, Sendable { + /// A list of wallets. + public let wallets: [v1Wallet] + + public init( + wallets: [v1Wallet] + ) { + self.wallets = wallets + } +} + +public struct v1GetWhoamiRequest: Codable, Sendable { + /// Unique identifier for a given organization. If the request is being made by a WebAuthN user and their sub-organization ID is unknown, this can be the parent organization ID; using the sub-organization ID when possible is preferred due to performance reasons. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1GetWhoamiResponse: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + /// Human-readable name for an organization. + public let organizationName: String + /// Unique identifier for a given user. + public let userId: String + /// Human-readable name for a user. + public let username: String + + public init( + organizationId: String, + organizationName: String, + userId: String, + username: String + ) { + self.organizationId = organizationId + self.organizationName = organizationName + self.userId = userId + self.username = username + } +} + +public enum v1HashFunction: String, Codable, Sendable { + case hash_function_no_op = "HASH_FUNCTION_NO_OP" + case hash_function_sha256 = "HASH_FUNCTION_SHA256" + case hash_function_keccak256 = "HASH_FUNCTION_KECCAK256" + case hash_function_not_applicable = "HASH_FUNCTION_NOT_APPLICABLE" +} + +public struct v1ImportPrivateKeyIntent: Codable, Sendable { + /// Cryptocurrency-specific formats for a derived address (e.g., Ethereum). + public let addressFormats: [v1AddressFormat] + /// Cryptographic Curve used to generate a given Private Key. + public let curve: v1Curve + /// Bundle containing a raw private key encrypted to the enclave's target public key. + public let encryptedBundle: String + /// Human-readable name for a Private Key. + public let privateKeyName: String + /// The ID of the User importing a Private Key. + public let userId: String + + public init( + addressFormats: [v1AddressFormat], + curve: v1Curve, + encryptedBundle: String, + privateKeyName: String, + userId: String + ) { + self.addressFormats = addressFormats + self.curve = curve + self.encryptedBundle = encryptedBundle + self.privateKeyName = privateKeyName + self.userId = userId + } +} + +public struct v1ImportPrivateKeyRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1ImportPrivateKeyIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1ImportPrivateKeyIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1ImportPrivateKeyResult: Codable, Sendable { + /// A list of addresses. + public let addresses: [immutableactivityv1Address] + /// Unique identifier for a Private Key. + public let privateKeyId: String + + public init( + addresses: [immutableactivityv1Address], + privateKeyId: String + ) { + self.addresses = addresses + self.privateKeyId = privateKeyId + } +} + +public struct v1ImportWalletIntent: Codable, Sendable { + /// A list of wallet Accounts. + public let accounts: [v1WalletAccountParams] + /// Bundle containing a wallet mnemonic encrypted to the enclave's target public key. + public let encryptedBundle: String + /// The ID of the User importing a Wallet. + public let userId: String + /// Human-readable name for a Wallet. + public let walletName: String + + public init( + accounts: [v1WalletAccountParams], + encryptedBundle: String, + userId: String, + walletName: String + ) { + self.accounts = accounts + self.encryptedBundle = encryptedBundle + self.userId = userId + self.walletName = walletName + } +} + +public struct v1ImportWalletRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1ImportWalletIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1ImportWalletIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1ImportWalletResult: Codable, Sendable { + /// A list of account addresses. + public let addresses: [String] + /// Unique identifier for a Wallet. + public let walletId: String + + public init( + addresses: [String], + walletId: String + ) { + self.addresses = addresses + self.walletId = walletId + } +} + +public struct v1InitFiatOnRampIntent: Codable, Sendable { + /// ISO 3166-1 two-digit country code for Coinbase representing the purchasing user’s country of residence, e.g., US, GB. + public let countryCode: String? + /// ISO 3166-2 two-digit country subdivision code for Coinbase representing the purchasing user’s subdivision of residence within their country, e.g. NY. Required if country_code=US. + public let countrySubdivisionCode: String? + /// Code for the cryptocurrency to be purchased, e.g., btc, eth. Maps to MoonPay's currencyCode or Coinbase's defaultAsset. + public let cryptoCurrencyCode: v1FiatOnRampCryptoCurrency + /// Specifies a preset fiat amount for the transaction, e.g., '100'. Must be greater than '20'. If not provided, the user will be prompted to enter an amount. + public let fiatCurrencyAmount: String? + /// Code for the fiat currency to be used in the transaction, e.g., USD, EUR. + public let fiatCurrencyCode: v1FiatOnRampCurrency? + /// Blockchain network to be used for the transaction, e.g., bitcoin, ethereum. Maps to MoonPay's network or Coinbase's defaultNetwork. + public let network: v1FiatOnRampBlockchainNetwork + /// Enum to specifiy which on-ramp provider to use + public let onrampProvider: v1FiatOnRampProvider + /// Pre-selected payment method, e.g., CREDIT_DEBIT_CARD, APPLE_PAY. Validated against the chosen provider. + public let paymentMethod: v1FiatOnRampPaymentMethod? + /// Optional flag to indicate whether to use the sandbox mode to simulate transactions for the on-ramp provider. Default is false. + public let sandboxMode: Bool? + /// Optional MoonPay Widget URL to sign when using MoonPay client SDKs with URL Signing enabled. + public let urlForSignature: String? + /// Destination wallet address for the buy transaction. + public let walletAddress: String + + public init( + countryCode: String? = nil, + countrySubdivisionCode: String? = nil, + cryptoCurrencyCode: v1FiatOnRampCryptoCurrency, + fiatCurrencyAmount: String? = nil, + fiatCurrencyCode: v1FiatOnRampCurrency? = nil, + network: v1FiatOnRampBlockchainNetwork, + onrampProvider: v1FiatOnRampProvider, + paymentMethod: v1FiatOnRampPaymentMethod? = nil, + sandboxMode: Bool? = nil, + urlForSignature: String? = nil, + walletAddress: String + ) { + self.countryCode = countryCode + self.countrySubdivisionCode = countrySubdivisionCode + self.cryptoCurrencyCode = cryptoCurrencyCode + self.fiatCurrencyAmount = fiatCurrencyAmount + self.fiatCurrencyCode = fiatCurrencyCode + self.network = network + self.onrampProvider = onrampProvider + self.paymentMethod = paymentMethod + self.sandboxMode = sandboxMode + self.urlForSignature = urlForSignature + self.walletAddress = walletAddress + } +} + +public struct v1InitFiatOnRampRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1InitFiatOnRampIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1InitFiatOnRampIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1InitFiatOnRampResult: Codable, Sendable { + /// Unique identifier used to retrieve transaction statuses for a given fiat on-ramp flow. + public let onRampTransactionId: String + /// Unique URL for a given fiat on-ramp flow. + public let onRampUrl: String + /// Optional signature of the MoonPay Widget URL. The signature is generated if the Init Fiat On Ramp intent includes the urlForSignature field. The signature can be used to initialize the MoonPay SDKs when URL signing is enabled for your project. + public let onRampUrlSignature: String? + + public init( + onRampTransactionId: String, + onRampUrl: String, + onRampUrlSignature: String? = nil + ) { + self.onRampTransactionId = onRampTransactionId + self.onRampUrl = onRampUrl + self.onRampUrlSignature = onRampUrlSignature + } +} + +public struct v1InitImportPrivateKeyIntent: Codable, Sendable { + /// The ID of the User importing a Private Key. + public let userId: String + + public init( + userId: String + ) { + self.userId = userId + } +} + +public struct v1InitImportPrivateKeyRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1InitImportPrivateKeyIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1InitImportPrivateKeyIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1InitImportPrivateKeyResult: Codable, Sendable { + /// Import bundle containing a public key and signature to use for importing client data. + public let importBundle: String + + public init( + importBundle: String + ) { + self.importBundle = importBundle + } +} + +public struct v1InitImportWalletIntent: Codable, Sendable { + /// The ID of the User importing a Wallet. + public let userId: String + + public init( + userId: String + ) { + self.userId = userId + } +} + +public struct v1InitImportWalletRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1InitImportWalletIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1InitImportWalletIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1InitImportWalletResult: Codable, Sendable { + /// Import bundle containing a public key and signature to use for importing client data. + public let importBundle: String + + public init( + importBundle: String + ) { + self.importBundle = importBundle + } +} + +public struct v1InitOtpAuthIntent: Codable, Sendable { + /// Email or phone number to send the OTP code to + public let contact: String + /// Optional parameters for customizing emails. If not provided, the default email will be used. + public let emailCustomization: v1EmailCustomizationParams? + /// Enum to specifiy whether to send OTP via SMS or email + public let otpType: String + /// Optional custom email address to use as reply-to + public let replyToEmailAddress: String? + /// Optional custom email address from which to send the OTP email + public let sendFromEmailAddress: String? + /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + public let sendFromEmailSenderName: String? + /// Optional parameters for customizing SMS message. If not provided, the default sms message will be used. + public let smsCustomization: v1SmsCustomizationParams? + /// Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. + public let userIdentifier: String? + + public init( + contact: String, + emailCustomization: v1EmailCustomizationParams? = nil, + otpType: String, + replyToEmailAddress: String? = nil, + sendFromEmailAddress: String? = nil, + sendFromEmailSenderName: String? = nil, + smsCustomization: v1SmsCustomizationParams? = nil, + userIdentifier: String? = nil + ) { + self.contact = contact + self.emailCustomization = emailCustomization + self.otpType = otpType + self.replyToEmailAddress = replyToEmailAddress + self.sendFromEmailAddress = sendFromEmailAddress + self.sendFromEmailSenderName = sendFromEmailSenderName + self.smsCustomization = smsCustomization + self.userIdentifier = userIdentifier + } +} + +public struct v1InitOtpAuthIntentV2: Codable, Sendable { + /// Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true + public let alphanumeric: Bool? + /// Email or phone number to send the OTP code to + public let contact: String + /// Optional parameters for customizing emails. If not provided, the default email will be used. + public let emailCustomization: v1EmailCustomizationParams? + /// Optional length of the OTP code. Default = 9 + public let otpLength: Int? + /// Enum to specifiy whether to send OTP via SMS or email + public let otpType: String + /// Optional custom email address to use as reply-to + public let replyToEmailAddress: String? + /// Optional custom email address from which to send the OTP email + public let sendFromEmailAddress: String? + /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + public let sendFromEmailSenderName: String? + /// Optional parameters for customizing SMS message. If not provided, the default sms message will be used. + public let smsCustomization: v1SmsCustomizationParams? + /// Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. + public let userIdentifier: String? + + public init( + alphanumeric: Bool? = nil, + contact: String, + emailCustomization: v1EmailCustomizationParams? = nil, + otpLength: Int? = nil, + otpType: String, + replyToEmailAddress: String? = nil, + sendFromEmailAddress: String? = nil, + sendFromEmailSenderName: String? = nil, + smsCustomization: v1SmsCustomizationParams? = nil, + userIdentifier: String? = nil + ) { + self.alphanumeric = alphanumeric + self.contact = contact + self.emailCustomization = emailCustomization + self.otpLength = otpLength + self.otpType = otpType + self.replyToEmailAddress = replyToEmailAddress + self.sendFromEmailAddress = sendFromEmailAddress + self.sendFromEmailSenderName = sendFromEmailSenderName + self.smsCustomization = smsCustomization + self.userIdentifier = userIdentifier + } +} + +public struct v1InitOtpAuthRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1InitOtpAuthIntentV2 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1InitOtpAuthIntentV2, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1InitOtpAuthResult: Codable, Sendable { + /// Unique identifier for an OTP authentication + public let otpId: String + + public init( + otpId: String + ) { + self.otpId = otpId + } +} + +public struct v1InitOtpAuthResultV2: Codable, Sendable { + /// Unique identifier for an OTP authentication + public let otpId: String + + public init( + otpId: String + ) { + self.otpId = otpId + } +} + +public struct v1InitOtpIntent: Codable, Sendable { + /// Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true + public let alphanumeric: Bool? + /// Email or phone number to send the OTP code to + public let contact: String + /// Optional parameters for customizing emails. If not provided, the default email will be used. + public let emailCustomization: v1EmailCustomizationParams? + /// Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes) + public let expirationSeconds: String? + /// Optional length of the OTP code. Default = 9 + public let otpLength: Int? + /// Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL + public let otpType: String + /// Optional custom email address to use as reply-to + public let replyToEmailAddress: String? + /// Optional custom email address from which to send the OTP email + public let sendFromEmailAddress: String? + /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + public let sendFromEmailSenderName: String? + /// Optional parameters for customizing SMS message. If not provided, the default sms message will be used. + public let smsCustomization: v1SmsCustomizationParams? + /// Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. + public let userIdentifier: String? + + public init( + alphanumeric: Bool? = nil, + contact: String, + emailCustomization: v1EmailCustomizationParams? = nil, + expirationSeconds: String? = nil, + otpLength: Int? = nil, + otpType: String, + replyToEmailAddress: String? = nil, + sendFromEmailAddress: String? = nil, + sendFromEmailSenderName: String? = nil, + smsCustomization: v1SmsCustomizationParams? = nil, + userIdentifier: String? = nil + ) { + self.alphanumeric = alphanumeric + self.contact = contact + self.emailCustomization = emailCustomization + self.expirationSeconds = expirationSeconds + self.otpLength = otpLength + self.otpType = otpType + self.replyToEmailAddress = replyToEmailAddress + self.sendFromEmailAddress = sendFromEmailAddress + self.sendFromEmailSenderName = sendFromEmailSenderName + self.smsCustomization = smsCustomization + self.userIdentifier = userIdentifier + } +} + +public struct v1InitOtpRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1InitOtpIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1InitOtpIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1InitOtpResult: Codable, Sendable { + /// Unique identifier for an OTP authentication + public let otpId: String + + public init( + otpId: String + ) { + self.otpId = otpId + } +} + +public struct v1InitUserEmailRecoveryIntent: Codable, Sendable { + /// Email of the user starting recovery + public let email: String + /// Optional parameters for customizing emails. If not provided, the default email will be used. + public let emailCustomization: v1EmailCustomizationParams? + /// Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Client-side public key generated by the user, to which the recovery bundle will be encrypted. + public let targetPublicKey: String + + public init( + email: String, + emailCustomization: v1EmailCustomizationParams? = nil, + expirationSeconds: String? = nil, + targetPublicKey: String + ) { + self.email = email + self.emailCustomization = emailCustomization + self.expirationSeconds = expirationSeconds + self.targetPublicKey = targetPublicKey + } +} + +public struct v1InitUserEmailRecoveryRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1InitUserEmailRecoveryIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1InitUserEmailRecoveryIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1InitUserEmailRecoveryResult: Codable, Sendable { + /// Unique identifier for the user being recovered. + public let userId: String + + public init( + userId: String + ) { + self.userId = userId + } +} + +public struct v1Intent: Codable, Sendable { + public let acceptInvitationIntent: v1AcceptInvitationIntent? + public let acceptInvitationIntentV2: v1AcceptInvitationIntentV2? + public let activateBillingTierIntent: billingActivateBillingTierIntent? + public let approveActivityIntent: v1ApproveActivityIntent? + public let createApiKeysIntent: v1CreateApiKeysIntent? + public let createApiKeysIntentV2: v1CreateApiKeysIntentV2? + public let createApiOnlyUsersIntent: v1CreateApiOnlyUsersIntent? + public let createAuthenticatorsIntent: v1CreateAuthenticatorsIntent? + public let createAuthenticatorsIntentV2: v1CreateAuthenticatorsIntentV2? + public let createInvitationsIntent: v1CreateInvitationsIntent? + public let createOauth2CredentialIntent: v1CreateOauth2CredentialIntent? + public let createOauthProvidersIntent: v1CreateOauthProvidersIntent? + public let createOrganizationIntent: v1CreateOrganizationIntent? + public let createOrganizationIntentV2: v1CreateOrganizationIntentV2? + public let createPoliciesIntent: v1CreatePoliciesIntent? + public let createPolicyIntent: v1CreatePolicyIntent? + public let createPolicyIntentV2: v1CreatePolicyIntentV2? + public let createPolicyIntentV3: v1CreatePolicyIntentV3? + public let createPrivateKeyTagIntent: v1CreatePrivateKeyTagIntent? + public let createPrivateKeysIntent: v1CreatePrivateKeysIntent? + public let createPrivateKeysIntentV2: v1CreatePrivateKeysIntentV2? + public let createReadOnlySessionIntent: v1CreateReadOnlySessionIntent? + public let createReadWriteSessionIntent: v1CreateReadWriteSessionIntent? + public let createReadWriteSessionIntentV2: v1CreateReadWriteSessionIntentV2? + public let createSmartContractInterfaceIntent: v1CreateSmartContractInterfaceIntent? + public let createSubOrganizationIntent: v1CreateSubOrganizationIntent? + public let createSubOrganizationIntentV2: v1CreateSubOrganizationIntentV2? + public let createSubOrganizationIntentV3: v1CreateSubOrganizationIntentV3? + public let createSubOrganizationIntentV4: v1CreateSubOrganizationIntentV4? + public let createSubOrganizationIntentV5: v1CreateSubOrganizationIntentV5? + public let createSubOrganizationIntentV6: v1CreateSubOrganizationIntentV6? + public let createSubOrganizationIntentV7: v1CreateSubOrganizationIntentV7? + public let createUserTagIntent: v1CreateUserTagIntent? + public let createUsersIntent: v1CreateUsersIntent? + public let createUsersIntentV2: v1CreateUsersIntentV2? + public let createUsersIntentV3: v1CreateUsersIntentV3? + public let createWalletAccountsIntent: v1CreateWalletAccountsIntent? + public let createWalletIntent: v1CreateWalletIntent? + public let deleteApiKeysIntent: v1DeleteApiKeysIntent? + public let deleteAuthenticatorsIntent: v1DeleteAuthenticatorsIntent? + public let deleteInvitationIntent: v1DeleteInvitationIntent? + public let deleteOauth2CredentialIntent: v1DeleteOauth2CredentialIntent? + public let deleteOauthProvidersIntent: v1DeleteOauthProvidersIntent? + public let deleteOrganizationIntent: v1DeleteOrganizationIntent? + public let deletePaymentMethodIntent: billingDeletePaymentMethodIntent? + public let deletePoliciesIntent: v1DeletePoliciesIntent? + public let deletePolicyIntent: v1DeletePolicyIntent? + public let deletePrivateKeyTagsIntent: v1DeletePrivateKeyTagsIntent? + public let deletePrivateKeysIntent: v1DeletePrivateKeysIntent? + public let deleteSmartContractInterfaceIntent: v1DeleteSmartContractInterfaceIntent? + public let deleteSubOrganizationIntent: v1DeleteSubOrganizationIntent? + public let deleteUserTagsIntent: v1DeleteUserTagsIntent? + public let deleteUsersIntent: v1DeleteUsersIntent? + public let deleteWalletAccountsIntent: v1DeleteWalletAccountsIntent? + public let deleteWalletsIntent: v1DeleteWalletsIntent? + public let disableAuthProxyIntent: v1DisableAuthProxyIntent? + public let disablePrivateKeyIntent: v1DisablePrivateKeyIntent? + public let emailAuthIntent: v1EmailAuthIntent? + public let emailAuthIntentV2: v1EmailAuthIntentV2? + public let enableAuthProxyIntent: v1EnableAuthProxyIntent? + public let exportPrivateKeyIntent: v1ExportPrivateKeyIntent? + public let exportWalletAccountIntent: v1ExportWalletAccountIntent? + public let exportWalletIntent: v1ExportWalletIntent? + public let importPrivateKeyIntent: v1ImportPrivateKeyIntent? + public let importWalletIntent: v1ImportWalletIntent? + public let initFiatOnRampIntent: v1InitFiatOnRampIntent? + public let initImportPrivateKeyIntent: v1InitImportPrivateKeyIntent? + public let initImportWalletIntent: v1InitImportWalletIntent? + public let initOtpAuthIntent: v1InitOtpAuthIntent? + public let initOtpAuthIntentV2: v1InitOtpAuthIntentV2? + public let initOtpIntent: v1InitOtpIntent? + public let initUserEmailRecoveryIntent: v1InitUserEmailRecoveryIntent? + public let oauth2AuthenticateIntent: v1Oauth2AuthenticateIntent? + public let oauthIntent: v1OauthIntent? + public let oauthLoginIntent: v1OauthLoginIntent? + public let otpAuthIntent: v1OtpAuthIntent? + public let otpLoginIntent: v1OtpLoginIntent? + public let recoverUserIntent: v1RecoverUserIntent? + public let rejectActivityIntent: v1RejectActivityIntent? + public let removeOrganizationFeatureIntent: v1RemoveOrganizationFeatureIntent? + public let setOrganizationFeatureIntent: v1SetOrganizationFeatureIntent? + public let setPaymentMethodIntent: billingSetPaymentMethodIntent? + public let setPaymentMethodIntentV2: billingSetPaymentMethodIntentV2? + public let signRawPayloadIntent: v1SignRawPayloadIntent? + public let signRawPayloadIntentV2: v1SignRawPayloadIntentV2? + public let signRawPayloadsIntent: v1SignRawPayloadsIntent? + public let signTransactionIntent: v1SignTransactionIntent? + public let signTransactionIntentV2: v1SignTransactionIntentV2? + public let stampLoginIntent: v1StampLoginIntent? + public let updateAllowedOriginsIntent: v1UpdateAllowedOriginsIntent? + public let updateAuthProxyConfigIntent: v1UpdateAuthProxyConfigIntent? + public let updateOauth2CredentialIntent: v1UpdateOauth2CredentialIntent? + public let updatePolicyIntent: v1UpdatePolicyIntent? + public let updatePolicyIntentV2: v1UpdatePolicyIntentV2? + public let updatePrivateKeyTagIntent: v1UpdatePrivateKeyTagIntent? + public let updateRootQuorumIntent: v1UpdateRootQuorumIntent? + public let updateUserEmailIntent: v1UpdateUserEmailIntent? + public let updateUserIntent: v1UpdateUserIntent? + public let updateUserNameIntent: v1UpdateUserNameIntent? + public let updateUserPhoneNumberIntent: v1UpdateUserPhoneNumberIntent? + public let updateUserTagIntent: v1UpdateUserTagIntent? + public let updateWalletIntent: v1UpdateWalletIntent? + public let verifyOtpIntent: v1VerifyOtpIntent? + + public init( + acceptInvitationIntent: v1AcceptInvitationIntent? = nil, + acceptInvitationIntentV2: v1AcceptInvitationIntentV2? = nil, + activateBillingTierIntent: billingActivateBillingTierIntent? = nil, + approveActivityIntent: v1ApproveActivityIntent? = nil, + createApiKeysIntent: v1CreateApiKeysIntent? = nil, + createApiKeysIntentV2: v1CreateApiKeysIntentV2? = nil, + createApiOnlyUsersIntent: v1CreateApiOnlyUsersIntent? = nil, + createAuthenticatorsIntent: v1CreateAuthenticatorsIntent? = nil, + createAuthenticatorsIntentV2: v1CreateAuthenticatorsIntentV2? = nil, + createInvitationsIntent: v1CreateInvitationsIntent? = nil, + createOauth2CredentialIntent: v1CreateOauth2CredentialIntent? = nil, + createOauthProvidersIntent: v1CreateOauthProvidersIntent? = nil, + createOrganizationIntent: v1CreateOrganizationIntent? = nil, + createOrganizationIntentV2: v1CreateOrganizationIntentV2? = nil, + createPoliciesIntent: v1CreatePoliciesIntent? = nil, + createPolicyIntent: v1CreatePolicyIntent? = nil, + createPolicyIntentV2: v1CreatePolicyIntentV2? = nil, + createPolicyIntentV3: v1CreatePolicyIntentV3? = nil, + createPrivateKeyTagIntent: v1CreatePrivateKeyTagIntent? = nil, + createPrivateKeysIntent: v1CreatePrivateKeysIntent? = nil, + createPrivateKeysIntentV2: v1CreatePrivateKeysIntentV2? = nil, + createReadOnlySessionIntent: v1CreateReadOnlySessionIntent? = nil, + createReadWriteSessionIntent: v1CreateReadWriteSessionIntent? = nil, + createReadWriteSessionIntentV2: v1CreateReadWriteSessionIntentV2? = nil, + createSmartContractInterfaceIntent: v1CreateSmartContractInterfaceIntent? = nil, + createSubOrganizationIntent: v1CreateSubOrganizationIntent? = nil, + createSubOrganizationIntentV2: v1CreateSubOrganizationIntentV2? = nil, + createSubOrganizationIntentV3: v1CreateSubOrganizationIntentV3? = nil, + createSubOrganizationIntentV4: v1CreateSubOrganizationIntentV4? = nil, + createSubOrganizationIntentV5: v1CreateSubOrganizationIntentV5? = nil, + createSubOrganizationIntentV6: v1CreateSubOrganizationIntentV6? = nil, + createSubOrganizationIntentV7: v1CreateSubOrganizationIntentV7? = nil, + createUserTagIntent: v1CreateUserTagIntent? = nil, + createUsersIntent: v1CreateUsersIntent? = nil, + createUsersIntentV2: v1CreateUsersIntentV2? = nil, + createUsersIntentV3: v1CreateUsersIntentV3? = nil, + createWalletAccountsIntent: v1CreateWalletAccountsIntent? = nil, + createWalletIntent: v1CreateWalletIntent? = nil, + deleteApiKeysIntent: v1DeleteApiKeysIntent? = nil, + deleteAuthenticatorsIntent: v1DeleteAuthenticatorsIntent? = nil, + deleteInvitationIntent: v1DeleteInvitationIntent? = nil, + deleteOauth2CredentialIntent: v1DeleteOauth2CredentialIntent? = nil, + deleteOauthProvidersIntent: v1DeleteOauthProvidersIntent? = nil, + deleteOrganizationIntent: v1DeleteOrganizationIntent? = nil, + deletePaymentMethodIntent: billingDeletePaymentMethodIntent? = nil, + deletePoliciesIntent: v1DeletePoliciesIntent? = nil, + deletePolicyIntent: v1DeletePolicyIntent? = nil, + deletePrivateKeyTagsIntent: v1DeletePrivateKeyTagsIntent? = nil, + deletePrivateKeysIntent: v1DeletePrivateKeysIntent? = nil, + deleteSmartContractInterfaceIntent: v1DeleteSmartContractInterfaceIntent? = nil, + deleteSubOrganizationIntent: v1DeleteSubOrganizationIntent? = nil, + deleteUserTagsIntent: v1DeleteUserTagsIntent? = nil, + deleteUsersIntent: v1DeleteUsersIntent? = nil, + deleteWalletAccountsIntent: v1DeleteWalletAccountsIntent? = nil, + deleteWalletsIntent: v1DeleteWalletsIntent? = nil, + disableAuthProxyIntent: v1DisableAuthProxyIntent? = nil, + disablePrivateKeyIntent: v1DisablePrivateKeyIntent? = nil, + emailAuthIntent: v1EmailAuthIntent? = nil, + emailAuthIntentV2: v1EmailAuthIntentV2? = nil, + enableAuthProxyIntent: v1EnableAuthProxyIntent? = nil, + exportPrivateKeyIntent: v1ExportPrivateKeyIntent? = nil, + exportWalletAccountIntent: v1ExportWalletAccountIntent? = nil, + exportWalletIntent: v1ExportWalletIntent? = nil, + importPrivateKeyIntent: v1ImportPrivateKeyIntent? = nil, + importWalletIntent: v1ImportWalletIntent? = nil, + initFiatOnRampIntent: v1InitFiatOnRampIntent? = nil, + initImportPrivateKeyIntent: v1InitImportPrivateKeyIntent? = nil, + initImportWalletIntent: v1InitImportWalletIntent? = nil, + initOtpAuthIntent: v1InitOtpAuthIntent? = nil, + initOtpAuthIntentV2: v1InitOtpAuthIntentV2? = nil, + initOtpIntent: v1InitOtpIntent? = nil, + initUserEmailRecoveryIntent: v1InitUserEmailRecoveryIntent? = nil, + oauth2AuthenticateIntent: v1Oauth2AuthenticateIntent? = nil, + oauthIntent: v1OauthIntent? = nil, + oauthLoginIntent: v1OauthLoginIntent? = nil, + otpAuthIntent: v1OtpAuthIntent? = nil, + otpLoginIntent: v1OtpLoginIntent? = nil, + recoverUserIntent: v1RecoverUserIntent? = nil, + rejectActivityIntent: v1RejectActivityIntent? = nil, + removeOrganizationFeatureIntent: v1RemoveOrganizationFeatureIntent? = nil, + setOrganizationFeatureIntent: v1SetOrganizationFeatureIntent? = nil, + setPaymentMethodIntent: billingSetPaymentMethodIntent? = nil, + setPaymentMethodIntentV2: billingSetPaymentMethodIntentV2? = nil, + signRawPayloadIntent: v1SignRawPayloadIntent? = nil, + signRawPayloadIntentV2: v1SignRawPayloadIntentV2? = nil, + signRawPayloadsIntent: v1SignRawPayloadsIntent? = nil, + signTransactionIntent: v1SignTransactionIntent? = nil, + signTransactionIntentV2: v1SignTransactionIntentV2? = nil, + stampLoginIntent: v1StampLoginIntent? = nil, + updateAllowedOriginsIntent: v1UpdateAllowedOriginsIntent? = nil, + updateAuthProxyConfigIntent: v1UpdateAuthProxyConfigIntent? = nil, + updateOauth2CredentialIntent: v1UpdateOauth2CredentialIntent? = nil, + updatePolicyIntent: v1UpdatePolicyIntent? = nil, + updatePolicyIntentV2: v1UpdatePolicyIntentV2? = nil, + updatePrivateKeyTagIntent: v1UpdatePrivateKeyTagIntent? = nil, + updateRootQuorumIntent: v1UpdateRootQuorumIntent? = nil, + updateUserEmailIntent: v1UpdateUserEmailIntent? = nil, + updateUserIntent: v1UpdateUserIntent? = nil, + updateUserNameIntent: v1UpdateUserNameIntent? = nil, + updateUserPhoneNumberIntent: v1UpdateUserPhoneNumberIntent? = nil, + updateUserTagIntent: v1UpdateUserTagIntent? = nil, + updateWalletIntent: v1UpdateWalletIntent? = nil, + verifyOtpIntent: v1VerifyOtpIntent? = nil + ) { + self.acceptInvitationIntent = acceptInvitationIntent + self.acceptInvitationIntentV2 = acceptInvitationIntentV2 + self.activateBillingTierIntent = activateBillingTierIntent + self.approveActivityIntent = approveActivityIntent + self.createApiKeysIntent = createApiKeysIntent + self.createApiKeysIntentV2 = createApiKeysIntentV2 + self.createApiOnlyUsersIntent = createApiOnlyUsersIntent + self.createAuthenticatorsIntent = createAuthenticatorsIntent + self.createAuthenticatorsIntentV2 = createAuthenticatorsIntentV2 + self.createInvitationsIntent = createInvitationsIntent + self.createOauth2CredentialIntent = createOauth2CredentialIntent + self.createOauthProvidersIntent = createOauthProvidersIntent + self.createOrganizationIntent = createOrganizationIntent + self.createOrganizationIntentV2 = createOrganizationIntentV2 + self.createPoliciesIntent = createPoliciesIntent + self.createPolicyIntent = createPolicyIntent + self.createPolicyIntentV2 = createPolicyIntentV2 + self.createPolicyIntentV3 = createPolicyIntentV3 + self.createPrivateKeyTagIntent = createPrivateKeyTagIntent + self.createPrivateKeysIntent = createPrivateKeysIntent + self.createPrivateKeysIntentV2 = createPrivateKeysIntentV2 + self.createReadOnlySessionIntent = createReadOnlySessionIntent + self.createReadWriteSessionIntent = createReadWriteSessionIntent + self.createReadWriteSessionIntentV2 = createReadWriteSessionIntentV2 + self.createSmartContractInterfaceIntent = createSmartContractInterfaceIntent + self.createSubOrganizationIntent = createSubOrganizationIntent + self.createSubOrganizationIntentV2 = createSubOrganizationIntentV2 + self.createSubOrganizationIntentV3 = createSubOrganizationIntentV3 + self.createSubOrganizationIntentV4 = createSubOrganizationIntentV4 + self.createSubOrganizationIntentV5 = createSubOrganizationIntentV5 + self.createSubOrganizationIntentV6 = createSubOrganizationIntentV6 + self.createSubOrganizationIntentV7 = createSubOrganizationIntentV7 + self.createUserTagIntent = createUserTagIntent + self.createUsersIntent = createUsersIntent + self.createUsersIntentV2 = createUsersIntentV2 + self.createUsersIntentV3 = createUsersIntentV3 + self.createWalletAccountsIntent = createWalletAccountsIntent + self.createWalletIntent = createWalletIntent + self.deleteApiKeysIntent = deleteApiKeysIntent + self.deleteAuthenticatorsIntent = deleteAuthenticatorsIntent + self.deleteInvitationIntent = deleteInvitationIntent + self.deleteOauth2CredentialIntent = deleteOauth2CredentialIntent + self.deleteOauthProvidersIntent = deleteOauthProvidersIntent + self.deleteOrganizationIntent = deleteOrganizationIntent + self.deletePaymentMethodIntent = deletePaymentMethodIntent + self.deletePoliciesIntent = deletePoliciesIntent + self.deletePolicyIntent = deletePolicyIntent + self.deletePrivateKeyTagsIntent = deletePrivateKeyTagsIntent + self.deletePrivateKeysIntent = deletePrivateKeysIntent + self.deleteSmartContractInterfaceIntent = deleteSmartContractInterfaceIntent + self.deleteSubOrganizationIntent = deleteSubOrganizationIntent + self.deleteUserTagsIntent = deleteUserTagsIntent + self.deleteUsersIntent = deleteUsersIntent + self.deleteWalletAccountsIntent = deleteWalletAccountsIntent + self.deleteWalletsIntent = deleteWalletsIntent + self.disableAuthProxyIntent = disableAuthProxyIntent + self.disablePrivateKeyIntent = disablePrivateKeyIntent + self.emailAuthIntent = emailAuthIntent + self.emailAuthIntentV2 = emailAuthIntentV2 + self.enableAuthProxyIntent = enableAuthProxyIntent + self.exportPrivateKeyIntent = exportPrivateKeyIntent + self.exportWalletAccountIntent = exportWalletAccountIntent + self.exportWalletIntent = exportWalletIntent + self.importPrivateKeyIntent = importPrivateKeyIntent + self.importWalletIntent = importWalletIntent + self.initFiatOnRampIntent = initFiatOnRampIntent + self.initImportPrivateKeyIntent = initImportPrivateKeyIntent + self.initImportWalletIntent = initImportWalletIntent + self.initOtpAuthIntent = initOtpAuthIntent + self.initOtpAuthIntentV2 = initOtpAuthIntentV2 + self.initOtpIntent = initOtpIntent + self.initUserEmailRecoveryIntent = initUserEmailRecoveryIntent + self.oauth2AuthenticateIntent = oauth2AuthenticateIntent + self.oauthIntent = oauthIntent + self.oauthLoginIntent = oauthLoginIntent + self.otpAuthIntent = otpAuthIntent + self.otpLoginIntent = otpLoginIntent + self.recoverUserIntent = recoverUserIntent + self.rejectActivityIntent = rejectActivityIntent + self.removeOrganizationFeatureIntent = removeOrganizationFeatureIntent + self.setOrganizationFeatureIntent = setOrganizationFeatureIntent + self.setPaymentMethodIntent = setPaymentMethodIntent + self.setPaymentMethodIntentV2 = setPaymentMethodIntentV2 + self.signRawPayloadIntent = signRawPayloadIntent + self.signRawPayloadIntentV2 = signRawPayloadIntentV2 + self.signRawPayloadsIntent = signRawPayloadsIntent + self.signTransactionIntent = signTransactionIntent + self.signTransactionIntentV2 = signTransactionIntentV2 + self.stampLoginIntent = stampLoginIntent + self.updateAllowedOriginsIntent = updateAllowedOriginsIntent + self.updateAuthProxyConfigIntent = updateAuthProxyConfigIntent + self.updateOauth2CredentialIntent = updateOauth2CredentialIntent + self.updatePolicyIntent = updatePolicyIntent + self.updatePolicyIntentV2 = updatePolicyIntentV2 + self.updatePrivateKeyTagIntent = updatePrivateKeyTagIntent + self.updateRootQuorumIntent = updateRootQuorumIntent + self.updateUserEmailIntent = updateUserEmailIntent + self.updateUserIntent = updateUserIntent + self.updateUserNameIntent = updateUserNameIntent + self.updateUserPhoneNumberIntent = updateUserPhoneNumberIntent + self.updateUserTagIntent = updateUserTagIntent + self.updateWalletIntent = updateWalletIntent + self.verifyOtpIntent = verifyOtpIntent + } +} + +public struct v1Invitation: Codable, Sendable { + /// The User's permissible access method(s). + public let accessType: v1AccessType + public let createdAt: externaldatav1Timestamp + /// Unique identifier for a given Invitation object. + public let invitationId: String + /// The email address of the intended Invitation recipient. + public let receiverEmail: String + /// The name of the intended Invitation recipient. + public let receiverUserName: String + /// A list of tags assigned to the Invitation recipient. + public let receiverUserTags: [String] + /// Unique identifier for the Sender of an Invitation. + public let senderUserId: String + /// The current processing status of a specified Invitation. + public let status: v1InvitationStatus + public let updatedAt: externaldatav1Timestamp + + public init( + accessType: v1AccessType, + createdAt: externaldatav1Timestamp, + invitationId: String, + receiverEmail: String, + receiverUserName: String, + receiverUserTags: [String], + senderUserId: String, + status: v1InvitationStatus, + updatedAt: externaldatav1Timestamp + ) { + self.accessType = accessType + self.createdAt = createdAt + self.invitationId = invitationId + self.receiverEmail = receiverEmail + self.receiverUserName = receiverUserName + self.receiverUserTags = receiverUserTags + self.senderUserId = senderUserId + self.status = status + self.updatedAt = updatedAt + } +} + +public struct v1InvitationParams: Codable, Sendable { + /// The User's permissible access method(s). + public let accessType: v1AccessType + /// The email address of the intended Invitation recipient. + public let receiverUserEmail: String + /// The name of the intended Invitation recipient. + public let receiverUserName: String + /// A list of tags assigned to the Invitation recipient. This field, if not needed, should be an empty array in your request body. + public let receiverUserTags: [String] + /// Unique identifier for the Sender of an Invitation. + public let senderUserId: String + + public init( + accessType: v1AccessType, + receiverUserEmail: String, + receiverUserName: String, + receiverUserTags: [String], + senderUserId: String + ) { + self.accessType = accessType + self.receiverUserEmail = receiverUserEmail + self.receiverUserName = receiverUserName + self.receiverUserTags = receiverUserTags + self.senderUserId = senderUserId + } +} + +public enum v1InvitationStatus: String, Codable, Sendable { + case invitation_status_created = "INVITATION_STATUS_CREATED" + case invitation_status_accepted = "INVITATION_STATUS_ACCEPTED" + case invitation_status_revoked = "INVITATION_STATUS_REVOKED" +} + +public struct v1ListOauth2CredentialsRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1ListOauth2CredentialsResponse: Codable, Sendable { + public let oauth2Credentials: [v1Oauth2Credential] + + public init( + oauth2Credentials: [v1Oauth2Credential] + ) { + self.oauth2Credentials = oauth2Credentials + } +} + +public struct v1ListPrivateKeyTagsRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1ListPrivateKeyTagsResponse: Codable, Sendable { + /// A list of private key tags. + public let privateKeyTags: [datav1Tag] + + public init( + privateKeyTags: [datav1Tag] + ) { + self.privateKeyTags = privateKeyTags + } +} + +public struct v1ListUserTagsRequest: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + + public init( + organizationId: String + ) { + self.organizationId = organizationId + } +} + +public struct v1ListUserTagsResponse: Codable, Sendable { + /// A list of user tags. + public let userTags: [datav1Tag] + + public init( + userTags: [datav1Tag] + ) { + self.userTags = userTags + } +} + +public enum v1MnemonicLanguage: String, Codable, Sendable { + case mnemonic_language_english = "MNEMONIC_LANGUAGE_ENGLISH" + case mnemonic_language_simplified_chinese = "MNEMONIC_LANGUAGE_SIMPLIFIED_CHINESE" + case mnemonic_language_traditional_chinese = "MNEMONIC_LANGUAGE_TRADITIONAL_CHINESE" + case mnemonic_language_czech = "MNEMONIC_LANGUAGE_CZECH" + case mnemonic_language_french = "MNEMONIC_LANGUAGE_FRENCH" + case mnemonic_language_italian = "MNEMONIC_LANGUAGE_ITALIAN" + case mnemonic_language_japanese = "MNEMONIC_LANGUAGE_JAPANESE" + case mnemonic_language_korean = "MNEMONIC_LANGUAGE_KOREAN" + case mnemonic_language_spanish = "MNEMONIC_LANGUAGE_SPANISH" +} + +public struct v1NOOPCodegenAnchorResponse: Codable, Sendable { + public let stamp: v1WebAuthnStamp + + public init( + stamp: v1WebAuthnStamp + ) { + self.stamp = stamp + } +} + +public struct v1Oauth2AuthenticateIntent: Codable, Sendable { + /// The auth_code provided by the OAuth 2.0 provider to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow + public let authCode: String + /// An optional P256 public key to which, if provided, the bearer token will be encrypted and returned via the `encrypted_bearer_token` claim of the OIDC Token + public let bearerTokenTargetPublicKey: String? + /// The code verifier used by OAuth 2.0 PKCE providers + public let codeVerifier: String + /// An optional nonce used by the client to prevent replay/substitution of an ID token + public let nonce: String? + /// The OAuth 2.0 credential id whose client_id and client_secret will be used in the OAuth 2.0 flow + public let oauth2CredentialId: String + /// The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider + public let redirectUri: String + + public init( + authCode: String, + bearerTokenTargetPublicKey: String? = nil, + codeVerifier: String, + nonce: String? = nil, + oauth2CredentialId: String, + redirectUri: String + ) { + self.authCode = authCode + self.bearerTokenTargetPublicKey = bearerTokenTargetPublicKey + self.codeVerifier = codeVerifier + self.nonce = nonce + self.oauth2CredentialId = oauth2CredentialId + self.redirectUri = redirectUri + } +} + +public struct v1Oauth2AuthenticateRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1Oauth2AuthenticateIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1Oauth2AuthenticateIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1Oauth2AuthenticateResult: Codable, Sendable { + /// Base64 encoded OIDC token issued by Turnkey to be used with the LoginWithOAuth activity + public let oidcToken: String + + public init( + oidcToken: String + ) { + self.oidcToken = oidcToken + } +} + +public struct v1Oauth2Credential: Codable, Sendable { + /// The client id for a given OAuth 2.0 Credential. + public let clientId: String + public let createdAt: externaldatav1Timestamp + /// The encrypted client secret for a given OAuth 2.0 Credential encrypted to the TLS Fetcher quorum key. + public let encryptedClientSecret: String + /// Unique identifier for a given OAuth 2.0 Credential. + public let oauth2CredentialId: String + /// Unique identifier for an Organization. + public let organizationId: String + /// The provider for a given OAuth 2.0 Credential. + public let provider: v1Oauth2Provider + public let updatedAt: externaldatav1Timestamp + + public init( + clientId: String, + createdAt: externaldatav1Timestamp, + encryptedClientSecret: String, + oauth2CredentialId: String, + organizationId: String, + provider: v1Oauth2Provider, + updatedAt: externaldatav1Timestamp + ) { + self.clientId = clientId + self.createdAt = createdAt + self.encryptedClientSecret = encryptedClientSecret + self.oauth2CredentialId = oauth2CredentialId + self.organizationId = organizationId + self.provider = provider + self.updatedAt = updatedAt + } +} + +public enum v1Oauth2Provider: String, Codable, Sendable { + case oauth2_provider_x = "OAUTH2_PROVIDER_X" + case oauth2_provider_discord = "OAUTH2_PROVIDER_DISCORD" +} + +public struct v1OauthIntent: Codable, Sendable { + /// Optional human-readable name for an API Key. If none provided, default to Oauth - + public let apiKeyName: String? + /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated Oauth API keys + public let invalidateExisting: Bool? + /// Base64 encoded OIDC token + public let oidcToken: String + /// Client-side public key generated by the user, to which the oauth bundle (credentials) will be encrypted. + public let targetPublicKey: String + + public init( + apiKeyName: String? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + oidcToken: String, + targetPublicKey: String + ) { + self.apiKeyName = apiKeyName + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.oidcToken = oidcToken + self.targetPublicKey = targetPublicKey + } +} + +public struct v1OauthLoginIntent: Codable, Sendable { + /// Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated Login API keys + public let invalidateExisting: Bool? + /// Base64 encoded OIDC token + public let oidcToken: String + /// Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request + public let publicKey: String + + public init( + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + oidcToken: String, + publicKey: String + ) { + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.oidcToken = oidcToken + self.publicKey = publicKey + } +} + +public struct v1OauthLoginRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1OauthLoginIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1OauthLoginIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1OauthLoginResult: Codable, Sendable { + /// Signed JWT containing an expiry, public key, session type, user id, and organization id + public let session: String + + public init( + session: String + ) { + self.session = session + } +} + +public struct v1OauthProvider: Codable, Sendable { + /// Expected audience ('aud' attribute of the signed token) which represents the app ID + public let audience: String + public let createdAt: externaldatav1Timestamp + /// The issuer of the token, typically a URL indicating the authentication server, e.g https://accounts.google.com + public let issuer: String + /// Unique identifier for an OAuth Provider + public let providerId: String + /// Human-readable name to identify a Provider. + public let providerName: String + /// Expected subject ('sub' attribute of the signed token) which represents the user ID + public let subject: String + public let updatedAt: externaldatav1Timestamp + + public init( + audience: String, + createdAt: externaldatav1Timestamp, + issuer: String, + providerId: String, + providerName: String, + subject: String, + updatedAt: externaldatav1Timestamp + ) { + self.audience = audience + self.createdAt = createdAt + self.issuer = issuer + self.providerId = providerId + self.providerName = providerName + self.subject = subject + self.updatedAt = updatedAt + } +} + +public struct v1OauthProviderParams: Codable, Sendable { + /// Base64 encoded OIDC token + public let oidcToken: String + /// Human-readable name to identify a Provider. + public let providerName: String + + public init( + oidcToken: String, + providerName: String + ) { + self.oidcToken = oidcToken + self.providerName = providerName + } +} + +public struct v1OauthRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1OauthIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1OauthIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1OauthResult: Codable, Sendable { + /// Unique identifier for the created API key. + public let apiKeyId: String + /// HPKE encrypted credential bundle + public let credentialBundle: String + /// Unique identifier for the authenticating User. + public let userId: String + + public init( + apiKeyId: String, + credentialBundle: String, + userId: String + ) { + self.apiKeyId = apiKeyId + self.credentialBundle = credentialBundle + self.userId = userId + } +} + +public enum v1Operator: String, Codable, Sendable { + case operator_equal = "OPERATOR_EQUAL" + case operator_more_than = "OPERATOR_MORE_THAN" + case operator_more_than_or_equal = "OPERATOR_MORE_THAN_OR_EQUAL" + case operator_less_than = "OPERATOR_LESS_THAN" + case operator_less_than_or_equal = "OPERATOR_LESS_THAN_OR_EQUAL" + case operator_contains = "OPERATOR_CONTAINS" + case operator_not_equal = "OPERATOR_NOT_EQUAL" + case operator_in = "OPERATOR_IN" + case operator_not_in = "OPERATOR_NOT_IN" + case operator_contains_one = "OPERATOR_CONTAINS_ONE" + case operator_contains_all = "OPERATOR_CONTAINS_ALL" +} + +public struct v1OrganizationData: Codable, Sendable { + public let features: [v1Feature]? + public let invitations: [v1Invitation]? + public let name: String? + public let organizationId: String? + public let policies: [v1Policy]? + public let privateKeys: [v1PrivateKey]? + public let rootQuorum: externaldatav1Quorum? + public let smartContractInterfaceReferences: [v1SmartContractInterfaceReference]? + public let tags: [datav1Tag]? + public let users: [v1User]? + public let wallets: [v1Wallet]? + + public init( + features: [v1Feature]? = nil, + invitations: [v1Invitation]? = nil, + name: String? = nil, + organizationId: String? = nil, + policies: [v1Policy]? = nil, + privateKeys: [v1PrivateKey]? = nil, + rootQuorum: externaldatav1Quorum? = nil, + smartContractInterfaceReferences: [v1SmartContractInterfaceReference]? = nil, + tags: [datav1Tag]? = nil, + users: [v1User]? = nil, + wallets: [v1Wallet]? = nil + ) { + self.features = features + self.invitations = invitations + self.name = name + self.organizationId = organizationId + self.policies = policies + self.privateKeys = privateKeys + self.rootQuorum = rootQuorum + self.smartContractInterfaceReferences = smartContractInterfaceReferences + self.tags = tags + self.users = users + self.wallets = wallets + } +} + +public struct v1OtpAuthIntent: Codable, Sendable { + /// Optional human-readable name for an API Key. If none provided, default to OTP Auth - + public let apiKeyName: String? + /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated OTP Auth API keys + public let invalidateExisting: Bool? + /// OTP sent out to a user's contact (email or SMS) + public let otpCode: String + /// ID representing the result of an init OTP activity. + public let otpId: String + /// Client-side public key generated by the user, to which the OTP bundle (credentials) will be encrypted. + public let targetPublicKey: String + + public init( + apiKeyName: String? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + otpCode: String, + otpId: String, + targetPublicKey: String + ) { + self.apiKeyName = apiKeyName + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.otpCode = otpCode + self.otpId = otpId + self.targetPublicKey = targetPublicKey + } +} + +public struct v1OtpAuthRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1OtpAuthIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1OtpAuthIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1OtpAuthResult: Codable, Sendable { + /// Unique identifier for the created API key. + public let apiKeyId: String? + /// HPKE encrypted credential bundle + public let credentialBundle: String? + /// Unique identifier for the authenticating User. + public let userId: String + + public init( + apiKeyId: String? = nil, + credentialBundle: String? = nil, + userId: String + ) { + self.apiKeyId = apiKeyId + self.credentialBundle = credentialBundle + self.userId = userId + } +} + +public struct v1OtpLoginIntent: Codable, Sendable { + /// Optional signature associated with the public key passed into the verification step. This must be a hex-encoded ECDSA signature over the verification token. Only required if a public key was provided during the verification step. + public let clientSignature: String? + /// Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated Login API keys + public let invalidateExisting: Bool? + /// Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token + public let publicKey: String + /// Signed JWT containing a unique id, expiry, verification type, contact + public let verificationToken: String + + public init( + clientSignature: String? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + publicKey: String, + verificationToken: String + ) { + self.clientSignature = clientSignature + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.publicKey = publicKey + self.verificationToken = verificationToken + } +} + +public struct v1OtpLoginRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1OtpLoginIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1OtpLoginIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1OtpLoginResult: Codable, Sendable { + /// Signed JWT containing an expiry, public key, session type, user id, and organization id + public let session: String + + public init( + session: String + ) { + self.session = session + } +} + +public enum v1Outcome: String, Codable, Sendable { + case outcome_allow = "OUTCOME_ALLOW" + case outcome_deny_explicit = "OUTCOME_DENY_EXPLICIT" + case outcome_deny_implicit = "OUTCOME_DENY_IMPLICIT" + case outcome_requires_consensus = "OUTCOME_REQUIRES_CONSENSUS" + case outcome_rejected = "OUTCOME_REJECTED" + case outcome_error = "OUTCOME_ERROR" +} + +public struct v1Pagination: Codable, Sendable { + /// A pagination cursor. This is an object ID that enables you to fetch all objects after this ID. + public let after: String? + /// A pagination cursor. This is an object ID that enables you to fetch all objects before this ID. + public let before: String? + /// A limit of the number of object to be returned, between 1 and 100. Defaults to 10. + public let limit: String? + + public init( + after: String? = nil, + before: String? = nil, + limit: String? = nil + ) { + self.after = after + self.before = before + self.limit = limit + } +} + +public enum v1PathFormat: String, Codable, Sendable { + case path_format_bip32 = "PATH_FORMAT_BIP32" +} + +public enum v1PayloadEncoding: String, Codable, Sendable { + case payload_encoding_hexadecimal = "PAYLOAD_ENCODING_HEXADECIMAL" + case payload_encoding_text_utf8 = "PAYLOAD_ENCODING_TEXT_UTF8" + case payload_encoding_eip712 = "PAYLOAD_ENCODING_EIP712" + case payload_encoding_eip7702_authorization = "PAYLOAD_ENCODING_EIP7702_AUTHORIZATION" +} + +public struct v1Policy: Codable, Sendable { + /// A condition expression that evalutes to true or false. + public let condition: String + /// A consensus expression that evalutes to true or false. + public let consensus: String + public let createdAt: externaldatav1Timestamp + /// The instruction to DENY or ALLOW a particular activity following policy selector(s). + public let effect: v1Effect + /// Human-readable notes added by a User to describe a particular policy. + public let notes: String + /// Unique identifier for a given Policy. + public let policyId: String + /// Human-readable name for a Policy. + public let policyName: String + public let updatedAt: externaldatav1Timestamp + + public init( + condition: String, + consensus: String, + createdAt: externaldatav1Timestamp, + effect: v1Effect, + notes: String, + policyId: String, + policyName: String, + updatedAt: externaldatav1Timestamp + ) { + self.condition = condition + self.consensus = consensus + self.createdAt = createdAt + self.effect = effect + self.notes = notes + self.policyId = policyId + self.policyName = policyName + self.updatedAt = updatedAt + } +} + +public struct v1PrivateKey: Codable, Sendable { + /// Derived cryptocurrency addresses for a given Private Key. + public let addresses: [externaldatav1Address] + public let createdAt: externaldatav1Timestamp + /// Cryptographic Curve used to generate a given Private Key. + public let curve: v1Curve + /// True when a given Private Key is exported, false otherwise. + public let exported: Bool + /// True when a given Private Key is imported, false otherwise. + public let imported: Bool + /// Unique identifier for a given Private Key. + public let privateKeyId: String + /// Human-readable name for a Private Key. + public let privateKeyName: String + /// A list of Private Key Tag IDs. + public let privateKeyTags: [String] + /// The public component of a cryptographic key pair used to sign messages and transactions. + public let publicKey: String + public let updatedAt: externaldatav1Timestamp + + public init( + addresses: [externaldatav1Address], + createdAt: externaldatav1Timestamp, + curve: v1Curve, + exported: Bool, + imported: Bool, + privateKeyId: String, + privateKeyName: String, + privateKeyTags: [String], + publicKey: String, + updatedAt: externaldatav1Timestamp + ) { + self.addresses = addresses + self.createdAt = createdAt + self.curve = curve + self.exported = exported + self.imported = imported + self.privateKeyId = privateKeyId + self.privateKeyName = privateKeyName + self.privateKeyTags = privateKeyTags + self.publicKey = publicKey + self.updatedAt = updatedAt + } +} + +public struct v1PrivateKeyParams: Codable, Sendable { + /// Cryptocurrency-specific formats for a derived address (e.g., Ethereum). + public let addressFormats: [v1AddressFormat] + /// Cryptographic Curve used to generate a given Private Key. + public let curve: v1Curve + /// Human-readable name for a Private Key. + public let privateKeyName: String + /// A list of Private Key Tag IDs. This field, if not needed, should be an empty array in your request body. + public let privateKeyTags: [String] + + public init( + addressFormats: [v1AddressFormat], + curve: v1Curve, + privateKeyName: String, + privateKeyTags: [String] + ) { + self.addressFormats = addressFormats + self.curve = curve + self.privateKeyName = privateKeyName + self.privateKeyTags = privateKeyTags + } +} + +public struct v1PrivateKeyResult: Codable, Sendable { + public let addresses: [immutableactivityv1Address]? + public let privateKeyId: String? + + public init( + addresses: [immutableactivityv1Address]? = nil, + privateKeyId: String? = nil + ) { + self.addresses = addresses + self.privateKeyId = privateKeyId + } +} + +public struct v1PublicKeyCredentialWithAttestation: Codable, Sendable { + public let authenticatorAttachment: String? + public let clientExtensionResults: v1SimpleClientExtensionResults + public let id: String + public let rawId: String + public let response: v1AuthenticatorAttestationResponse + public let type: String + + public init( + authenticatorAttachment: String? = nil, + clientExtensionResults: v1SimpleClientExtensionResults, + id: String, + rawId: String, + response: v1AuthenticatorAttestationResponse, + type: String + ) { + self.authenticatorAttachment = authenticatorAttachment + self.clientExtensionResults = clientExtensionResults + self.id = id + self.rawId = rawId + self.response = response + self.type = type + } +} + +public struct v1RecoverUserIntent: Codable, Sendable { + /// The new authenticator to register. + public let authenticator: v1AuthenticatorParamsV2 + /// Unique identifier for the user performing recovery. + public let userId: String + + public init( + authenticator: v1AuthenticatorParamsV2, + userId: String + ) { + self.authenticator = authenticator + self.userId = userId + } +} + +public struct v1RecoverUserRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1RecoverUserIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1RecoverUserIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1RecoverUserResult: Codable, Sendable { + /// ID of the authenticator created. + public let authenticatorId: [String] + + public init( + authenticatorId: [String] + ) { + self.authenticatorId = authenticatorId + } +} + +public struct v1RejectActivityIntent: Codable, Sendable { + /// An artifact verifying a User's action. + public let fingerprint: String + + public init( + fingerprint: String + ) { + self.fingerprint = fingerprint + } +} + +public struct v1RejectActivityRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1RejectActivityIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1RejectActivityIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1RemoveOrganizationFeatureIntent: Codable, Sendable { + /// Name of the feature to remove + public let name: v1FeatureName + + public init( + name: v1FeatureName + ) { + self.name = name + } +} + +public struct v1RemoveOrganizationFeatureRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1RemoveOrganizationFeatureIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1RemoveOrganizationFeatureIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1RemoveOrganizationFeatureResult: Codable, Sendable { + /// Resulting list of organization features. + public let features: [v1Feature] + + public init( + features: [v1Feature] + ) { + self.features = features + } +} + +public struct v1Result: Codable, Sendable { + public let acceptInvitationResult: v1AcceptInvitationResult? + public let activateBillingTierResult: billingActivateBillingTierResult? + public let createApiKeysResult: v1CreateApiKeysResult? + public let createApiOnlyUsersResult: v1CreateApiOnlyUsersResult? + public let createAuthenticatorsResult: v1CreateAuthenticatorsResult? + public let createInvitationsResult: v1CreateInvitationsResult? + public let createOauth2CredentialResult: v1CreateOauth2CredentialResult? + public let createOauthProvidersResult: v1CreateOauthProvidersResult? + public let createOrganizationResult: v1CreateOrganizationResult? + public let createPoliciesResult: v1CreatePoliciesResult? + public let createPolicyResult: v1CreatePolicyResult? + public let createPrivateKeyTagResult: v1CreatePrivateKeyTagResult? + public let createPrivateKeysResult: v1CreatePrivateKeysResult? + public let createPrivateKeysResultV2: v1CreatePrivateKeysResultV2? + public let createReadOnlySessionResult: v1CreateReadOnlySessionResult? + public let createReadWriteSessionResult: v1CreateReadWriteSessionResult? + public let createReadWriteSessionResultV2: v1CreateReadWriteSessionResultV2? + public let createSmartContractInterfaceResult: v1CreateSmartContractInterfaceResult? + public let createSubOrganizationResult: v1CreateSubOrganizationResult? + public let createSubOrganizationResultV3: v1CreateSubOrganizationResultV3? + public let createSubOrganizationResultV4: v1CreateSubOrganizationResultV4? + public let createSubOrganizationResultV5: v1CreateSubOrganizationResultV5? + public let createSubOrganizationResultV6: v1CreateSubOrganizationResultV6? + public let createSubOrganizationResultV7: v1CreateSubOrganizationResultV7? + public let createUserTagResult: v1CreateUserTagResult? + public let createUsersResult: v1CreateUsersResult? + public let createWalletAccountsResult: v1CreateWalletAccountsResult? + public let createWalletResult: v1CreateWalletResult? + public let deleteApiKeysResult: v1DeleteApiKeysResult? + public let deleteAuthenticatorsResult: v1DeleteAuthenticatorsResult? + public let deleteInvitationResult: v1DeleteInvitationResult? + public let deleteOauth2CredentialResult: v1DeleteOauth2CredentialResult? + public let deleteOauthProvidersResult: v1DeleteOauthProvidersResult? + public let deleteOrganizationResult: v1DeleteOrganizationResult? + public let deletePaymentMethodResult: billingDeletePaymentMethodResult? + public let deletePoliciesResult: v1DeletePoliciesResult? + public let deletePolicyResult: v1DeletePolicyResult? + public let deletePrivateKeyTagsResult: v1DeletePrivateKeyTagsResult? + public let deletePrivateKeysResult: v1DeletePrivateKeysResult? + public let deleteSmartContractInterfaceResult: v1DeleteSmartContractInterfaceResult? + public let deleteSubOrganizationResult: v1DeleteSubOrganizationResult? + public let deleteUserTagsResult: v1DeleteUserTagsResult? + public let deleteUsersResult: v1DeleteUsersResult? + public let deleteWalletAccountsResult: v1DeleteWalletAccountsResult? + public let deleteWalletsResult: v1DeleteWalletsResult? + public let disableAuthProxyResult: v1DisableAuthProxyResult? + public let disablePrivateKeyResult: v1DisablePrivateKeyResult? + public let emailAuthResult: v1EmailAuthResult? + public let enableAuthProxyResult: v1EnableAuthProxyResult? + public let exportPrivateKeyResult: v1ExportPrivateKeyResult? + public let exportWalletAccountResult: v1ExportWalletAccountResult? + public let exportWalletResult: v1ExportWalletResult? + public let importPrivateKeyResult: v1ImportPrivateKeyResult? + public let importWalletResult: v1ImportWalletResult? + public let initFiatOnRampResult: v1InitFiatOnRampResult? + public let initImportPrivateKeyResult: v1InitImportPrivateKeyResult? + public let initImportWalletResult: v1InitImportWalletResult? + public let initOtpAuthResult: v1InitOtpAuthResult? + public let initOtpAuthResultV2: v1InitOtpAuthResultV2? + public let initOtpResult: v1InitOtpResult? + public let initUserEmailRecoveryResult: v1InitUserEmailRecoveryResult? + public let oauth2AuthenticateResult: v1Oauth2AuthenticateResult? + public let oauthLoginResult: v1OauthLoginResult? + public let oauthResult: v1OauthResult? + public let otpAuthResult: v1OtpAuthResult? + public let otpLoginResult: v1OtpLoginResult? + public let recoverUserResult: v1RecoverUserResult? + public let removeOrganizationFeatureResult: v1RemoveOrganizationFeatureResult? + public let setOrganizationFeatureResult: v1SetOrganizationFeatureResult? + public let setPaymentMethodResult: billingSetPaymentMethodResult? + public let signRawPayloadResult: v1SignRawPayloadResult? + public let signRawPayloadsResult: v1SignRawPayloadsResult? + public let signTransactionResult: v1SignTransactionResult? + public let stampLoginResult: v1StampLoginResult? + public let updateAllowedOriginsResult: v1UpdateAllowedOriginsResult? + public let updateAuthProxyConfigResult: v1UpdateAuthProxyConfigResult? + public let updateOauth2CredentialResult: v1UpdateOauth2CredentialResult? + public let updatePolicyResult: v1UpdatePolicyResult? + public let updatePolicyResultV2: v1UpdatePolicyResultV2? + public let updatePrivateKeyTagResult: v1UpdatePrivateKeyTagResult? + public let updateRootQuorumResult: v1UpdateRootQuorumResult? + public let updateUserEmailResult: v1UpdateUserEmailResult? + public let updateUserNameResult: v1UpdateUserNameResult? + public let updateUserPhoneNumberResult: v1UpdateUserPhoneNumberResult? + public let updateUserResult: v1UpdateUserResult? + public let updateUserTagResult: v1UpdateUserTagResult? + public let updateWalletResult: v1UpdateWalletResult? + public let verifyOtpResult: v1VerifyOtpResult? + + public init( + acceptInvitationResult: v1AcceptInvitationResult? = nil, + activateBillingTierResult: billingActivateBillingTierResult? = nil, + createApiKeysResult: v1CreateApiKeysResult? = nil, + createApiOnlyUsersResult: v1CreateApiOnlyUsersResult? = nil, + createAuthenticatorsResult: v1CreateAuthenticatorsResult? = nil, + createInvitationsResult: v1CreateInvitationsResult? = nil, + createOauth2CredentialResult: v1CreateOauth2CredentialResult? = nil, + createOauthProvidersResult: v1CreateOauthProvidersResult? = nil, + createOrganizationResult: v1CreateOrganizationResult? = nil, + createPoliciesResult: v1CreatePoliciesResult? = nil, + createPolicyResult: v1CreatePolicyResult? = nil, + createPrivateKeyTagResult: v1CreatePrivateKeyTagResult? = nil, + createPrivateKeysResult: v1CreatePrivateKeysResult? = nil, + createPrivateKeysResultV2: v1CreatePrivateKeysResultV2? = nil, + createReadOnlySessionResult: v1CreateReadOnlySessionResult? = nil, + createReadWriteSessionResult: v1CreateReadWriteSessionResult? = nil, + createReadWriteSessionResultV2: v1CreateReadWriteSessionResultV2? = nil, + createSmartContractInterfaceResult: v1CreateSmartContractInterfaceResult? = nil, + createSubOrganizationResult: v1CreateSubOrganizationResult? = nil, + createSubOrganizationResultV3: v1CreateSubOrganizationResultV3? = nil, + createSubOrganizationResultV4: v1CreateSubOrganizationResultV4? = nil, + createSubOrganizationResultV5: v1CreateSubOrganizationResultV5? = nil, + createSubOrganizationResultV6: v1CreateSubOrganizationResultV6? = nil, + createSubOrganizationResultV7: v1CreateSubOrganizationResultV7? = nil, + createUserTagResult: v1CreateUserTagResult? = nil, + createUsersResult: v1CreateUsersResult? = nil, + createWalletAccountsResult: v1CreateWalletAccountsResult? = nil, + createWalletResult: v1CreateWalletResult? = nil, + deleteApiKeysResult: v1DeleteApiKeysResult? = nil, + deleteAuthenticatorsResult: v1DeleteAuthenticatorsResult? = nil, + deleteInvitationResult: v1DeleteInvitationResult? = nil, + deleteOauth2CredentialResult: v1DeleteOauth2CredentialResult? = nil, + deleteOauthProvidersResult: v1DeleteOauthProvidersResult? = nil, + deleteOrganizationResult: v1DeleteOrganizationResult? = nil, + deletePaymentMethodResult: billingDeletePaymentMethodResult? = nil, + deletePoliciesResult: v1DeletePoliciesResult? = nil, + deletePolicyResult: v1DeletePolicyResult? = nil, + deletePrivateKeyTagsResult: v1DeletePrivateKeyTagsResult? = nil, + deletePrivateKeysResult: v1DeletePrivateKeysResult? = nil, + deleteSmartContractInterfaceResult: v1DeleteSmartContractInterfaceResult? = nil, + deleteSubOrganizationResult: v1DeleteSubOrganizationResult? = nil, + deleteUserTagsResult: v1DeleteUserTagsResult? = nil, + deleteUsersResult: v1DeleteUsersResult? = nil, + deleteWalletAccountsResult: v1DeleteWalletAccountsResult? = nil, + deleteWalletsResult: v1DeleteWalletsResult? = nil, + disableAuthProxyResult: v1DisableAuthProxyResult? = nil, + disablePrivateKeyResult: v1DisablePrivateKeyResult? = nil, + emailAuthResult: v1EmailAuthResult? = nil, + enableAuthProxyResult: v1EnableAuthProxyResult? = nil, + exportPrivateKeyResult: v1ExportPrivateKeyResult? = nil, + exportWalletAccountResult: v1ExportWalletAccountResult? = nil, + exportWalletResult: v1ExportWalletResult? = nil, + importPrivateKeyResult: v1ImportPrivateKeyResult? = nil, + importWalletResult: v1ImportWalletResult? = nil, + initFiatOnRampResult: v1InitFiatOnRampResult? = nil, + initImportPrivateKeyResult: v1InitImportPrivateKeyResult? = nil, + initImportWalletResult: v1InitImportWalletResult? = nil, + initOtpAuthResult: v1InitOtpAuthResult? = nil, + initOtpAuthResultV2: v1InitOtpAuthResultV2? = nil, + initOtpResult: v1InitOtpResult? = nil, + initUserEmailRecoveryResult: v1InitUserEmailRecoveryResult? = nil, + oauth2AuthenticateResult: v1Oauth2AuthenticateResult? = nil, + oauthLoginResult: v1OauthLoginResult? = nil, + oauthResult: v1OauthResult? = nil, + otpAuthResult: v1OtpAuthResult? = nil, + otpLoginResult: v1OtpLoginResult? = nil, + recoverUserResult: v1RecoverUserResult? = nil, + removeOrganizationFeatureResult: v1RemoveOrganizationFeatureResult? = nil, + setOrganizationFeatureResult: v1SetOrganizationFeatureResult? = nil, + setPaymentMethodResult: billingSetPaymentMethodResult? = nil, + signRawPayloadResult: v1SignRawPayloadResult? = nil, + signRawPayloadsResult: v1SignRawPayloadsResult? = nil, + signTransactionResult: v1SignTransactionResult? = nil, + stampLoginResult: v1StampLoginResult? = nil, + updateAllowedOriginsResult: v1UpdateAllowedOriginsResult? = nil, + updateAuthProxyConfigResult: v1UpdateAuthProxyConfigResult? = nil, + updateOauth2CredentialResult: v1UpdateOauth2CredentialResult? = nil, + updatePolicyResult: v1UpdatePolicyResult? = nil, + updatePolicyResultV2: v1UpdatePolicyResultV2? = nil, + updatePrivateKeyTagResult: v1UpdatePrivateKeyTagResult? = nil, + updateRootQuorumResult: v1UpdateRootQuorumResult? = nil, + updateUserEmailResult: v1UpdateUserEmailResult? = nil, + updateUserNameResult: v1UpdateUserNameResult? = nil, + updateUserPhoneNumberResult: v1UpdateUserPhoneNumberResult? = nil, + updateUserResult: v1UpdateUserResult? = nil, + updateUserTagResult: v1UpdateUserTagResult? = nil, + updateWalletResult: v1UpdateWalletResult? = nil, + verifyOtpResult: v1VerifyOtpResult? = nil + ) { + self.acceptInvitationResult = acceptInvitationResult + self.activateBillingTierResult = activateBillingTierResult + self.createApiKeysResult = createApiKeysResult + self.createApiOnlyUsersResult = createApiOnlyUsersResult + self.createAuthenticatorsResult = createAuthenticatorsResult + self.createInvitationsResult = createInvitationsResult + self.createOauth2CredentialResult = createOauth2CredentialResult + self.createOauthProvidersResult = createOauthProvidersResult + self.createOrganizationResult = createOrganizationResult + self.createPoliciesResult = createPoliciesResult + self.createPolicyResult = createPolicyResult + self.createPrivateKeyTagResult = createPrivateKeyTagResult + self.createPrivateKeysResult = createPrivateKeysResult + self.createPrivateKeysResultV2 = createPrivateKeysResultV2 + self.createReadOnlySessionResult = createReadOnlySessionResult + self.createReadWriteSessionResult = createReadWriteSessionResult + self.createReadWriteSessionResultV2 = createReadWriteSessionResultV2 + self.createSmartContractInterfaceResult = createSmartContractInterfaceResult + self.createSubOrganizationResult = createSubOrganizationResult + self.createSubOrganizationResultV3 = createSubOrganizationResultV3 + self.createSubOrganizationResultV4 = createSubOrganizationResultV4 + self.createSubOrganizationResultV5 = createSubOrganizationResultV5 + self.createSubOrganizationResultV6 = createSubOrganizationResultV6 + self.createSubOrganizationResultV7 = createSubOrganizationResultV7 + self.createUserTagResult = createUserTagResult + self.createUsersResult = createUsersResult + self.createWalletAccountsResult = createWalletAccountsResult + self.createWalletResult = createWalletResult + self.deleteApiKeysResult = deleteApiKeysResult + self.deleteAuthenticatorsResult = deleteAuthenticatorsResult + self.deleteInvitationResult = deleteInvitationResult + self.deleteOauth2CredentialResult = deleteOauth2CredentialResult + self.deleteOauthProvidersResult = deleteOauthProvidersResult + self.deleteOrganizationResult = deleteOrganizationResult + self.deletePaymentMethodResult = deletePaymentMethodResult + self.deletePoliciesResult = deletePoliciesResult + self.deletePolicyResult = deletePolicyResult + self.deletePrivateKeyTagsResult = deletePrivateKeyTagsResult + self.deletePrivateKeysResult = deletePrivateKeysResult + self.deleteSmartContractInterfaceResult = deleteSmartContractInterfaceResult + self.deleteSubOrganizationResult = deleteSubOrganizationResult + self.deleteUserTagsResult = deleteUserTagsResult + self.deleteUsersResult = deleteUsersResult + self.deleteWalletAccountsResult = deleteWalletAccountsResult + self.deleteWalletsResult = deleteWalletsResult + self.disableAuthProxyResult = disableAuthProxyResult + self.disablePrivateKeyResult = disablePrivateKeyResult + self.emailAuthResult = emailAuthResult + self.enableAuthProxyResult = enableAuthProxyResult + self.exportPrivateKeyResult = exportPrivateKeyResult + self.exportWalletAccountResult = exportWalletAccountResult + self.exportWalletResult = exportWalletResult + self.importPrivateKeyResult = importPrivateKeyResult + self.importWalletResult = importWalletResult + self.initFiatOnRampResult = initFiatOnRampResult + self.initImportPrivateKeyResult = initImportPrivateKeyResult + self.initImportWalletResult = initImportWalletResult + self.initOtpAuthResult = initOtpAuthResult + self.initOtpAuthResultV2 = initOtpAuthResultV2 + self.initOtpResult = initOtpResult + self.initUserEmailRecoveryResult = initUserEmailRecoveryResult + self.oauth2AuthenticateResult = oauth2AuthenticateResult + self.oauthLoginResult = oauthLoginResult + self.oauthResult = oauthResult + self.otpAuthResult = otpAuthResult + self.otpLoginResult = otpLoginResult + self.recoverUserResult = recoverUserResult + self.removeOrganizationFeatureResult = removeOrganizationFeatureResult + self.setOrganizationFeatureResult = setOrganizationFeatureResult + self.setPaymentMethodResult = setPaymentMethodResult + self.signRawPayloadResult = signRawPayloadResult + self.signRawPayloadsResult = signRawPayloadsResult + self.signTransactionResult = signTransactionResult + self.stampLoginResult = stampLoginResult + self.updateAllowedOriginsResult = updateAllowedOriginsResult + self.updateAuthProxyConfigResult = updateAuthProxyConfigResult + self.updateOauth2CredentialResult = updateOauth2CredentialResult + self.updatePolicyResult = updatePolicyResult + self.updatePolicyResultV2 = updatePolicyResultV2 + self.updatePrivateKeyTagResult = updatePrivateKeyTagResult + self.updateRootQuorumResult = updateRootQuorumResult + self.updateUserEmailResult = updateUserEmailResult + self.updateUserNameResult = updateUserNameResult + self.updateUserPhoneNumberResult = updateUserPhoneNumberResult + self.updateUserResult = updateUserResult + self.updateUserTagResult = updateUserTagResult + self.updateWalletResult = updateWalletResult + self.verifyOtpResult = verifyOtpResult + } +} + +public struct v1RootUserParams: Codable, Sendable { + /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. + public let apiKeys: [apiApiKeyParams] + /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. + public let authenticators: [v1AuthenticatorParamsV2] + /// The user's email address. + public let userEmail: String? + /// Human-readable name for a User. + public let userName: String + + public init( + apiKeys: [apiApiKeyParams], + authenticators: [v1AuthenticatorParamsV2], + userEmail: String? = nil, + userName: String + ) { + self.apiKeys = apiKeys + self.authenticators = authenticators + self.userEmail = userEmail + self.userName = userName + } +} + +public struct v1RootUserParamsV2: Codable, Sendable { + /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. + public let apiKeys: [apiApiKeyParams] + /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. + public let authenticators: [v1AuthenticatorParamsV2] + /// A list of Oauth providers. This field, if not needed, should be an empty array in your request body. + public let oauthProviders: [v1OauthProviderParams] + /// The user's email address. + public let userEmail: String? + /// Human-readable name for a User. + public let userName: String + + public init( + apiKeys: [apiApiKeyParams], + authenticators: [v1AuthenticatorParamsV2], + oauthProviders: [v1OauthProviderParams], + userEmail: String? = nil, + userName: String + ) { + self.apiKeys = apiKeys + self.authenticators = authenticators + self.oauthProviders = oauthProviders + self.userEmail = userEmail + self.userName = userName + } +} + +public struct v1RootUserParamsV3: Codable, Sendable { + /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. + public let apiKeys: [v1ApiKeyParamsV2] + /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. + public let authenticators: [v1AuthenticatorParamsV2] + /// A list of Oauth providers. This field, if not needed, should be an empty array in your request body. + public let oauthProviders: [v1OauthProviderParams] + /// The user's email address. + public let userEmail: String? + /// Human-readable name for a User. + public let userName: String + + public init( + apiKeys: [v1ApiKeyParamsV2], + authenticators: [v1AuthenticatorParamsV2], + oauthProviders: [v1OauthProviderParams], + userEmail: String? = nil, + userName: String + ) { + self.apiKeys = apiKeys + self.authenticators = authenticators + self.oauthProviders = oauthProviders + self.userEmail = userEmail + self.userName = userName + } +} + +public struct v1RootUserParamsV4: Codable, Sendable { + /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. + public let apiKeys: [v1ApiKeyParamsV2] + /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. + public let authenticators: [v1AuthenticatorParamsV2] + /// A list of Oauth providers. This field, if not needed, should be an empty array in your request body. + public let oauthProviders: [v1OauthProviderParams] + /// The user's email address. + public let userEmail: String? + /// Human-readable name for a User. + public let userName: String + /// The user's phone number in E.164 format e.g. +13214567890 + public let userPhoneNumber: String? + + public init( + apiKeys: [v1ApiKeyParamsV2], + authenticators: [v1AuthenticatorParamsV2], + oauthProviders: [v1OauthProviderParams], + userEmail: String? = nil, + userName: String, + userPhoneNumber: String? = nil + ) { + self.apiKeys = apiKeys + self.authenticators = authenticators + self.oauthProviders = oauthProviders + self.userEmail = userEmail + self.userName = userName + self.userPhoneNumber = userPhoneNumber + } +} + +public struct v1Selector: Codable, Sendable { + public let _operator: v1Operator? + public let subject: String? + public let target: String? + + public init( + _operator: v1Operator? = nil, + subject: String? = nil, + target: String? = nil + ) { + self._operator = _operator + self.subject = subject + self.target = target + } + + private enum CodingKeys: String, CodingKey { + case _operator = "operator" + case subject = "subject" + case target = "target" + } +} + +public struct v1SelectorV2: Codable, Sendable { + public let _operator: v1Operator? + public let subject: String? + public let targets: [String]? + + public init( + _operator: v1Operator? = nil, + subject: String? = nil, + targets: [String]? = nil + ) { + self._operator = _operator + self.subject = subject + self.targets = targets + } + + private enum CodingKeys: String, CodingKey { + case _operator = "operator" + case subject = "subject" + case targets = "targets" + } +} + +public struct v1SetOrganizationFeatureIntent: Codable, Sendable { + /// Name of the feature to set + public let name: v1FeatureName + /// Optional value for the feature. Will override existing values if feature is already set. + public let value: String + + public init( + name: v1FeatureName, + value: String + ) { + self.name = name + self.value = value + } +} + +public struct v1SetOrganizationFeatureRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1SetOrganizationFeatureIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1SetOrganizationFeatureIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1SetOrganizationFeatureResult: Codable, Sendable { + /// Resulting list of organization features. + public let features: [v1Feature] + + public init( + features: [v1Feature] + ) { + self.features = features + } +} + +public struct v1SignRawPayloadIntent: Codable, Sendable { + /// Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8). + public let encoding: v1PayloadEncoding + /// Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032. + public let hashFunction: v1HashFunction + /// Raw unsigned payload to be signed. + public let payload: String + /// Unique identifier for a given Private Key. + public let privateKeyId: String + + public init( + encoding: v1PayloadEncoding, + hashFunction: v1HashFunction, + payload: String, + privateKeyId: String + ) { + self.encoding = encoding + self.hashFunction = hashFunction + self.payload = payload + self.privateKeyId = privateKeyId + } +} + +public struct v1SignRawPayloadIntentV2: Codable, Sendable { + /// Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8). + public let encoding: v1PayloadEncoding + /// Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032. + public let hashFunction: v1HashFunction + /// Raw unsigned payload to be signed. + public let payload: String + /// A Wallet account address, Private Key address, or Private Key identifier. + public let signWith: String + + public init( + encoding: v1PayloadEncoding, + hashFunction: v1HashFunction, + payload: String, + signWith: String + ) { + self.encoding = encoding + self.hashFunction = hashFunction + self.payload = payload + self.signWith = signWith + } +} + +public struct v1SignRawPayloadRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1SignRawPayloadIntentV2 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1SignRawPayloadIntentV2, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1SignRawPayloadResult: Codable, Sendable { + /// Component of an ECSDA signature. + public let r: String + /// Component of an ECSDA signature. + public let s: String + /// Component of an ECSDA signature. + public let v: String + + public init( + r: String, + s: String, + v: String + ) { + self.r = r + self.s = s + self.v = v + } +} + +public struct v1SignRawPayloadsIntent: Codable, Sendable { + /// Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8). + public let encoding: v1PayloadEncoding + /// Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032. + public let hashFunction: v1HashFunction + /// An array of raw unsigned payloads to be signed. + public let payloads: [String] + /// A Wallet account address, Private Key address, or Private Key identifier. + public let signWith: String + + public init( + encoding: v1PayloadEncoding, + hashFunction: v1HashFunction, + payloads: [String], + signWith: String + ) { + self.encoding = encoding + self.hashFunction = hashFunction + self.payloads = payloads + self.signWith = signWith + } +} + +public struct v1SignRawPayloadsRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1SignRawPayloadsIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1SignRawPayloadsIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1SignRawPayloadsResult: Codable, Sendable { + public let signatures: [v1SignRawPayloadResult]? + + public init( + signatures: [v1SignRawPayloadResult]? = nil + ) { + self.signatures = signatures + } +} + +public struct v1SignTransactionIntent: Codable, Sendable { + /// Unique identifier for a given Private Key. + public let privateKeyId: String + public let type: v1TransactionType + /// Raw unsigned transaction to be signed by a particular Private Key. + public let unsignedTransaction: String + + public init( + privateKeyId: String, + type: v1TransactionType, + unsignedTransaction: String + ) { + self.privateKeyId = privateKeyId + self.type = type + self.unsignedTransaction = unsignedTransaction + } +} + +public struct v1SignTransactionIntentV2: Codable, Sendable { + /// A Wallet account address, Private Key address, or Private Key identifier. + public let signWith: String + public let type: v1TransactionType + /// Raw unsigned transaction to be signed + public let unsignedTransaction: String + + public init( + signWith: String, + type: v1TransactionType, + unsignedTransaction: String + ) { + self.signWith = signWith + self.type = type + self.unsignedTransaction = unsignedTransaction + } +} + +public struct v1SignTransactionRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1SignTransactionIntentV2 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1SignTransactionIntentV2, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1SignTransactionResult: Codable, Sendable { + public let signedTransaction: String + + public init( + signedTransaction: String + ) { + self.signedTransaction = signedTransaction + } +} + +public enum v1SignatureScheme: String, Codable, Sendable { + case signature_scheme_ephemeral_key_p256 = "SIGNATURE_SCHEME_EPHEMERAL_KEY_P256" +} + +public struct v1SimpleClientExtensionResults: Codable, Sendable { + public let appid: Bool? + public let appidExclude: Bool? + public let credProps: v1CredPropsAuthenticationExtensionsClientOutputs? + + public init( + appid: Bool? = nil, + appidExclude: Bool? = nil, + credProps: v1CredPropsAuthenticationExtensionsClientOutputs? = nil + ) { + self.appid = appid + self.appidExclude = appidExclude + self.credProps = credProps + } +} + +public struct v1SmartContractInterface: Codable, Sendable { + public let createdAt: externaldatav1Timestamp + /// The label corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA). + public let label: String + /// The notes corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA). + public let notes: String + /// The Organization the Smart Contract Interface belongs to. + public let organizationId: String + /// The address corresponding to the Smart Contract or Program. + public let smartContractAddress: String + /// The JSON corresponding to the Smart Contract Interface (ABI or IDL). + public let smartContractInterface: String + /// Unique identifier for a given Smart Contract Interface (ABI or IDL). + public let smartContractInterfaceId: String + /// The type corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA). + public let type: String + public let updatedAt: externaldatav1Timestamp + + public init( + createdAt: externaldatav1Timestamp, + label: String, + notes: String, + organizationId: String, + smartContractAddress: String, + smartContractInterface: String, + smartContractInterfaceId: String, + type: String, + updatedAt: externaldatav1Timestamp + ) { + self.createdAt = createdAt + self.label = label + self.notes = notes + self.organizationId = organizationId + self.smartContractAddress = smartContractAddress + self.smartContractInterface = smartContractInterface + self.smartContractInterfaceId = smartContractInterfaceId + self.type = type + self.updatedAt = updatedAt + } +} + +public struct v1SmartContractInterfaceReference: Codable, Sendable { + public let digest: String? + public let smartContractAddress: String? + public let smartContractInterfaceId: String? + + public init( + digest: String? = nil, + smartContractAddress: String? = nil, + smartContractInterfaceId: String? = nil + ) { + self.digest = digest + self.smartContractAddress = smartContractAddress + self.smartContractInterfaceId = smartContractInterfaceId + } +} + +public enum v1SmartContractInterfaceType: String, Codable, Sendable { + case smart_contract_interface_type_ethereum = "SMART_CONTRACT_INTERFACE_TYPE_ETHEREUM" + case smart_contract_interface_type_solana = "SMART_CONTRACT_INTERFACE_TYPE_SOLANA" +} + +public struct v1SmsCustomizationParams: Codable, Sendable { + /// Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}} + public let template: String? + + public init( + template: String? = nil + ) { + self.template = template + } +} + +public struct v1StampLoginIntent: Codable, Sendable { + /// Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated Login API keys + public let invalidateExisting: Bool? + /// Client-side public key generated by the user, which will be conditionally added to org data based on the passkey stamp associated with this request + public let publicKey: String + + public init( + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + publicKey: String + ) { + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.publicKey = publicKey + } +} + +public struct v1StampLoginRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1StampLoginIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1StampLoginIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1StampLoginResult: Codable, Sendable { + /// Signed JWT containing an expiry, public key, session type, user id, and organization id + public let session: String + + public init( + session: String + ) { + self.session = session + } +} + +public enum v1TagType: String, Codable, Sendable { + case tag_type_user = "TAG_TYPE_USER" + case tag_type_private_key = "TAG_TYPE_PRIVATE_KEY" +} + +public struct v1TestRateLimitsRequest: Codable, Sendable { + /// Whether or not to set a limit on this request. + public let isSetLimit: Bool + /// Rate limit to set for org, if is_set_limit is set to true. + public let limit: Int + /// Unique identifier for a given organization. If the request is being made by a WebAuthN user and their sub-organization ID is unknown, this can be the parent organization ID; using the sub-organization ID when possible is preferred due to performance reasons. + public let organizationId: String + + public init( + isSetLimit: Bool, + limit: Int, + organizationId: String + ) { + self.isSetLimit = isSetLimit + self.limit = limit + self.organizationId = organizationId + } +} + +public struct v1TestRateLimitsResponse: Codable, Sendable { + public init() {} +} + +public enum v1TransactionType: String, Codable, Sendable { + case transaction_type_ethereum = "TRANSACTION_TYPE_ETHEREUM" + case transaction_type_solana = "TRANSACTION_TYPE_SOLANA" + case transaction_type_tron = "TRANSACTION_TYPE_TRON" + case transaction_type_bitcoin = "TRANSACTION_TYPE_BITCOIN" +} + +public struct v1UpdateAllowedOriginsIntent: Codable, Sendable { + /// Additional origins requests are allowed from besides Turnkey origins + public let allowedOrigins: [String] + + public init( + allowedOrigins: [String] + ) { + self.allowedOrigins = allowedOrigins + } +} + +public struct v1UpdateAllowedOriginsResult: Codable, Sendable { + public init() {} +} + +public struct v1UpdateAuthProxyConfigIntent: Codable, Sendable { + /// Updated list of allowed proxy authentication methods. + public let allowedAuthMethods: [String]? + /// Updated list of allowed origins for CORS. + public let allowedOrigins: [String]? + /// Template ID for email-auth messages. + public let emailAuthTemplateId: String? + /// Overrides for auth-related email content. + public let emailCustomizationParams: v1EmailCustomizationParams? + /// Enable alphanumeric OTP codes. + public let otpAlphanumeric: Bool? + /// OTP code lifetime in seconds. + public let otpExpirationSeconds: Int? + /// Desired OTP code length (6–9). + public let otpLength: Int? + /// Template ID for OTP SMS messages. + public let otpTemplateId: String? + /// Custom reply-to address for auth-related emails. + public let replyToEmailAddress: String? + /// Custom 'from' address for auth-related emails. + public let sendFromEmailAddress: String? + /// Custom 'from' email sender for auth-related emails. + public let sendFromEmailSenderName: String? + /// Session lifetime in seconds. + public let sessionExpirationSeconds: Int? + /// Overrides for auth-related SMS content. + public let smsCustomizationParams: v1SmsCustomizationParams? + /// Verification-token lifetime in seconds. + public let verificationTokenExpirationSeconds: Int? + /// Verification token required for get account with PII (email/phone number). Default false. + public let verificationTokenRequiredForGetAccountPii: Bool? + /// Overrides for react wallet kit related settings. + public let walletKitSettings: v1WalletKitSettingsParams? + + public init( + allowedAuthMethods: [String]? = nil, + allowedOrigins: [String]? = nil, + emailAuthTemplateId: String? = nil, + emailCustomizationParams: v1EmailCustomizationParams? = nil, + otpAlphanumeric: Bool? = nil, + otpExpirationSeconds: Int? = nil, + otpLength: Int? = nil, + otpTemplateId: String? = nil, + replyToEmailAddress: String? = nil, + sendFromEmailAddress: String? = nil, + sendFromEmailSenderName: String? = nil, + sessionExpirationSeconds: Int? = nil, + smsCustomizationParams: v1SmsCustomizationParams? = nil, + verificationTokenExpirationSeconds: Int? = nil, + verificationTokenRequiredForGetAccountPii: Bool? = nil, + walletKitSettings: v1WalletKitSettingsParams? = nil + ) { + self.allowedAuthMethods = allowedAuthMethods + self.allowedOrigins = allowedOrigins + self.emailAuthTemplateId = emailAuthTemplateId + self.emailCustomizationParams = emailCustomizationParams + self.otpAlphanumeric = otpAlphanumeric + self.otpExpirationSeconds = otpExpirationSeconds + self.otpLength = otpLength + self.otpTemplateId = otpTemplateId + self.replyToEmailAddress = replyToEmailAddress + self.sendFromEmailAddress = sendFromEmailAddress + self.sendFromEmailSenderName = sendFromEmailSenderName + self.sessionExpirationSeconds = sessionExpirationSeconds + self.smsCustomizationParams = smsCustomizationParams + self.verificationTokenExpirationSeconds = verificationTokenExpirationSeconds + self.verificationTokenRequiredForGetAccountPii = verificationTokenRequiredForGetAccountPii + self.walletKitSettings = walletKitSettings + } +} + +public struct v1UpdateAuthProxyConfigResult: Codable, Sendable { + /// Unique identifier for a given User. (representing the turnkey signer user id) + public let configId: String? + + public init( + configId: String? = nil + ) { + self.configId = configId + } +} + +public struct v1UpdateOauth2CredentialIntent: Codable, Sendable { + /// The Client ID issued by the OAuth 2.0 provider + public let clientId: String + /// The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key + public let encryptedClientSecret: String + /// The ID of the OAuth 2.0 credential to update + public let oauth2CredentialId: String + /// The OAuth 2.0 provider + public let provider: v1Oauth2Provider + + public init( + clientId: String, + encryptedClientSecret: String, + oauth2CredentialId: String, + provider: v1Oauth2Provider + ) { + self.clientId = clientId + self.encryptedClientSecret = encryptedClientSecret + self.oauth2CredentialId = oauth2CredentialId + self.provider = provider + } +} + +public struct v1UpdateOauth2CredentialRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1UpdateOauth2CredentialIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1UpdateOauth2CredentialIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1UpdateOauth2CredentialResult: Codable, Sendable { + /// Unique identifier of the OAuth 2.0 credential that was updated + public let oauth2CredentialId: String + + public init( + oauth2CredentialId: String + ) { + self.oauth2CredentialId = oauth2CredentialId + } +} + +public struct v1UpdatePolicyIntent: Codable, Sendable { + /// The condition expression that triggers the Effect (optional). + public let policyCondition: String? + /// The consensus expression that triggers the Effect (optional). + public let policyConsensus: String? + /// The instruction to DENY or ALLOW an activity (optional). + public let policyEffect: v1Effect? + /// Unique identifier for a given Policy. + public let policyId: String + /// Human-readable name for a Policy. + public let policyName: String? + /// Accompanying notes for a Policy (optional). + public let policyNotes: String? + + public init( + policyCondition: String? = nil, + policyConsensus: String? = nil, + policyEffect: v1Effect? = nil, + policyId: String, + policyName: String? = nil, + policyNotes: String? = nil + ) { + self.policyCondition = policyCondition + self.policyConsensus = policyConsensus + self.policyEffect = policyEffect + self.policyId = policyId + self.policyName = policyName + self.policyNotes = policyNotes + } +} + +public struct v1UpdatePolicyIntentV2: Codable, Sendable { + /// The condition expression that triggers the Effect (optional). + public let policyCondition: String? + /// The consensus expression that triggers the Effect (optional). + public let policyConsensus: String? + /// The instruction to DENY or ALLOW an activity (optional). + public let policyEffect: v1Effect? + /// Unique identifier for a given Policy. + public let policyId: String + /// Human-readable name for a Policy. + public let policyName: String? + /// Accompanying notes for a Policy (optional). + public let policyNotes: String? + + public init( + policyCondition: String? = nil, + policyConsensus: String? = nil, + policyEffect: v1Effect? = nil, + policyId: String, + policyName: String? = nil, + policyNotes: String? = nil + ) { + self.policyCondition = policyCondition + self.policyConsensus = policyConsensus + self.policyEffect = policyEffect + self.policyId = policyId + self.policyName = policyName + self.policyNotes = policyNotes + } +} + +public struct v1UpdatePolicyRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1UpdatePolicyIntentV2 + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1UpdatePolicyIntentV2, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1UpdatePolicyResult: Codable, Sendable { + /// Unique identifier for a given Policy. + public let policyId: String + + public init( + policyId: String + ) { + self.policyId = policyId + } +} + +public struct v1UpdatePolicyResultV2: Codable, Sendable { + /// Unique identifier for a given Policy. + public let policyId: String + + public init( + policyId: String + ) { + self.policyId = policyId + } +} + +public struct v1UpdatePrivateKeyTagIntent: Codable, Sendable { + /// A list of Private Keys IDs to add this tag to. + public let addPrivateKeyIds: [String] + /// The new, human-readable name for the tag with the given ID. + public let newPrivateKeyTagName: String? + /// Unique identifier for a given Private Key Tag. + public let privateKeyTagId: String + /// A list of Private Key IDs to remove this tag from. + public let removePrivateKeyIds: [String] + + public init( + addPrivateKeyIds: [String], + newPrivateKeyTagName: String? = nil, + privateKeyTagId: String, + removePrivateKeyIds: [String] + ) { + self.addPrivateKeyIds = addPrivateKeyIds + self.newPrivateKeyTagName = newPrivateKeyTagName + self.privateKeyTagId = privateKeyTagId + self.removePrivateKeyIds = removePrivateKeyIds + } +} + +public struct v1UpdatePrivateKeyTagRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1UpdatePrivateKeyTagIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1UpdatePrivateKeyTagIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1UpdatePrivateKeyTagResult: Codable, Sendable { + /// Unique identifier for a given Private Key Tag. + public let privateKeyTagId: String + + public init( + privateKeyTagId: String + ) { + self.privateKeyTagId = privateKeyTagId + } +} + +public struct v1UpdateRootQuorumIntent: Codable, Sendable { + /// The threshold of unique approvals to reach quorum. + public let threshold: Int + /// The unique identifiers of users who comprise the quorum set. + public let userIds: [String] + + public init( + threshold: Int, + userIds: [String] + ) { + self.threshold = threshold + self.userIds = userIds + } +} + +public struct v1UpdateRootQuorumRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1UpdateRootQuorumIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1UpdateRootQuorumIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1UpdateRootQuorumResult: Codable, Sendable { + public init() {} +} + +public struct v1UpdateUserEmailIntent: Codable, Sendable { + /// The user's email address. Setting this to an empty string will remove the user's email. + public let userEmail: String + /// Unique identifier for a given User. + public let userId: String + /// Signed JWT containing a unique id, expiry, verification type, contact + public let verificationToken: String? + + public init( + userEmail: String, + userId: String, + verificationToken: String? = nil + ) { + self.userEmail = userEmail + self.userId = userId + self.verificationToken = verificationToken + } +} + +public struct v1UpdateUserEmailRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1UpdateUserEmailIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1UpdateUserEmailIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1UpdateUserEmailResult: Codable, Sendable { + /// Unique identifier of the User whose email was updated. + public let userId: String + + public init( + userId: String + ) { + self.userId = userId + } +} + +public struct v1UpdateUserIntent: Codable, Sendable { + /// The user's email address. + public let userEmail: String? + /// Unique identifier for a given User. + public let userId: String + /// Human-readable name for a User. + public let userName: String? + /// The user's phone number in E.164 format e.g. +13214567890 + public let userPhoneNumber: String? + /// An updated list of User Tags to apply to this User. This field, if not needed, should be an empty array in your request body. + public let userTagIds: [String]? + + public init( + userEmail: String? = nil, + userId: String, + userName: String? = nil, + userPhoneNumber: String? = nil, + userTagIds: [String]? = nil + ) { + self.userEmail = userEmail + self.userId = userId + self.userName = userName + self.userPhoneNumber = userPhoneNumber + self.userTagIds = userTagIds + } +} + +public struct v1UpdateUserNameIntent: Codable, Sendable { + /// Unique identifier for a given User. + public let userId: String + /// Human-readable name for a User. + public let userName: String + + public init( + userId: String, + userName: String + ) { + self.userId = userId + self.userName = userName + } +} + +public struct v1UpdateUserNameRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1UpdateUserNameIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1UpdateUserNameIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1UpdateUserNameResult: Codable, Sendable { + /// Unique identifier of the User whose name was updated. + public let userId: String + + public init( + userId: String + ) { + self.userId = userId + } +} + +public struct v1UpdateUserPhoneNumberIntent: Codable, Sendable { + /// Unique identifier for a given User. + public let userId: String + /// The user's phone number in E.164 format e.g. +13214567890. Setting this to an empty string will remove the user's phone number. + public let userPhoneNumber: String + /// Signed JWT containing a unique id, expiry, verification type, contact + public let verificationToken: String? + + public init( + userId: String, + userPhoneNumber: String, + verificationToken: String? = nil + ) { + self.userId = userId + self.userPhoneNumber = userPhoneNumber + self.verificationToken = verificationToken + } +} + +public struct v1UpdateUserPhoneNumberRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1UpdateUserPhoneNumberIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1UpdateUserPhoneNumberIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1UpdateUserPhoneNumberResult: Codable, Sendable { + /// Unique identifier of the User whose phone number was updated. + public let userId: String + + public init( + userId: String + ) { + self.userId = userId + } +} + +public struct v1UpdateUserRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1UpdateUserIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1UpdateUserIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1UpdateUserResult: Codable, Sendable { + /// A User ID. + public let userId: String + + public init( + userId: String + ) { + self.userId = userId + } +} + +public struct v1UpdateUserTagIntent: Codable, Sendable { + /// A list of User IDs to add this tag to. + public let addUserIds: [String] + /// The new, human-readable name for the tag with the given ID. + public let newUserTagName: String? + /// A list of User IDs to remove this tag from. + public let removeUserIds: [String] + /// Unique identifier for a given User Tag. + public let userTagId: String + + public init( + addUserIds: [String], + newUserTagName: String? = nil, + removeUserIds: [String], + userTagId: String + ) { + self.addUserIds = addUserIds + self.newUserTagName = newUserTagName + self.removeUserIds = removeUserIds + self.userTagId = userTagId + } +} + +public struct v1UpdateUserTagRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1UpdateUserTagIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1UpdateUserTagIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1UpdateUserTagResult: Codable, Sendable { + /// Unique identifier for a given User Tag. + public let userTagId: String + + public init( + userTagId: String + ) { + self.userTagId = userTagId + } +} + +public struct v1UpdateWalletIntent: Codable, Sendable { + /// Unique identifier for a given Wallet. + public let walletId: String + /// Human-readable name for a Wallet. + public let walletName: String? + + public init( + walletId: String, + walletName: String? = nil + ) { + self.walletId = walletId + self.walletName = walletName + } +} + +public struct v1UpdateWalletRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1UpdateWalletIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1UpdateWalletIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1UpdateWalletResult: Codable, Sendable { + /// A Wallet ID. + public let walletId: String + + public init( + walletId: String + ) { + self.walletId = walletId + } +} + +public struct v1User: Codable, Sendable { + /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. + public let apiKeys: [v1ApiKey] + /// A list of Authenticator parameters. + public let authenticators: [v1Authenticator] + public let createdAt: externaldatav1Timestamp + /// A list of Oauth Providers. + public let oauthProviders: [v1OauthProvider] + public let updatedAt: externaldatav1Timestamp + /// The user's email address. + public let userEmail: String? + /// Unique identifier for a given User. + public let userId: String + /// Human-readable name for a User. + public let userName: String + /// The user's phone number in E.164 format e.g. +13214567890 + public let userPhoneNumber: String? + /// A list of User Tag IDs. + public let userTags: [String] + + public init( + apiKeys: [v1ApiKey], + authenticators: [v1Authenticator], + createdAt: externaldatav1Timestamp, + oauthProviders: [v1OauthProvider], + updatedAt: externaldatav1Timestamp, + userEmail: String? = nil, + userId: String, + userName: String, + userPhoneNumber: String? = nil, + userTags: [String] + ) { + self.apiKeys = apiKeys + self.authenticators = authenticators + self.createdAt = createdAt + self.oauthProviders = oauthProviders + self.updatedAt = updatedAt + self.userEmail = userEmail + self.userId = userId + self.userName = userName + self.userPhoneNumber = userPhoneNumber + self.userTags = userTags + } +} + +public struct v1UserParams: Codable, Sendable { + /// The User's permissible access method(s). + public let accessType: v1AccessType + /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. + public let apiKeys: [apiApiKeyParams] + /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. + public let authenticators: [v1AuthenticatorParams] + /// The user's email address. + public let userEmail: String? + /// Human-readable name for a User. + public let userName: String + /// A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. + public let userTags: [String] + + public init( + accessType: v1AccessType, + apiKeys: [apiApiKeyParams], + authenticators: [v1AuthenticatorParams], + userEmail: String? = nil, + userName: String, + userTags: [String] + ) { + self.accessType = accessType + self.apiKeys = apiKeys + self.authenticators = authenticators + self.userEmail = userEmail + self.userName = userName + self.userTags = userTags + } +} + +public struct v1UserParamsV2: Codable, Sendable { + /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. + public let apiKeys: [apiApiKeyParams] + /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. + public let authenticators: [v1AuthenticatorParamsV2] + /// The user's email address. + public let userEmail: String? + /// Human-readable name for a User. + public let userName: String + /// A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. + public let userTags: [String] + + public init( + apiKeys: [apiApiKeyParams], + authenticators: [v1AuthenticatorParamsV2], + userEmail: String? = nil, + userName: String, + userTags: [String] + ) { + self.apiKeys = apiKeys + self.authenticators = authenticators + self.userEmail = userEmail + self.userName = userName + self.userTags = userTags + } +} + +public struct v1UserParamsV3: Codable, Sendable { + /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. + public let apiKeys: [v1ApiKeyParamsV2] + /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. + public let authenticators: [v1AuthenticatorParamsV2] + /// A list of Oauth providers. This field, if not needed, should be an empty array in your request body. + public let oauthProviders: [v1OauthProviderParams] + /// The user's email address. + public let userEmail: String? + /// Human-readable name for a User. + public let userName: String + /// The user's phone number in E.164 format e.g. +13214567890 + public let userPhoneNumber: String? + /// A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. + public let userTags: [String] + + public init( + apiKeys: [v1ApiKeyParamsV2], + authenticators: [v1AuthenticatorParamsV2], + oauthProviders: [v1OauthProviderParams], + userEmail: String? = nil, + userName: String, + userPhoneNumber: String? = nil, + userTags: [String] + ) { + self.apiKeys = apiKeys + self.authenticators = authenticators + self.oauthProviders = oauthProviders + self.userEmail = userEmail + self.userName = userName + self.userPhoneNumber = userPhoneNumber + self.userTags = userTags + } +} + +public struct v1VerifyOtpIntent: Codable, Sendable { + /// Expiration window (in seconds) indicating how long the verification token is valid for. If not provided, a default of 1 hour will be used. Maximum value is 86400 seconds (24 hours) + public let expirationSeconds: String? + /// OTP sent out to a user's contact (email or SMS) + public let otpCode: String + /// ID representing the result of an init OTP activity. + public let otpId: String + /// Client-side public key generated by the user, which will be added to the JWT response and verified in subsequent requests via a client proof signature + public let publicKey: String? + + public init( + expirationSeconds: String? = nil, + otpCode: String, + otpId: String, + publicKey: String? = nil + ) { + self.expirationSeconds = expirationSeconds + self.otpCode = otpCode + self.otpId = otpId + self.publicKey = publicKey + } +} + +public struct v1VerifyOtpRequest: Codable, Sendable { + /// Unique identifier for a given Organization. + public let organizationId: String + public let parameters: v1VerifyOtpIntent + /// Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + public let timestampMs: String + public let type: String + + public init( + organizationId: String, + parameters: v1VerifyOtpIntent, + timestampMs: String, + type: String + ) { + self.organizationId = organizationId + self.parameters = parameters + self.timestampMs = timestampMs + self.type = type + } +} + +public struct v1VerifyOtpResult: Codable, Sendable { + /// Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests) + public let verificationToken: String + + public init( + verificationToken: String + ) { + self.verificationToken = verificationToken + } +} + +public struct v1Vote: Codable, Sendable { + /// Unique identifier for a given Activity object. + public let activityId: String + public let createdAt: externaldatav1Timestamp + /// Unique identifier for a given Vote object. + public let id: String + /// The raw message being signed within a Vote. + public let message: String + /// The public component of a cryptographic key pair used to sign messages and transactions. + public let publicKey: String + /// Method used to produce a signature. + public let scheme: String + public let selection: String + /// The signature applied to a particular vote. + public let signature: String + /// Web and/or API user within your Organization. + public let user: v1User + /// Unique identifier for a given User. + public let userId: String + + public init( + activityId: String, + createdAt: externaldatav1Timestamp, + id: String, + message: String, + publicKey: String, + scheme: String, + selection: String, + signature: String, + user: v1User, + userId: String + ) { + self.activityId = activityId + self.createdAt = createdAt + self.id = id + self.message = message + self.publicKey = publicKey + self.scheme = scheme + self.selection = selection + self.signature = signature + self.user = user + self.userId = userId + } +} + +public struct v1Wallet: Codable, Sendable { + public let createdAt: externaldatav1Timestamp + /// True when a given Wallet is exported, false otherwise. + public let exported: Bool + /// True when a given Wallet is imported, false otherwise. + public let imported: Bool + public let updatedAt: externaldatav1Timestamp + /// Unique identifier for a given Wallet. + public let walletId: String + /// Human-readable name for a Wallet. + public let walletName: String + + public init( + createdAt: externaldatav1Timestamp, + exported: Bool, + imported: Bool, + updatedAt: externaldatav1Timestamp, + walletId: String, + walletName: String + ) { + self.createdAt = createdAt + self.exported = exported + self.imported = imported + self.updatedAt = updatedAt + self.walletId = walletId + self.walletName = walletName + } +} + +public struct v1WalletAccount: Codable, Sendable { + /// Address generated using the Wallet seed and Account parameters. + public let address: String + /// Address format used to generate the Account. + public let addressFormat: v1AddressFormat + public let createdAt: externaldatav1Timestamp + /// Cryptographic curve used to generate the Account. + public let curve: v1Curve + /// The Organization the Account belongs to. + public let organizationId: String + /// Path used to generate the Account. + public let path: String + /// Path format used to generate the Account. + public let pathFormat: v1PathFormat + /// The public component of this wallet account's underlying cryptographic key pair. + public let publicKey: String? + public let updatedAt: externaldatav1Timestamp + /// Unique identifier for a given Wallet Account. + public let walletAccountId: String + /// Wallet details for this account. This is only present when include_wallet_details=true. + public let walletDetails: v1Wallet? + /// The Wallet the Account was derived from. + public let walletId: String + + public init( + address: String, + addressFormat: v1AddressFormat, + createdAt: externaldatav1Timestamp, + curve: v1Curve, + organizationId: String, + path: String, + pathFormat: v1PathFormat, + publicKey: String? = nil, + updatedAt: externaldatav1Timestamp, + walletAccountId: String, + walletDetails: v1Wallet? = nil, + walletId: String + ) { + self.address = address + self.addressFormat = addressFormat + self.createdAt = createdAt + self.curve = curve + self.organizationId = organizationId + self.path = path + self.pathFormat = pathFormat + self.publicKey = publicKey + self.updatedAt = updatedAt + self.walletAccountId = walletAccountId + self.walletDetails = walletDetails + self.walletId = walletId + } +} + +public struct v1WalletAccountParams: Codable, Sendable { + /// Address format used to generate a wallet Acccount. + public let addressFormat: v1AddressFormat + /// Cryptographic curve used to generate a wallet Account. + public let curve: v1Curve + /// Path used to generate a wallet Account. + public let path: String + /// Path format used to generate a wallet Account. + public let pathFormat: v1PathFormat + + public init( + addressFormat: v1AddressFormat, + curve: v1Curve, + path: String, + pathFormat: v1PathFormat + ) { + self.addressFormat = addressFormat + self.curve = curve + self.path = path + self.pathFormat = pathFormat + } +} + +public struct v1WalletKitSettingsParams: Codable, Sendable { + /// List of enabled social login providers (e.g., 'apple', 'google', 'facebook') + public let enabledSocialProviders: [String]? + /// Mapping of social login providers to their Oauth client IDs. + public let oauthClientIds: [String: String]? + /// Oauth redirect URL to be used for social login flows. + public let oauthRedirectUrl: String? + + public init( + enabledSocialProviders: [String]? = nil, + oauthClientIds: [String: String]? = nil, + oauthRedirectUrl: String? = nil + ) { + self.enabledSocialProviders = enabledSocialProviders + self.oauthClientIds = oauthClientIds + self.oauthRedirectUrl = oauthRedirectUrl + } +} + +public struct v1WalletParams: Codable, Sendable { + /// A list of wallet Accounts. This field, if not needed, should be an empty array in your request body. + public let accounts: [v1WalletAccountParams] + /// Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24. + public let mnemonicLength: Int? + /// Human-readable name for a Wallet. + public let walletName: String + + public init( + accounts: [v1WalletAccountParams], + mnemonicLength: Int? = nil, + walletName: String + ) { + self.accounts = accounts + self.mnemonicLength = mnemonicLength + self.walletName = walletName + } +} + +public struct v1WalletResult: Codable, Sendable { + /// A list of account addresses. + public let addresses: [String] + public let walletId: String + + public init( + addresses: [String], + walletId: String + ) { + self.addresses = addresses + self.walletId = walletId + } +} + +public struct v1WebAuthnStamp: Codable, Sendable { + /// A base64 encoded payload containing metadata about the authenticator. + public let authenticatorData: String + /// A base64 encoded payload containing metadata about the signing context and the challenge. + public let clientDataJson: String + /// A base64 url encoded Unique identifier for a given credential. + public let credentialId: String + /// The base64 url encoded signature bytes contained within the WebAuthn assertion response. + public let signature: String + + public init( + authenticatorData: String, + clientDataJson: String, + credentialId: String, + signature: String + ) { + self.authenticatorData = authenticatorData + self.clientDataJson = clientDataJson + self.credentialId = credentialId + self.signature = signature + } +} + +// MARK: - API Types from Swagger Paths + +// MARK: - TGetActivityResponse + +public struct TGetActivityResponse: Codable, Sendable { + /// An action that can be taken within the Turnkey infrastructure. + public let activity: v1Activity +} + +// MARK: - TGetActivityBody + +public struct TGetActivityBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given activity object. + public let activityId: String + + public init( + organizationId: String? = nil, + activityId: String + ) { + self.organizationId = organizationId + self.activityId = activityId + } +} + +// MARK: - TGetActivityInput + +public struct TGetActivityInput: Codable, Sendable { + public let body: TGetActivityBody + + public init( + body: TGetActivityBody + ) { + self.body = body + } +} + +// MARK: - TGetApiKeyResponse + +public struct TGetApiKeyResponse: Codable, Sendable { + /// An API key. + public let apiKey: v1ApiKey +} + +// MARK: - TGetApiKeyBody + +public struct TGetApiKeyBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given API key. + public let apiKeyId: String + + public init( + organizationId: String? = nil, + apiKeyId: String + ) { + self.organizationId = organizationId + self.apiKeyId = apiKeyId + } +} + +// MARK: - TGetApiKeyInput + +public struct TGetApiKeyInput: Codable, Sendable { + public let body: TGetApiKeyBody + + public init( + body: TGetApiKeyBody + ) { + self.body = body + } +} + +// MARK: - TGetApiKeysResponse + +public struct TGetApiKeysResponse: Codable, Sendable { + /// A list of API keys. + public let apiKeys: [v1ApiKey] +} + +// MARK: - TGetApiKeysBody + +public struct TGetApiKeysBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given user. + public let userId: String? + + public init( + organizationId: String? = nil, + userId: String? = nil + ) { + self.organizationId = organizationId + self.userId = userId + } +} + +// MARK: - TGetApiKeysInput + +public struct TGetApiKeysInput: Codable, Sendable { + public let body: TGetApiKeysBody + + public init( + body: TGetApiKeysBody + ) { + self.body = body + } +} + +// MARK: - TGetAttestationDocumentResponse + +public struct TGetAttestationDocumentResponse: Codable, Sendable { + /// Raw (CBOR-encoded) attestation document. + public let attestationDocument: String +} + +// MARK: - TGetAttestationDocumentBody + +public struct TGetAttestationDocumentBody: Codable, Sendable { + public let organizationId: String? + /// The enclave type, one of: ump, notarizer, signer, evm-parser. + public let enclaveType: String + + public init( + organizationId: String? = nil, + enclaveType: String + ) { + self.organizationId = organizationId + self.enclaveType = enclaveType + } +} + +// MARK: - TGetAttestationDocumentInput + +public struct TGetAttestationDocumentInput: Codable, Sendable { + public let body: TGetAttestationDocumentBody + + public init( + body: TGetAttestationDocumentBody + ) { + self.body = body + } +} + +// MARK: - TGetAuthenticatorResponse + +public struct TGetAuthenticatorResponse: Codable, Sendable { + /// An authenticator. + public let authenticator: v1Authenticator +} + +// MARK: - TGetAuthenticatorBody + +public struct TGetAuthenticatorBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given authenticator. + public let authenticatorId: String + + public init( + organizationId: String? = nil, + authenticatorId: String + ) { + self.organizationId = organizationId + self.authenticatorId = authenticatorId + } +} + +// MARK: - TGetAuthenticatorInput + +public struct TGetAuthenticatorInput: Codable, Sendable { + public let body: TGetAuthenticatorBody + + public init( + body: TGetAuthenticatorBody + ) { + self.body = body + } +} + +// MARK: - TGetAuthenticatorsResponse + +public struct TGetAuthenticatorsResponse: Codable, Sendable { + /// A list of authenticators. + public let authenticators: [v1Authenticator] +} + +// MARK: - TGetAuthenticatorsBody + +public struct TGetAuthenticatorsBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given user. + public let userId: String + + public init( + organizationId: String? = nil, + userId: String + ) { + self.organizationId = organizationId + self.userId = userId + } +} + +// MARK: - TGetAuthenticatorsInput + +public struct TGetAuthenticatorsInput: Codable, Sendable { + public let body: TGetAuthenticatorsBody + + public init( + body: TGetAuthenticatorsBody + ) { + self.body = body + } +} + +// MARK: - TGetBootProofResponse + +public struct TGetBootProofResponse: Codable, Sendable { + public let bootProof: v1BootProof +} + +// MARK: - TGetBootProofBody + +public struct TGetBootProofBody: Codable, Sendable { + public let organizationId: String? + /// Hex encoded ephemeral public key. + public let ephemeralKey: String + + public init( + organizationId: String? = nil, + ephemeralKey: String + ) { + self.organizationId = organizationId + self.ephemeralKey = ephemeralKey + } +} + +// MARK: - TGetBootProofInput + +public struct TGetBootProofInput: Codable, Sendable { + public let body: TGetBootProofBody + + public init( + body: TGetBootProofBody + ) { + self.body = body + } +} + +// MARK: - TGetLatestBootProofResponse + +public struct TGetLatestBootProofResponse: Codable, Sendable { + public let bootProof: v1BootProof +} + +// MARK: - TGetLatestBootProofBody + +public struct TGetLatestBootProofBody: Codable, Sendable { + public let organizationId: String? + /// Name of enclave app. + public let appName: String + + public init( + organizationId: String? = nil, + appName: String + ) { + self.organizationId = organizationId + self.appName = appName + } +} + +// MARK: - TGetLatestBootProofInput + +public struct TGetLatestBootProofInput: Codable, Sendable { + public let body: TGetLatestBootProofBody + + public init( + body: TGetLatestBootProofBody + ) { + self.body = body + } +} + +// MARK: - TGetOauth2CredentialResponse + +public struct TGetOauth2CredentialResponse: Codable, Sendable { + public let oauth2Credential: v1Oauth2Credential +} + +// MARK: - TGetOauth2CredentialBody + +public struct TGetOauth2CredentialBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given OAuth 2.0 Credential. + public let oauth2CredentialId: String + + public init( + organizationId: String? = nil, + oauth2CredentialId: String + ) { + self.organizationId = organizationId + self.oauth2CredentialId = oauth2CredentialId + } +} + +// MARK: - TGetOauth2CredentialInput + +public struct TGetOauth2CredentialInput: Codable, Sendable { + public let body: TGetOauth2CredentialBody + + public init( + body: TGetOauth2CredentialBody + ) { + self.body = body + } +} + +// MARK: - TGetOauthProvidersResponse + +public struct TGetOauthProvidersResponse: Codable, Sendable { + /// A list of Oauth providers. + public let oauthProviders: [v1OauthProvider] +} + +// MARK: - TGetOauthProvidersBody + +public struct TGetOauthProvidersBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given user. + public let userId: String? + + public init( + organizationId: String? = nil, + userId: String? = nil + ) { + self.organizationId = organizationId + self.userId = userId + } +} + +// MARK: - TGetOauthProvidersInput + +public struct TGetOauthProvidersInput: Codable, Sendable { + public let body: TGetOauthProvidersBody + + public init( + body: TGetOauthProvidersBody + ) { + self.body = body + } +} + +// MARK: - TGetOrganizationResponse + +public struct TGetOrganizationResponse: Codable, Sendable { + /// Object representing the full current and deleted / disabled collection of users, policies, private keys, and invitations attributable to a particular organization. + public let organizationData: v1OrganizationData +} + +// MARK: - TGetOrganizationBody + +public struct TGetOrganizationBody: Codable, Sendable { + public let organizationId: String? + + public init( + organizationId: String? = nil + ) { + self.organizationId = organizationId + } +} + +// MARK: - TGetOrganizationInput + +public struct TGetOrganizationInput: Codable, Sendable { + public let body: TGetOrganizationBody + + public init( + body: TGetOrganizationBody + ) { + self.body = body + } +} + +// MARK: - TGetOrganizationConfigsResponse + +public struct TGetOrganizationConfigsResponse: Codable, Sendable { + /// Organization configs including quorum settings and organization features. + public let configs: v1Config +} + +// MARK: - TGetOrganizationConfigsBody + +public struct TGetOrganizationConfigsBody: Codable, Sendable { + public let organizationId: String? + + public init( + organizationId: String? = nil + ) { + self.organizationId = organizationId + } +} + +// MARK: - TGetOrganizationConfigsInput + +public struct TGetOrganizationConfigsInput: Codable, Sendable { + public let body: TGetOrganizationConfigsBody + + public init( + body: TGetOrganizationConfigsBody + ) { + self.body = body + } +} + +// MARK: - TGetPolicyResponse + +public struct TGetPolicyResponse: Codable, Sendable { + /// Object that codifies rules defining the actions that are permissible within an organization. + public let policy: v1Policy +} + +// MARK: - TGetPolicyBody + +public struct TGetPolicyBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given policy. + public let policyId: String + + public init( + organizationId: String? = nil, + policyId: String + ) { + self.organizationId = organizationId + self.policyId = policyId + } +} + +// MARK: - TGetPolicyInput + +public struct TGetPolicyInput: Codable, Sendable { + public let body: TGetPolicyBody + + public init( + body: TGetPolicyBody + ) { + self.body = body + } +} + +// MARK: - TGetPolicyEvaluationsResponse + +public struct TGetPolicyEvaluationsResponse: Codable, Sendable { + public let policyEvaluations: [externalactivityv1PolicyEvaluation] +} + +// MARK: - TGetPolicyEvaluationsBody + +public struct TGetPolicyEvaluationsBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given activity. + public let activityId: String + + public init( + organizationId: String? = nil, + activityId: String + ) { + self.organizationId = organizationId + self.activityId = activityId + } +} + +// MARK: - TGetPolicyEvaluationsInput + +public struct TGetPolicyEvaluationsInput: Codable, Sendable { + public let body: TGetPolicyEvaluationsBody + + public init( + body: TGetPolicyEvaluationsBody + ) { + self.body = body + } +} + +// MARK: - TGetPrivateKeyResponse + +public struct TGetPrivateKeyResponse: Codable, Sendable { + /// Cryptographic public/private key pair that can be used for cryptocurrency needs or more generalized encryption. + public let privateKey: v1PrivateKey +} + +// MARK: - TGetPrivateKeyBody + +public struct TGetPrivateKeyBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given private key. + public let privateKeyId: String + + public init( + organizationId: String? = nil, + privateKeyId: String + ) { + self.organizationId = organizationId + self.privateKeyId = privateKeyId + } +} + +// MARK: - TGetPrivateKeyInput + +public struct TGetPrivateKeyInput: Codable, Sendable { + public let body: TGetPrivateKeyBody + + public init( + body: TGetPrivateKeyBody + ) { + self.body = body + } +} + +// MARK: - TGetSmartContractInterfaceResponse + +public struct TGetSmartContractInterfaceResponse: Codable, Sendable { + /// Object to be used in conjunction with policies to guard transaction signing. + public let smartContractInterface: v1SmartContractInterface +} + +// MARK: - TGetSmartContractInterfaceBody + +public struct TGetSmartContractInterfaceBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given smart contract interface. + public let smartContractInterfaceId: String + + public init( + organizationId: String? = nil, + smartContractInterfaceId: String + ) { + self.organizationId = organizationId + self.smartContractInterfaceId = smartContractInterfaceId + } +} + +// MARK: - TGetSmartContractInterfaceInput + +public struct TGetSmartContractInterfaceInput: Codable, Sendable { + public let body: TGetSmartContractInterfaceBody + + public init( + body: TGetSmartContractInterfaceBody + ) { + self.body = body + } +} + +// MARK: - TGetUserResponse + +public struct TGetUserResponse: Codable, Sendable { + /// Web and/or API user within your organization. + public let user: v1User +} + +// MARK: - TGetUserBody + +public struct TGetUserBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given user. + public let userId: String + + public init( + organizationId: String? = nil, + userId: String + ) { + self.organizationId = organizationId + self.userId = userId + } +} + +// MARK: - TGetUserInput + +public struct TGetUserInput: Codable, Sendable { + public let body: TGetUserBody + + public init( + body: TGetUserBody + ) { + self.body = body + } +} + +// MARK: - TGetWalletResponse + +public struct TGetWalletResponse: Codable, Sendable { + /// A collection of deterministically generated cryptographic public / private key pairs that share a common seed. + public let wallet: v1Wallet +} + +// MARK: - TGetWalletBody + +public struct TGetWalletBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given wallet. + public let walletId: String + + public init( + organizationId: String? = nil, + walletId: String + ) { + self.organizationId = organizationId + self.walletId = walletId + } +} + +// MARK: - TGetWalletInput + +public struct TGetWalletInput: Codable, Sendable { + public let body: TGetWalletBody + + public init( + body: TGetWalletBody + ) { + self.body = body + } +} + +// MARK: - TGetWalletAccountResponse + +public struct TGetWalletAccountResponse: Codable, Sendable { + /// The resulting wallet account. + public let account: v1WalletAccount +} + +// MARK: - TGetWalletAccountBody + +public struct TGetWalletAccountBody: Codable, Sendable { + public let organizationId: String? + /// Address corresponding to a wallet account. + public let address: String? + /// Path corresponding to a wallet account. + public let path: String? + /// Unique identifier for a given wallet. + public let walletId: String + + public init( + organizationId: String? = nil, + address: String? = nil, + path: String? = nil, + walletId: String + ) { + self.organizationId = organizationId + self.address = address + self.path = path + self.walletId = walletId + } +} + +// MARK: - TGetWalletAccountInput + +public struct TGetWalletAccountInput: Codable, Sendable { + public let body: TGetWalletAccountBody + + public init( + body: TGetWalletAccountBody + ) { + self.body = body + } +} + +// MARK: - TGetActivitiesResponse + +public struct TGetActivitiesResponse: Codable, Sendable { + /// A list of activities. + public let activities: [v1Activity] +} + +// MARK: - TGetActivitiesBody + +public struct TGetActivitiesBody: Codable, Sendable { + public let organizationId: String? + /// Array of activity statuses filtering which activities will be listed in the response. + public let filterByStatus: [v1ActivityStatus]? + /// Array of activity types filtering which activities will be listed in the response. + public let filterByType: [v1ActivityType]? + /// Parameters used for cursor-based pagination. + public let paginationOptions: v1Pagination? + + public init( + organizationId: String? = nil, + filterByStatus: [v1ActivityStatus]? = nil, + filterByType: [v1ActivityType]? = nil, + paginationOptions: v1Pagination? = nil + ) { + self.organizationId = organizationId + self.filterByStatus = filterByStatus + self.filterByType = filterByType + self.paginationOptions = paginationOptions + } +} + +// MARK: - TGetActivitiesInput + +public struct TGetActivitiesInput: Codable, Sendable { + public let body: TGetActivitiesBody + + public init( + body: TGetActivitiesBody + ) { + self.body = body + } +} + +// MARK: - TGetAppProofsResponse + +public struct TGetAppProofsResponse: Codable, Sendable { + public let appProofs: [v1AppProof] +} + +// MARK: - TGetAppProofsBody + +public struct TGetAppProofsBody: Codable, Sendable { + public let organizationId: String? + /// Unique identifier for a given activity. + public let activityId: String + + public init( + organizationId: String? = nil, + activityId: String + ) { + self.organizationId = organizationId + self.activityId = activityId + } +} + +// MARK: - TGetAppProofsInput + +public struct TGetAppProofsInput: Codable, Sendable { + public let body: TGetAppProofsBody + + public init( + body: TGetAppProofsBody + ) { + self.body = body + } +} + +// MARK: - TListOauth2CredentialsResponse + +public struct TListOauth2CredentialsResponse: Codable, Sendable { + public let oauth2Credentials: [v1Oauth2Credential] +} + +// MARK: - TListOauth2CredentialsBody + +public struct TListOauth2CredentialsBody: Codable, Sendable { + public let organizationId: String? + + public init( + organizationId: String? = nil + ) { + self.organizationId = organizationId + } +} + +// MARK: - TListOauth2CredentialsInput + +public struct TListOauth2CredentialsInput: Codable, Sendable { + public let body: TListOauth2CredentialsBody + + public init( + body: TListOauth2CredentialsBody + ) { + self.body = body + } +} + +// MARK: - TGetPoliciesResponse + +public struct TGetPoliciesResponse: Codable, Sendable { + /// A list of policies. + public let policies: [v1Policy] +} + +// MARK: - TGetPoliciesBody + +public struct TGetPoliciesBody: Codable, Sendable { + public let organizationId: String? + + public init( + organizationId: String? = nil + ) { + self.organizationId = organizationId + } +} + +// MARK: - TGetPoliciesInput + +public struct TGetPoliciesInput: Codable, Sendable { + public let body: TGetPoliciesBody + + public init( + body: TGetPoliciesBody + ) { + self.body = body + } +} + +// MARK: - TListPrivateKeyTagsResponse + +public struct TListPrivateKeyTagsResponse: Codable, Sendable { + /// A list of private key tags. + public let privateKeyTags: [datav1Tag] +} + +// MARK: - TListPrivateKeyTagsBody + +public struct TListPrivateKeyTagsBody: Codable, Sendable { + public let organizationId: String? + + public init( + organizationId: String? = nil + ) { + self.organizationId = organizationId + } +} + +// MARK: - TListPrivateKeyTagsInput + +public struct TListPrivateKeyTagsInput: Codable, Sendable { + public let body: TListPrivateKeyTagsBody + + public init( + body: TListPrivateKeyTagsBody + ) { + self.body = body + } +} + +// MARK: - TGetPrivateKeysResponse + +public struct TGetPrivateKeysResponse: Codable, Sendable { + /// A list of private keys. + public let privateKeys: [v1PrivateKey] +} + +// MARK: - TGetPrivateKeysBody + +public struct TGetPrivateKeysBody: Codable, Sendable { + public let organizationId: String? + + public init( + organizationId: String? = nil + ) { + self.organizationId = organizationId + } +} + +// MARK: - TGetPrivateKeysInput + +public struct TGetPrivateKeysInput: Codable, Sendable { + public let body: TGetPrivateKeysBody + + public init( + body: TGetPrivateKeysBody + ) { + self.body = body + } +} + +// MARK: - TGetSmartContractInterfacesResponse + +public struct TGetSmartContractInterfacesResponse: Codable, Sendable { + /// A list of smart contract interfaces. + public let smartContractInterfaces: [v1SmartContractInterface] +} + +// MARK: - TGetSmartContractInterfacesBody + +public struct TGetSmartContractInterfacesBody: Codable, Sendable { + public let organizationId: String? + + public init( + organizationId: String? = nil + ) { + self.organizationId = organizationId + } +} + +// MARK: - TGetSmartContractInterfacesInput + +public struct TGetSmartContractInterfacesInput: Codable, Sendable { + public let body: TGetSmartContractInterfacesBody + + public init( + body: TGetSmartContractInterfacesBody + ) { + self.body = body + } +} + +// MARK: - TGetSubOrgIdsResponse + +public struct TGetSubOrgIdsResponse: Codable, Sendable { + /// List of unique identifiers for the matching sub-organizations. + public let organizationIds: [String] +} + +// MARK: - TGetSubOrgIdsBody + +public struct TGetSubOrgIdsBody: Codable, Sendable { + public let organizationId: String? + /// Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN', 'WALLET_ACCOUNT_ADDRESS' or 'PUBLIC_KEY' + public let filterType: String? + /// The value of the filter to apply for the specified type. For example, a specific email or name string. + public let filterValue: String? + /// Parameters used for cursor-based pagination. + public let paginationOptions: v1Pagination? + + public init( + organizationId: String? = nil, + filterType: String? = nil, + filterValue: String? = nil, + paginationOptions: v1Pagination? = nil + ) { + self.organizationId = organizationId + self.filterType = filterType + self.filterValue = filterValue + self.paginationOptions = paginationOptions + } +} + +// MARK: - TGetSubOrgIdsInput + +public struct TGetSubOrgIdsInput: Codable, Sendable { + public let body: TGetSubOrgIdsBody + + public init( + body: TGetSubOrgIdsBody + ) { + self.body = body + } +} + +// MARK: - TListUserTagsResponse + +public struct TListUserTagsResponse: Codable, Sendable { + /// A list of user tags. + public let userTags: [datav1Tag] +} + +// MARK: - TListUserTagsBody + +public struct TListUserTagsBody: Codable, Sendable { + public let organizationId: String? + + public init( + organizationId: String? = nil + ) { + self.organizationId = organizationId + } +} + +// MARK: - TListUserTagsInput + +public struct TListUserTagsInput: Codable, Sendable { + public let body: TListUserTagsBody + + public init( + body: TListUserTagsBody + ) { + self.body = body + } +} + +// MARK: - TGetUsersResponse + +public struct TGetUsersResponse: Codable, Sendable { + /// A list of users. + public let users: [v1User] +} + +// MARK: - TGetUsersBody + +public struct TGetUsersBody: Codable, Sendable { + public let organizationId: String? + + public init( + organizationId: String? = nil + ) { + self.organizationId = organizationId + } +} + +// MARK: - TGetUsersInput + +public struct TGetUsersInput: Codable, Sendable { + public let body: TGetUsersBody + + public init( + body: TGetUsersBody + ) { + self.body = body + } +} + +// MARK: - TGetVerifiedSubOrgIdsResponse + +public struct TGetVerifiedSubOrgIdsResponse: Codable, Sendable { + /// List of unique identifiers for the matching sub-organizations. + public let organizationIds: [String] +} + +// MARK: - TGetVerifiedSubOrgIdsBody + +public struct TGetVerifiedSubOrgIdsBody: Codable, Sendable { + public let organizationId: String? + /// Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'. + public let filterType: String? + /// The value of the filter to apply for the specified type. For example, a specific email or phone number string. + public let filterValue: String? + /// Parameters used for cursor-based pagination. + public let paginationOptions: v1Pagination? + + public init( + organizationId: String? = nil, + filterType: String? = nil, + filterValue: String? = nil, + paginationOptions: v1Pagination? = nil + ) { + self.organizationId = organizationId + self.filterType = filterType + self.filterValue = filterValue + self.paginationOptions = paginationOptions + } +} + +// MARK: - TGetVerifiedSubOrgIdsInput + +public struct TGetVerifiedSubOrgIdsInput: Codable, Sendable { + public let body: TGetVerifiedSubOrgIdsBody + + public init( + body: TGetVerifiedSubOrgIdsBody + ) { + self.body = body + } +} + +// MARK: - TGetWalletAccountsResponse + +public struct TGetWalletAccountsResponse: Codable, Sendable { + /// A list of accounts generated from a wallet that share a common seed. + public let accounts: [v1WalletAccount] +} + +// MARK: - TGetWalletAccountsBody + +public struct TGetWalletAccountsBody: Codable, Sendable { + public let organizationId: String? + /// Optional flag to specify if the wallet details should be included in the response. Default = false. + public let includeWalletDetails: Bool? + /// Parameters used for cursor-based pagination. + public let paginationOptions: v1Pagination? + /// Unique identifier for a given wallet. If not provided, all accounts for the organization will be returned. + public let walletId: String? + + public init( + organizationId: String? = nil, + includeWalletDetails: Bool? = nil, + paginationOptions: v1Pagination? = nil, + walletId: String? = nil + ) { + self.organizationId = organizationId + self.includeWalletDetails = includeWalletDetails + self.paginationOptions = paginationOptions + self.walletId = walletId + } +} + +// MARK: - TGetWalletAccountsInput + +public struct TGetWalletAccountsInput: Codable, Sendable { + public let body: TGetWalletAccountsBody + + public init( + body: TGetWalletAccountsBody + ) { + self.body = body + } +} + +// MARK: - TGetWalletsResponse + +public struct TGetWalletsResponse: Codable, Sendable { + /// A list of wallets. + public let wallets: [v1Wallet] +} + +// MARK: - TGetWalletsBody + +public struct TGetWalletsBody: Codable, Sendable { + public let organizationId: String? + + public init( + organizationId: String? = nil + ) { + self.organizationId = organizationId + } +} + +// MARK: - TGetWalletsInput + +public struct TGetWalletsInput: Codable, Sendable { + public let body: TGetWalletsBody + + public init( + body: TGetWalletsBody + ) { + self.body = body + } +} + +// MARK: - TGetWhoamiResponse + +public struct TGetWhoamiResponse: Codable, Sendable { + /// Unique identifier for a given organization. + public let organizationId: String + /// Human-readable name for an organization. + public let organizationName: String + /// Unique identifier for a given user. + public let userId: String + /// Human-readable name for a user. + public let username: String +} + +// MARK: - TGetWhoamiBody + +public struct TGetWhoamiBody: Codable, Sendable { + public let organizationId: String? + + public init( + organizationId: String? = nil + ) { + self.organizationId = organizationId + } +} + +// MARK: - TGetWhoamiInput + +public struct TGetWhoamiInput: Codable, Sendable { + public let body: TGetWhoamiBody + + public init( + body: TGetWhoamiBody + ) { + self.body = body + } +} + +// MARK: - TApproveActivityResponse + +public struct TApproveActivityResponse: Codable, Sendable { + public let activity: v1Activity +} + +// MARK: - TApproveActivityBody + +public struct TApproveActivityBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// An artifact verifying a User's action. + public let fingerprint: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + fingerprint: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.fingerprint = fingerprint + } +} + +// MARK: - TApproveActivityInput + +public struct TApproveActivityInput: Codable, Sendable { + public let body: TApproveActivityBody + + public init( + body: TApproveActivityBody + ) { + self.body = body + } +} + +// MARK: - TCreateApiKeysResponse + +public struct TCreateApiKeysResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of API Key IDs. + public let apiKeyIds: [String] +} + +// MARK: - TCreateApiKeysBody + +public struct TCreateApiKeysBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of API Keys. + public let apiKeys: [v1ApiKeyParamsV2] + /// Unique identifier for a given User. + public let userId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + apiKeys: [v1ApiKeyParamsV2], + userId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.apiKeys = apiKeys + self.userId = userId + } +} + +// MARK: - TCreateApiKeysInput + +public struct TCreateApiKeysInput: Codable, Sendable { + public let body: TCreateApiKeysBody + + public init( + body: TCreateApiKeysBody + ) { + self.body = body + } +} + +// MARK: - TCreateApiOnlyUsersResponse + +public struct TCreateApiOnlyUsersResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of API-only User IDs. + public let userIds: [String] +} + +// MARK: - TCreateApiOnlyUsersBody + +public struct TCreateApiOnlyUsersBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of API-only Users to create. + public let apiOnlyUsers: [v1ApiOnlyUserParams] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + apiOnlyUsers: [v1ApiOnlyUserParams] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.apiOnlyUsers = apiOnlyUsers + } +} + +// MARK: - TCreateApiOnlyUsersInput + +public struct TCreateApiOnlyUsersInput: Codable, Sendable { + public let body: TCreateApiOnlyUsersBody + + public init( + body: TCreateApiOnlyUsersBody + ) { + self.body = body + } +} + +// MARK: - TCreateAuthenticatorsResponse + +public struct TCreateAuthenticatorsResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of Authenticator IDs. + public let authenticatorIds: [String] +} + +// MARK: - TCreateAuthenticatorsBody + +public struct TCreateAuthenticatorsBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of Authenticators. + public let authenticators: [v1AuthenticatorParamsV2] + /// Unique identifier for a given User. + public let userId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + authenticators: [v1AuthenticatorParamsV2], + userId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.authenticators = authenticators + self.userId = userId + } +} + +// MARK: - TCreateAuthenticatorsInput + +public struct TCreateAuthenticatorsInput: Codable, Sendable { + public let body: TCreateAuthenticatorsBody + + public init( + body: TCreateAuthenticatorsBody + ) { + self.body = body + } +} + +// MARK: - TCreateInvitationsResponse + +public struct TCreateInvitationsResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of Invitation IDs + public let invitationIds: [String] +} + +// MARK: - TCreateInvitationsBody + +public struct TCreateInvitationsBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of Invitations. + public let invitations: [v1InvitationParams] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + invitations: [v1InvitationParams] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.invitations = invitations + } +} + +// MARK: - TCreateInvitationsInput + +public struct TCreateInvitationsInput: Codable, Sendable { + public let body: TCreateInvitationsBody + + public init( + body: TCreateInvitationsBody + ) { + self.body = body + } +} + +// MARK: - TCreateOauth2CredentialResponse + +public struct TCreateOauth2CredentialResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier of the OAuth 2.0 credential that was created + public let oauth2CredentialId: String +} + +// MARK: - TCreateOauth2CredentialBody + +public struct TCreateOauth2CredentialBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The Client ID issued by the OAuth 2.0 provider + public let clientId: String + /// The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key + public let encryptedClientSecret: String + /// The OAuth 2.0 provider + public let provider: v1Oauth2Provider + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + clientId: String, + encryptedClientSecret: String, + provider: v1Oauth2Provider + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.clientId = clientId + self.encryptedClientSecret = encryptedClientSecret + self.provider = provider + } +} + +// MARK: - TCreateOauth2CredentialInput + +public struct TCreateOauth2CredentialInput: Codable, Sendable { + public let body: TCreateOauth2CredentialBody + + public init( + body: TCreateOauth2CredentialBody + ) { + self.body = body + } +} + +// MARK: - TCreateOauthProvidersResponse + +public struct TCreateOauthProvidersResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of unique identifiers for Oauth Providers + public let providerIds: [String] +} + +// MARK: - TCreateOauthProvidersBody + +public struct TCreateOauthProvidersBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of Oauth providers. + public let oauthProviders: [v1OauthProviderParams] + /// The ID of the User to add an Oauth provider to + public let userId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + oauthProviders: [v1OauthProviderParams], + userId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.oauthProviders = oauthProviders + self.userId = userId + } +} + +// MARK: - TCreateOauthProvidersInput + +public struct TCreateOauthProvidersInput: Codable, Sendable { + public let body: TCreateOauthProvidersBody + + public init( + body: TCreateOauthProvidersBody + ) { + self.body = body + } +} + +// MARK: - TCreatePoliciesResponse + +public struct TCreatePoliciesResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of unique identifiers for the created policies. + public let policyIds: [String] +} + +// MARK: - TCreatePoliciesBody + +public struct TCreatePoliciesBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// An array of policy intents to be created. + public let policies: [v1CreatePolicyIntentV3] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + policies: [v1CreatePolicyIntentV3] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.policies = policies + } +} + +// MARK: - TCreatePoliciesInput + +public struct TCreatePoliciesInput: Codable, Sendable { + public let body: TCreatePoliciesBody + + public init( + body: TCreatePoliciesBody + ) { + self.body = body + } +} + +// MARK: - TCreatePolicyResponse + +public struct TCreatePolicyResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for a given Policy. + public let policyId: String +} + +// MARK: - TCreatePolicyBody + +public struct TCreatePolicyBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The condition expression that triggers the Effect + public let condition: String? + /// The consensus expression that triggers the Effect + public let consensus: String? + /// The instruction to DENY or ALLOW an activity. + public let effect: v1Effect + public let notes: String? + /// Human-readable name for a Policy. + public let policyName: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + condition: String? = nil, + consensus: String? = nil, + effect: v1Effect, + notes: String? = nil, + policyName: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.condition = condition + self.consensus = consensus + self.effect = effect + self.notes = notes + self.policyName = policyName + } +} + +// MARK: - TCreatePolicyInput + +public struct TCreatePolicyInput: Codable, Sendable { + public let body: TCreatePolicyBody + + public init( + body: TCreatePolicyBody + ) { + self.body = body + } +} + +// MARK: - TCreatePrivateKeyTagResponse + +public struct TCreatePrivateKeyTagResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of Private Key IDs. + public let privateKeyIds: [String] + /// Unique identifier for a given Private Key Tag. + public let privateKeyTagId: String +} + +// MARK: - TCreatePrivateKeyTagBody + +public struct TCreatePrivateKeyTagBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of Private Key IDs. + public let privateKeyIds: [String] + /// Human-readable name for a Private Key Tag. + public let privateKeyTagName: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + privateKeyIds: [String], + privateKeyTagName: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.privateKeyIds = privateKeyIds + self.privateKeyTagName = privateKeyTagName + } +} + +// MARK: - TCreatePrivateKeyTagInput + +public struct TCreatePrivateKeyTagInput: Codable, Sendable { + public let body: TCreatePrivateKeyTagBody + + public init( + body: TCreatePrivateKeyTagBody + ) { + self.body = body + } +} + +// MARK: - TCreatePrivateKeysResponse + +public struct TCreatePrivateKeysResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of Private Key IDs and addresses. + public let privateKeys: [v1PrivateKeyResult] +} + +// MARK: - TCreatePrivateKeysBody + +public struct TCreatePrivateKeysBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of Private Keys. + public let privateKeys: [v1PrivateKeyParams] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + privateKeys: [v1PrivateKeyParams] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.privateKeys = privateKeys + } +} + +// MARK: - TCreatePrivateKeysInput + +public struct TCreatePrivateKeysInput: Codable, Sendable { + public let body: TCreatePrivateKeysBody + + public init( + body: TCreatePrivateKeysBody + ) { + self.body = body + } +} + +// MARK: - TCreateReadOnlySessionResponse + +public struct TCreateReadOnlySessionResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. + public let organizationId: String + /// Human-readable name for an Organization. + public let organizationName: String + /// String representing a read only session + public let session: String + /// UTC timestamp in seconds representing the expiry time for the read only session. + public let sessionExpiry: String + /// Unique identifier for a given User. + public let userId: String + /// Human-readable name for a User. + public let username: String +} + +// MARK: - TCreateReadOnlySessionBody + +public struct TCreateReadOnlySessionBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + } +} + +// MARK: - TCreateReadOnlySessionInput + +public struct TCreateReadOnlySessionInput: Codable, Sendable { + public let body: TCreateReadOnlySessionBody + + public init( + body: TCreateReadOnlySessionBody + ) { + self.body = body + } +} + +// MARK: - TCreateReadWriteSessionResponse + +public struct TCreateReadWriteSessionResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for the created API key. + public let apiKeyId: String + /// HPKE encrypted credential bundle + public let credentialBundle: String + /// Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. + public let organizationId: String + /// Human-readable name for an Organization. + public let organizationName: String + /// Unique identifier for a given User. + public let userId: String + /// Human-readable name for a User. + public let username: String +} + +// MARK: - TCreateReadWriteSessionBody + +public struct TCreateReadWriteSessionBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Optional human-readable name for an API Key. If none provided, default to Read Write Session - + public let apiKeyName: String? + /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated ReadWriteSession API keys + public let invalidateExisting: Bool? + /// Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted. + public let targetPublicKey: String + /// Unique identifier for a given User. + public let userId: String? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + apiKeyName: String? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + targetPublicKey: String, + userId: String? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.apiKeyName = apiKeyName + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.targetPublicKey = targetPublicKey + self.userId = userId + } +} + +// MARK: - TCreateReadWriteSessionInput + +public struct TCreateReadWriteSessionInput: Codable, Sendable { + public let body: TCreateReadWriteSessionBody + + public init( + body: TCreateReadWriteSessionBody + ) { + self.body = body + } +} + +// MARK: - TCreateSmartContractInterfaceResponse + +public struct TCreateSmartContractInterfaceResponse: Codable, Sendable { + public let activity: v1Activity + /// The ID of the created Smart Contract Interface. + public let smartContractInterfaceId: String +} + +// MARK: - TCreateSmartContractInterfaceBody + +public struct TCreateSmartContractInterfaceBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Human-readable name for a Smart Contract Interface. + public let label: String + /// Notes for a Smart Contract Interface. + public let notes: String? + /// Corresponding contract address or program ID + public let smartContractAddress: String + /// ABI/IDL as a JSON string + public let smartContractInterface: String + public let type: v1SmartContractInterfaceType + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + label: String, + notes: String? = nil, + smartContractAddress: String, + smartContractInterface: String, + type: v1SmartContractInterfaceType + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.label = label + self.notes = notes + self.smartContractAddress = smartContractAddress + self.smartContractInterface = smartContractInterface + self.type = type + } +} + +// MARK: - TCreateSmartContractInterfaceInput + +public struct TCreateSmartContractInterfaceInput: Codable, Sendable { + public let body: TCreateSmartContractInterfaceBody + + public init( + body: TCreateSmartContractInterfaceBody + ) { + self.body = body + } +} + +// MARK: - TCreateSubOrganizationResponse + +public struct TCreateSubOrganizationResponse: Codable, Sendable { + public let activity: v1Activity + public let rootUserIds: [String]? + public let subOrganizationId: String + public let wallet: v1WalletResult? +} + +// MARK: - TCreateSubOrganizationBody + +public struct TCreateSubOrganizationBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Disable email auth for the sub-organization + public let disableEmailAuth: Bool? + /// Disable email recovery for the sub-organization + public let disableEmailRecovery: Bool? + /// Disable OTP email auth for the sub-organization + public let disableOtpEmailAuth: Bool? + /// Disable OTP SMS auth for the sub-organization + public let disableSmsAuth: Bool? + /// The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users + public let rootQuorumThreshold: Int + /// Root users to create within this sub-organization + public let rootUsers: [v1RootUserParamsV4] + /// Name for this sub-organization + public let subOrganizationName: String + /// Signed JWT containing a unique id, expiry, verification type, contact + public let verificationToken: String? + /// The wallet to create for the sub-organization + public let wallet: v1WalletParams? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + disableEmailAuth: Bool? = nil, + disableEmailRecovery: Bool? = nil, + disableOtpEmailAuth: Bool? = nil, + disableSmsAuth: Bool? = nil, + rootQuorumThreshold: Int, + rootUsers: [v1RootUserParamsV4], + subOrganizationName: String, + verificationToken: String? = nil, + wallet: v1WalletParams? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.disableEmailAuth = disableEmailAuth + self.disableEmailRecovery = disableEmailRecovery + self.disableOtpEmailAuth = disableOtpEmailAuth + self.disableSmsAuth = disableSmsAuth + self.rootQuorumThreshold = rootQuorumThreshold + self.rootUsers = rootUsers + self.subOrganizationName = subOrganizationName + self.verificationToken = verificationToken + self.wallet = wallet + } +} + +// MARK: - TCreateSubOrganizationInput + +public struct TCreateSubOrganizationInput: Codable, Sendable { + public let body: TCreateSubOrganizationBody + + public init( + body: TCreateSubOrganizationBody + ) { + self.body = body + } +} + +// MARK: - TCreateUserTagResponse + +public struct TCreateUserTagResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of User IDs. + public let userIds: [String] + /// Unique identifier for a given User Tag. + public let userTagId: String +} + +// MARK: - TCreateUserTagBody + +public struct TCreateUserTagBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of User IDs. + public let userIds: [String] + /// Human-readable name for a User Tag. + public let userTagName: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + userIds: [String], + userTagName: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.userIds = userIds + self.userTagName = userTagName + } +} + +// MARK: - TCreateUserTagInput + +public struct TCreateUserTagInput: Codable, Sendable { + public let body: TCreateUserTagBody + + public init( + body: TCreateUserTagBody + ) { + self.body = body + } +} + +// MARK: - TCreateUsersResponse + +public struct TCreateUsersResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of User IDs. + public let userIds: [String] +} + +// MARK: - TCreateUsersBody + +public struct TCreateUsersBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of Users. + public let users: [v1UserParamsV3] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + users: [v1UserParamsV3] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.users = users + } +} + +// MARK: - TCreateUsersInput + +public struct TCreateUsersInput: Codable, Sendable { + public let body: TCreateUsersBody + + public init( + body: TCreateUsersBody + ) { + self.body = body + } +} + +// MARK: - TCreateWalletResponse + +public struct TCreateWalletResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of account addresses. + public let addresses: [String] + /// Unique identifier for a Wallet. + public let walletId: String +} + +// MARK: - TCreateWalletBody + +public struct TCreateWalletBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of wallet Accounts. This field, if not needed, should be an empty array in your request body. + public let accounts: [v1WalletAccountParams] + /// Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24. + public let mnemonicLength: Int? + /// Human-readable name for a Wallet. + public let walletName: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + accounts: [v1WalletAccountParams], + mnemonicLength: Int? = nil, + walletName: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.accounts = accounts + self.mnemonicLength = mnemonicLength + self.walletName = walletName + } +} + +// MARK: - TCreateWalletInput + +public struct TCreateWalletInput: Codable, Sendable { + public let body: TCreateWalletBody + + public init( + body: TCreateWalletBody + ) { + self.body = body + } +} + +// MARK: - TCreateWalletAccountsResponse + +public struct TCreateWalletAccountsResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of derived addresses. + public let addresses: [String] +} + +// MARK: - TCreateWalletAccountsBody + +public struct TCreateWalletAccountsBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of wallet Accounts. + public let accounts: [v1WalletAccountParams] + /// Indicates if the wallet accounts should be persisted. This is helpful if you'd like to see the addresses of different derivation paths without actually creating the accounts. Defaults to true. + public let persist: Bool? + /// Unique identifier for a given Wallet. + public let walletId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + accounts: [v1WalletAccountParams], + persist: Bool? = nil, + walletId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.accounts = accounts + self.persist = persist + self.walletId = walletId + } +} + +// MARK: - TCreateWalletAccountsInput + +public struct TCreateWalletAccountsInput: Codable, Sendable { + public let body: TCreateWalletAccountsBody + + public init( + body: TCreateWalletAccountsBody + ) { + self.body = body + } +} + +// MARK: - TDeleteApiKeysResponse + +public struct TDeleteApiKeysResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of API Key IDs. + public let apiKeyIds: [String] +} + +// MARK: - TDeleteApiKeysBody + +public struct TDeleteApiKeysBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of API Key IDs. + public let apiKeyIds: [String] + /// Unique identifier for a given User. + public let userId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + apiKeyIds: [String], + userId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.apiKeyIds = apiKeyIds + self.userId = userId + } +} + +// MARK: - TDeleteApiKeysInput + +public struct TDeleteApiKeysInput: Codable, Sendable { + public let body: TDeleteApiKeysBody + + public init( + body: TDeleteApiKeysBody + ) { + self.body = body + } +} + +// MARK: - TDeleteAuthenticatorsResponse + +public struct TDeleteAuthenticatorsResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for a given Authenticator. + public let authenticatorIds: [String] +} + +// MARK: - TDeleteAuthenticatorsBody + +public struct TDeleteAuthenticatorsBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of Authenticator IDs. + public let authenticatorIds: [String] + /// Unique identifier for a given User. + public let userId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + authenticatorIds: [String], + userId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.authenticatorIds = authenticatorIds + self.userId = userId + } +} + +// MARK: - TDeleteAuthenticatorsInput + +public struct TDeleteAuthenticatorsInput: Codable, Sendable { + public let body: TDeleteAuthenticatorsBody + + public init( + body: TDeleteAuthenticatorsBody + ) { + self.body = body + } +} + +// MARK: - TDeleteInvitationResponse + +public struct TDeleteInvitationResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for a given Invitation. + public let invitationId: String +} + +// MARK: - TDeleteInvitationBody + +public struct TDeleteInvitationBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Unique identifier for a given Invitation object. + public let invitationId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + invitationId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.invitationId = invitationId + } +} + +// MARK: - TDeleteInvitationInput + +public struct TDeleteInvitationInput: Codable, Sendable { + public let body: TDeleteInvitationBody + + public init( + body: TDeleteInvitationBody + ) { + self.body = body + } +} + +// MARK: - TDeleteOauth2CredentialResponse + +public struct TDeleteOauth2CredentialResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier of the OAuth 2.0 credential that was deleted + public let oauth2CredentialId: String +} + +// MARK: - TDeleteOauth2CredentialBody + +public struct TDeleteOauth2CredentialBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The ID of the OAuth 2.0 credential to delete + public let oauth2CredentialId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + oauth2CredentialId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.oauth2CredentialId = oauth2CredentialId + } +} + +// MARK: - TDeleteOauth2CredentialInput + +public struct TDeleteOauth2CredentialInput: Codable, Sendable { + public let body: TDeleteOauth2CredentialBody + + public init( + body: TDeleteOauth2CredentialBody + ) { + self.body = body + } +} + +// MARK: - TDeleteOauthProvidersResponse + +public struct TDeleteOauthProvidersResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of unique identifiers for Oauth Providers + public let providerIds: [String] +} + +// MARK: - TDeleteOauthProvidersBody + +public struct TDeleteOauthProvidersBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Unique identifier for a given Provider. + public let providerIds: [String] + /// The ID of the User to remove an Oauth provider from + public let userId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + providerIds: [String], + userId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.providerIds = providerIds + self.userId = userId + } +} + +// MARK: - TDeleteOauthProvidersInput + +public struct TDeleteOauthProvidersInput: Codable, Sendable { + public let body: TDeleteOauthProvidersBody + + public init( + body: TDeleteOauthProvidersBody + ) { + self.body = body + } +} + +// MARK: - TDeletePoliciesResponse + +public struct TDeletePoliciesResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of unique identifiers for the deleted policies. + public let policyIds: [String] +} + +// MARK: - TDeletePoliciesBody + +public struct TDeletePoliciesBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// List of unique identifiers for policies within an organization + public let policyIds: [String] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + policyIds: [String] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.policyIds = policyIds + } +} + +// MARK: - TDeletePoliciesInput + +public struct TDeletePoliciesInput: Codable, Sendable { + public let body: TDeletePoliciesBody + + public init( + body: TDeletePoliciesBody + ) { + self.body = body + } +} + +// MARK: - TDeletePolicyResponse + +public struct TDeletePolicyResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for a given Policy. + public let policyId: String +} + +// MARK: - TDeletePolicyBody + +public struct TDeletePolicyBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Unique identifier for a given Policy. + public let policyId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + policyId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.policyId = policyId + } +} + +// MARK: - TDeletePolicyInput + +public struct TDeletePolicyInput: Codable, Sendable { + public let body: TDeletePolicyBody + + public init( + body: TDeletePolicyBody + ) { + self.body = body + } +} + +// MARK: - TDeletePrivateKeyTagsResponse + +public struct TDeletePrivateKeyTagsResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of Private Key IDs. + public let privateKeyIds: [String] + /// A list of Private Key Tag IDs. + public let privateKeyTagIds: [String] +} + +// MARK: - TDeletePrivateKeyTagsBody + +public struct TDeletePrivateKeyTagsBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of Private Key Tag IDs. + public let privateKeyTagIds: [String] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + privateKeyTagIds: [String] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.privateKeyTagIds = privateKeyTagIds + } +} + +// MARK: - TDeletePrivateKeyTagsInput + +public struct TDeletePrivateKeyTagsInput: Codable, Sendable { + public let body: TDeletePrivateKeyTagsBody + + public init( + body: TDeletePrivateKeyTagsBody + ) { + self.body = body + } +} + +// MARK: - TDeletePrivateKeysResponse + +public struct TDeletePrivateKeysResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of private key unique identifiers that were removed + public let privateKeyIds: [String] +} + +// MARK: - TDeletePrivateKeysBody + +public struct TDeletePrivateKeysBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored. + public let deleteWithoutExport: Bool? + /// List of unique identifiers for private keys within an organization + public let privateKeyIds: [String] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + deleteWithoutExport: Bool? = nil, + privateKeyIds: [String] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.deleteWithoutExport = deleteWithoutExport + self.privateKeyIds = privateKeyIds + } +} + +// MARK: - TDeletePrivateKeysInput + +public struct TDeletePrivateKeysInput: Codable, Sendable { + public let body: TDeletePrivateKeysBody + + public init( + body: TDeletePrivateKeysBody + ) { + self.body = body + } +} + +// MARK: - TDeleteSmartContractInterfaceResponse + +public struct TDeleteSmartContractInterfaceResponse: Codable, Sendable { + public let activity: v1Activity + /// The ID of the deleted Smart Contract Interface. + public let smartContractInterfaceId: String +} + +// MARK: - TDeleteSmartContractInterfaceBody + +public struct TDeleteSmartContractInterfaceBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The ID of a Smart Contract Interface intended for deletion. + public let smartContractInterfaceId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + smartContractInterfaceId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.smartContractInterfaceId = smartContractInterfaceId + } +} + +// MARK: - TDeleteSmartContractInterfaceInput + +public struct TDeleteSmartContractInterfaceInput: Codable, Sendable { + public let body: TDeleteSmartContractInterfaceBody + + public init( + body: TDeleteSmartContractInterfaceBody + ) { + self.body = body + } +} + +// MARK: - TDeleteSubOrganizationResponse + +public struct TDeleteSubOrganizationResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier of the sub organization that was removed + public let subOrganizationUuid: String +} + +// MARK: - TDeleteSubOrganizationBody + +public struct TDeleteSubOrganizationBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false. + public let deleteWithoutExport: Bool? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + deleteWithoutExport: Bool? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.deleteWithoutExport = deleteWithoutExport + } +} + +// MARK: - TDeleteSubOrganizationInput + +public struct TDeleteSubOrganizationInput: Codable, Sendable { + public let body: TDeleteSubOrganizationBody + + public init( + body: TDeleteSubOrganizationBody + ) { + self.body = body + } +} + +// MARK: - TDeleteUserTagsResponse + +public struct TDeleteUserTagsResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of User IDs. + public let userIds: [String] + /// A list of User Tag IDs. + public let userTagIds: [String] +} + +// MARK: - TDeleteUserTagsBody + +public struct TDeleteUserTagsBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of User Tag IDs. + public let userTagIds: [String] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + userTagIds: [String] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.userTagIds = userTagIds + } +} + +// MARK: - TDeleteUserTagsInput + +public struct TDeleteUserTagsInput: Codable, Sendable { + public let body: TDeleteUserTagsBody + + public init( + body: TDeleteUserTagsBody + ) { + self.body = body + } +} + +// MARK: - TDeleteUsersResponse + +public struct TDeleteUsersResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of User IDs. + public let userIds: [String] +} + +// MARK: - TDeleteUsersBody + +public struct TDeleteUsersBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of User IDs. + public let userIds: [String] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + userIds: [String] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.userIds = userIds + } +} + +// MARK: - TDeleteUsersInput + +public struct TDeleteUsersInput: Codable, Sendable { + public let body: TDeleteUsersBody + + public init( + body: TDeleteUsersBody + ) { + self.body = body + } +} + +// MARK: - TDeleteWalletAccountsResponse + +public struct TDeleteWalletAccountsResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of wallet account unique identifiers that were removed + public let walletAccountIds: [String] +} + +// MARK: - TDeleteWalletAccountsBody + +public struct TDeleteWalletAccountsBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Optional parameter for deleting the wallet accounts, even if any have not been previously exported. If they have been exported, this field is ignored. + public let deleteWithoutExport: Bool? + /// List of unique identifiers for wallet accounts within an organization + public let walletAccountIds: [String] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + deleteWithoutExport: Bool? = nil, + walletAccountIds: [String] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.deleteWithoutExport = deleteWithoutExport + self.walletAccountIds = walletAccountIds + } +} + +// MARK: - TDeleteWalletAccountsInput + +public struct TDeleteWalletAccountsInput: Codable, Sendable { + public let body: TDeleteWalletAccountsBody + + public init( + body: TDeleteWalletAccountsBody + ) { + self.body = body + } +} + +// MARK: - TDeleteWalletsResponse + +public struct TDeleteWalletsResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of wallet unique identifiers that were removed + public let walletIds: [String] +} + +// MARK: - TDeleteWalletsBody + +public struct TDeleteWalletsBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored. + public let deleteWithoutExport: Bool? + /// List of unique identifiers for wallets within an organization + public let walletIds: [String] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + deleteWithoutExport: Bool? = nil, + walletIds: [String] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.deleteWithoutExport = deleteWithoutExport + self.walletIds = walletIds + } +} + +// MARK: - TDeleteWalletsInput + +public struct TDeleteWalletsInput: Codable, Sendable { + public let body: TDeleteWalletsBody + + public init( + body: TDeleteWalletsBody + ) { + self.body = body + } +} + +// MARK: - TEmailAuthResponse + +public struct TEmailAuthResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for the created API key. + public let apiKeyId: String + /// Unique identifier for the authenticating User. + public let userId: String +} + +// MARK: - TEmailAuthBody + +public struct TEmailAuthBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Optional human-readable name for an API Key. If none provided, default to Email Auth - + public let apiKeyName: String? + /// Email of the authenticating user. + public let email: String + /// Optional parameters for customizing emails. If not provided, the default email will be used. + public let emailCustomization: v1EmailCustomizationParams? + /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated Email Auth API keys + public let invalidateExisting: Bool? + /// Optional custom email address to use as reply-to + public let replyToEmailAddress: String? + /// Optional custom email address from which to send the email + public let sendFromEmailAddress: String? + /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + public let sendFromEmailSenderName: String? + /// Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted. + public let targetPublicKey: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + apiKeyName: String? = nil, + email: String, + emailCustomization: v1EmailCustomizationParams? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + replyToEmailAddress: String? = nil, + sendFromEmailAddress: String? = nil, + sendFromEmailSenderName: String? = nil, + targetPublicKey: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.apiKeyName = apiKeyName + self.email = email + self.emailCustomization = emailCustomization + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.replyToEmailAddress = replyToEmailAddress + self.sendFromEmailAddress = sendFromEmailAddress + self.sendFromEmailSenderName = sendFromEmailSenderName + self.targetPublicKey = targetPublicKey + } +} + +// MARK: - TEmailAuthInput + +public struct TEmailAuthInput: Codable, Sendable { + public let body: TEmailAuthBody + + public init( + body: TEmailAuthBody + ) { + self.body = body + } +} + +// MARK: - TExportPrivateKeyResponse + +public struct TExportPrivateKeyResponse: Codable, Sendable { + public let activity: v1Activity + /// Export bundle containing a private key encrypted to the client's target public key. + public let exportBundle: String + /// Unique identifier for a given Private Key. + public let privateKeyId: String +} + +// MARK: - TExportPrivateKeyBody + +public struct TExportPrivateKeyBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Unique identifier for a given Private Key. + public let privateKeyId: String + /// Client-side public key generated by the user, to which the export bundle will be encrypted. + public let targetPublicKey: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + privateKeyId: String, + targetPublicKey: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.privateKeyId = privateKeyId + self.targetPublicKey = targetPublicKey + } +} + +// MARK: - TExportPrivateKeyInput + +public struct TExportPrivateKeyInput: Codable, Sendable { + public let body: TExportPrivateKeyBody + + public init( + body: TExportPrivateKeyBody + ) { + self.body = body + } +} + +// MARK: - TExportWalletResponse + +public struct TExportWalletResponse: Codable, Sendable { + public let activity: v1Activity + /// Export bundle containing a wallet mnemonic + optional newline passphrase encrypted by the client's target public key. + public let exportBundle: String + /// Unique identifier for a given Wallet. + public let walletId: String +} + +// MARK: - TExportWalletBody + +public struct TExportWalletBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The language of the mnemonic to export. Defaults to English. + public let language: v1MnemonicLanguage? + /// Client-side public key generated by the user, to which the export bundle will be encrypted. + public let targetPublicKey: String + /// Unique identifier for a given Wallet. + public let walletId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + language: v1MnemonicLanguage? = nil, + targetPublicKey: String, + walletId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.language = language + self.targetPublicKey = targetPublicKey + self.walletId = walletId + } +} + +// MARK: - TExportWalletInput + +public struct TExportWalletInput: Codable, Sendable { + public let body: TExportWalletBody + + public init( + body: TExportWalletBody + ) { + self.body = body + } +} + +// MARK: - TExportWalletAccountResponse + +public struct TExportWalletAccountResponse: Codable, Sendable { + public let activity: v1Activity + /// Address to identify Wallet Account. + public let address: String + /// Export bundle containing a private key encrypted by the client's target public key. + public let exportBundle: String +} + +// MARK: - TExportWalletAccountBody + +public struct TExportWalletAccountBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Address to identify Wallet Account. + public let address: String + /// Client-side public key generated by the user, to which the export bundle will be encrypted. + public let targetPublicKey: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + address: String, + targetPublicKey: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.address = address + self.targetPublicKey = targetPublicKey + } +} + +// MARK: - TExportWalletAccountInput + +public struct TExportWalletAccountInput: Codable, Sendable { + public let body: TExportWalletAccountBody + + public init( + body: TExportWalletAccountBody + ) { + self.body = body + } +} + +// MARK: - TImportPrivateKeyResponse + +public struct TImportPrivateKeyResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of addresses. + public let addresses: [immutableactivityv1Address] + /// Unique identifier for a Private Key. + public let privateKeyId: String +} + +// MARK: - TImportPrivateKeyBody + +public struct TImportPrivateKeyBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Cryptocurrency-specific formats for a derived address (e.g., Ethereum). + public let addressFormats: [v1AddressFormat] + /// Cryptographic Curve used to generate a given Private Key. + public let curve: v1Curve + /// Bundle containing a raw private key encrypted to the enclave's target public key. + public let encryptedBundle: String + /// Human-readable name for a Private Key. + public let privateKeyName: String + /// The ID of the User importing a Private Key. + public let userId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + addressFormats: [v1AddressFormat], + curve: v1Curve, + encryptedBundle: String, + privateKeyName: String, + userId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.addressFormats = addressFormats + self.curve = curve + self.encryptedBundle = encryptedBundle + self.privateKeyName = privateKeyName + self.userId = userId + } +} + +// MARK: - TImportPrivateKeyInput + +public struct TImportPrivateKeyInput: Codable, Sendable { + public let body: TImportPrivateKeyBody + + public init( + body: TImportPrivateKeyBody + ) { + self.body = body + } +} + +// MARK: - TImportWalletResponse + +public struct TImportWalletResponse: Codable, Sendable { + public let activity: v1Activity + /// A list of account addresses. + public let addresses: [String] + /// Unique identifier for a Wallet. + public let walletId: String +} + +// MARK: - TImportWalletBody + +public struct TImportWalletBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of wallet Accounts. + public let accounts: [v1WalletAccountParams] + /// Bundle containing a wallet mnemonic encrypted to the enclave's target public key. + public let encryptedBundle: String + /// The ID of the User importing a Wallet. + public let userId: String + /// Human-readable name for a Wallet. + public let walletName: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + accounts: [v1WalletAccountParams], + encryptedBundle: String, + userId: String, + walletName: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.accounts = accounts + self.encryptedBundle = encryptedBundle + self.userId = userId + self.walletName = walletName + } +} + +// MARK: - TImportWalletInput + +public struct TImportWalletInput: Codable, Sendable { + public let body: TImportWalletBody + + public init( + body: TImportWalletBody + ) { + self.body = body + } +} + +// MARK: - TInitFiatOnRampResponse + +public struct TInitFiatOnRampResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier used to retrieve transaction statuses for a given fiat on-ramp flow. + public let onRampTransactionId: String + /// Unique URL for a given fiat on-ramp flow. + public let onRampUrl: String + /// Optional signature of the MoonPay Widget URL. The signature is generated if the Init Fiat On Ramp intent includes the urlForSignature field. The signature can be used to initialize the MoonPay SDKs when URL signing is enabled for your project. + public let onRampUrlSignature: String? +} + +// MARK: - TInitFiatOnRampBody + +public struct TInitFiatOnRampBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// ISO 3166-1 two-digit country code for Coinbase representing the purchasing user’s country of residence, e.g., US, GB. + public let countryCode: String? + /// ISO 3166-2 two-digit country subdivision code for Coinbase representing the purchasing user’s subdivision of residence within their country, e.g. NY. Required if country_code=US. + public let countrySubdivisionCode: String? + /// Code for the cryptocurrency to be purchased, e.g., btc, eth. Maps to MoonPay's currencyCode or Coinbase's defaultAsset. + public let cryptoCurrencyCode: v1FiatOnRampCryptoCurrency + /// Specifies a preset fiat amount for the transaction, e.g., '100'. Must be greater than '20'. If not provided, the user will be prompted to enter an amount. + public let fiatCurrencyAmount: String? + /// Code for the fiat currency to be used in the transaction, e.g., USD, EUR. + public let fiatCurrencyCode: v1FiatOnRampCurrency? + /// Blockchain network to be used for the transaction, e.g., bitcoin, ethereum. Maps to MoonPay's network or Coinbase's defaultNetwork. + public let network: v1FiatOnRampBlockchainNetwork + /// Enum to specifiy which on-ramp provider to use + public let onrampProvider: v1FiatOnRampProvider + /// Pre-selected payment method, e.g., CREDIT_DEBIT_CARD, APPLE_PAY. Validated against the chosen provider. + public let paymentMethod: v1FiatOnRampPaymentMethod? + /// Optional flag to indicate whether to use the sandbox mode to simulate transactions for the on-ramp provider. Default is false. + public let sandboxMode: Bool? + /// Optional MoonPay Widget URL to sign when using MoonPay client SDKs with URL Signing enabled. + public let urlForSignature: String? + /// Destination wallet address for the buy transaction. + public let walletAddress: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + countryCode: String? = nil, + countrySubdivisionCode: String? = nil, + cryptoCurrencyCode: v1FiatOnRampCryptoCurrency, + fiatCurrencyAmount: String? = nil, + fiatCurrencyCode: v1FiatOnRampCurrency? = nil, + network: v1FiatOnRampBlockchainNetwork, + onrampProvider: v1FiatOnRampProvider, + paymentMethod: v1FiatOnRampPaymentMethod? = nil, + sandboxMode: Bool? = nil, + urlForSignature: String? = nil, + walletAddress: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.countryCode = countryCode + self.countrySubdivisionCode = countrySubdivisionCode + self.cryptoCurrencyCode = cryptoCurrencyCode + self.fiatCurrencyAmount = fiatCurrencyAmount + self.fiatCurrencyCode = fiatCurrencyCode + self.network = network + self.onrampProvider = onrampProvider + self.paymentMethod = paymentMethod + self.sandboxMode = sandboxMode + self.urlForSignature = urlForSignature + self.walletAddress = walletAddress + } +} + +// MARK: - TInitFiatOnRampInput + +public struct TInitFiatOnRampInput: Codable, Sendable { + public let body: TInitFiatOnRampBody + + public init( + body: TInitFiatOnRampBody + ) { + self.body = body + } +} + +// MARK: - TInitImportPrivateKeyResponse + +public struct TInitImportPrivateKeyResponse: Codable, Sendable { + public let activity: v1Activity + /// Import bundle containing a public key and signature to use for importing client data. + public let importBundle: String +} + +// MARK: - TInitImportPrivateKeyBody + +public struct TInitImportPrivateKeyBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The ID of the User importing a Private Key. + public let userId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + userId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.userId = userId + } +} + +// MARK: - TInitImportPrivateKeyInput + +public struct TInitImportPrivateKeyInput: Codable, Sendable { + public let body: TInitImportPrivateKeyBody + + public init( + body: TInitImportPrivateKeyBody + ) { + self.body = body + } +} + +// MARK: - TInitImportWalletResponse + +public struct TInitImportWalletResponse: Codable, Sendable { + public let activity: v1Activity + /// Import bundle containing a public key and signature to use for importing client data. + public let importBundle: String +} + +// MARK: - TInitImportWalletBody + +public struct TInitImportWalletBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The ID of the User importing a Wallet. + public let userId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + userId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.userId = userId + } +} + +// MARK: - TInitImportWalletInput + +public struct TInitImportWalletInput: Codable, Sendable { + public let body: TInitImportWalletBody + + public init( + body: TInitImportWalletBody + ) { + self.body = body + } +} + +// MARK: - TInitOtpResponse + +public struct TInitOtpResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for an OTP authentication + public let otpId: String +} + +// MARK: - TInitOtpBody + +public struct TInitOtpBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true + public let alphanumeric: Bool? + /// Email or phone number to send the OTP code to + public let contact: String + /// Optional parameters for customizing emails. If not provided, the default email will be used. + public let emailCustomization: v1EmailCustomizationParams? + /// Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes) + public let expirationSeconds: String? + /// Optional length of the OTP code. Default = 9 + public let otpLength: Int? + /// Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL + public let otpType: String + /// Optional custom email address to use as reply-to + public let replyToEmailAddress: String? + /// Optional custom email address from which to send the OTP email + public let sendFromEmailAddress: String? + /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + public let sendFromEmailSenderName: String? + /// Optional parameters for customizing SMS message. If not provided, the default sms message will be used. + public let smsCustomization: v1SmsCustomizationParams? + /// Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. + public let userIdentifier: String? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + alphanumeric: Bool? = nil, + contact: String, + emailCustomization: v1EmailCustomizationParams? = nil, + expirationSeconds: String? = nil, + otpLength: Int? = nil, + otpType: String, + replyToEmailAddress: String? = nil, + sendFromEmailAddress: String? = nil, + sendFromEmailSenderName: String? = nil, + smsCustomization: v1SmsCustomizationParams? = nil, + userIdentifier: String? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.alphanumeric = alphanumeric + self.contact = contact + self.emailCustomization = emailCustomization + self.expirationSeconds = expirationSeconds + self.otpLength = otpLength + self.otpType = otpType + self.replyToEmailAddress = replyToEmailAddress + self.sendFromEmailAddress = sendFromEmailAddress + self.sendFromEmailSenderName = sendFromEmailSenderName + self.smsCustomization = smsCustomization + self.userIdentifier = userIdentifier + } +} + +// MARK: - TInitOtpInput + +public struct TInitOtpInput: Codable, Sendable { + public let body: TInitOtpBody + + public init( + body: TInitOtpBody + ) { + self.body = body + } +} + +// MARK: - TInitOtpAuthResponse + +public struct TInitOtpAuthResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for an OTP authentication + public let otpId: String +} + +// MARK: - TInitOtpAuthBody + +public struct TInitOtpAuthBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true + public let alphanumeric: Bool? + /// Email or phone number to send the OTP code to + public let contact: String + /// Optional parameters for customizing emails. If not provided, the default email will be used. + public let emailCustomization: v1EmailCustomizationParams? + /// Optional length of the OTP code. Default = 9 + public let otpLength: Int? + /// Enum to specifiy whether to send OTP via SMS or email + public let otpType: String + /// Optional custom email address to use as reply-to + public let replyToEmailAddress: String? + /// Optional custom email address from which to send the OTP email + public let sendFromEmailAddress: String? + /// Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + public let sendFromEmailSenderName: String? + /// Optional parameters for customizing SMS message. If not provided, the default sms message will be used. + public let smsCustomization: v1SmsCustomizationParams? + /// Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. + public let userIdentifier: String? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + alphanumeric: Bool? = nil, + contact: String, + emailCustomization: v1EmailCustomizationParams? = nil, + otpLength: Int? = nil, + otpType: String, + replyToEmailAddress: String? = nil, + sendFromEmailAddress: String? = nil, + sendFromEmailSenderName: String? = nil, + smsCustomization: v1SmsCustomizationParams? = nil, + userIdentifier: String? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.alphanumeric = alphanumeric + self.contact = contact + self.emailCustomization = emailCustomization + self.otpLength = otpLength + self.otpType = otpType + self.replyToEmailAddress = replyToEmailAddress + self.sendFromEmailAddress = sendFromEmailAddress + self.sendFromEmailSenderName = sendFromEmailSenderName + self.smsCustomization = smsCustomization + self.userIdentifier = userIdentifier + } +} + +// MARK: - TInitOtpAuthInput + +public struct TInitOtpAuthInput: Codable, Sendable { + public let body: TInitOtpAuthBody + + public init( + body: TInitOtpAuthBody + ) { + self.body = body + } +} + +// MARK: - TInitUserEmailRecoveryResponse + +public struct TInitUserEmailRecoveryResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for the user being recovered. + public let userId: String +} + +// MARK: - TInitUserEmailRecoveryBody + +public struct TInitUserEmailRecoveryBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Email of the user starting recovery + public let email: String + /// Optional parameters for customizing emails. If not provided, the default email will be used. + public let emailCustomization: v1EmailCustomizationParams? + /// Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Client-side public key generated by the user, to which the recovery bundle will be encrypted. + public let targetPublicKey: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + email: String, + emailCustomization: v1EmailCustomizationParams? = nil, + expirationSeconds: String? = nil, + targetPublicKey: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.email = email + self.emailCustomization = emailCustomization + self.expirationSeconds = expirationSeconds + self.targetPublicKey = targetPublicKey + } +} + +// MARK: - TInitUserEmailRecoveryInput + +public struct TInitUserEmailRecoveryInput: Codable, Sendable { + public let body: TInitUserEmailRecoveryBody + + public init( + body: TInitUserEmailRecoveryBody + ) { + self.body = body + } +} + +// MARK: - TOauthResponse + +public struct TOauthResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for the created API key. + public let apiKeyId: String + /// HPKE encrypted credential bundle + public let credentialBundle: String + /// Unique identifier for the authenticating User. + public let userId: String +} + +// MARK: - TOauthBody + +public struct TOauthBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Optional human-readable name for an API Key. If none provided, default to Oauth - + public let apiKeyName: String? + /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated Oauth API keys + public let invalidateExisting: Bool? + /// Base64 encoded OIDC token + public let oidcToken: String + /// Client-side public key generated by the user, to which the oauth bundle (credentials) will be encrypted. + public let targetPublicKey: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + apiKeyName: String? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + oidcToken: String, + targetPublicKey: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.apiKeyName = apiKeyName + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.oidcToken = oidcToken + self.targetPublicKey = targetPublicKey + } +} + +// MARK: - TOauthInput + +public struct TOauthInput: Codable, Sendable { + public let body: TOauthBody + + public init( + body: TOauthBody + ) { + self.body = body + } +} + +// MARK: - TOauth2AuthenticateResponse + +public struct TOauth2AuthenticateResponse: Codable, Sendable { + public let activity: v1Activity + /// Base64 encoded OIDC token issued by Turnkey to be used with the LoginWithOAuth activity + public let oidcToken: String +} + +// MARK: - TOauth2AuthenticateBody + +public struct TOauth2AuthenticateBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The auth_code provided by the OAuth 2.0 provider to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow + public let authCode: String + /// An optional P256 public key to which, if provided, the bearer token will be encrypted and returned via the `encrypted_bearer_token` claim of the OIDC Token + public let bearerTokenTargetPublicKey: String? + /// The code verifier used by OAuth 2.0 PKCE providers + public let codeVerifier: String + /// An optional nonce used by the client to prevent replay/substitution of an ID token + public let nonce: String? + /// The OAuth 2.0 credential id whose client_id and client_secret will be used in the OAuth 2.0 flow + public let oauth2CredentialId: String + /// The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider + public let redirectUri: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + authCode: String, + bearerTokenTargetPublicKey: String? = nil, + codeVerifier: String, + nonce: String? = nil, + oauth2CredentialId: String, + redirectUri: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.authCode = authCode + self.bearerTokenTargetPublicKey = bearerTokenTargetPublicKey + self.codeVerifier = codeVerifier + self.nonce = nonce + self.oauth2CredentialId = oauth2CredentialId + self.redirectUri = redirectUri + } +} + +// MARK: - TOauth2AuthenticateInput + +public struct TOauth2AuthenticateInput: Codable, Sendable { + public let body: TOauth2AuthenticateBody + + public init( + body: TOauth2AuthenticateBody + ) { + self.body = body + } +} + +// MARK: - TOauthLoginResponse + +public struct TOauthLoginResponse: Codable, Sendable { + public let activity: v1Activity + /// Signed JWT containing an expiry, public key, session type, user id, and organization id + public let session: String +} + +// MARK: - TOauthLoginBody + +public struct TOauthLoginBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated Login API keys + public let invalidateExisting: Bool? + /// Base64 encoded OIDC token + public let oidcToken: String + /// Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request + public let publicKey: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + oidcToken: String, + publicKey: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.oidcToken = oidcToken + self.publicKey = publicKey + } +} + +// MARK: - TOauthLoginInput + +public struct TOauthLoginInput: Codable, Sendable { + public let body: TOauthLoginBody + + public init( + body: TOauthLoginBody + ) { + self.body = body + } +} + +// MARK: - TOtpAuthResponse + +public struct TOtpAuthResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for the created API key. + public let apiKeyId: String? + /// HPKE encrypted credential bundle + public let credentialBundle: String? + /// Unique identifier for the authenticating User. + public let userId: String +} + +// MARK: - TOtpAuthBody + +public struct TOtpAuthBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Optional human-readable name for an API Key. If none provided, default to OTP Auth - + public let apiKeyName: String? + /// Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated OTP Auth API keys + public let invalidateExisting: Bool? + /// OTP sent out to a user's contact (email or SMS) + public let otpCode: String + /// ID representing the result of an init OTP activity. + public let otpId: String + /// Client-side public key generated by the user, to which the OTP bundle (credentials) will be encrypted. + public let targetPublicKey: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + apiKeyName: String? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + otpCode: String, + otpId: String, + targetPublicKey: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.apiKeyName = apiKeyName + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.otpCode = otpCode + self.otpId = otpId + self.targetPublicKey = targetPublicKey + } +} + +// MARK: - TOtpAuthInput + +public struct TOtpAuthInput: Codable, Sendable { + public let body: TOtpAuthBody + + public init( + body: TOtpAuthBody + ) { + self.body = body + } +} + +// MARK: - TOtpLoginResponse + +public struct TOtpLoginResponse: Codable, Sendable { + public let activity: v1Activity + /// Signed JWT containing an expiry, public key, session type, user id, and organization id + public let session: String +} + +// MARK: - TOtpLoginBody + +public struct TOtpLoginBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Optional signature associated with the public key passed into the verification step. This must be a hex-encoded ECDSA signature over the verification token. Only required if a public key was provided during the verification step. + public let clientSignature: String? + /// Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated Login API keys + public let invalidateExisting: Bool? + /// Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token + public let publicKey: String + /// Signed JWT containing a unique id, expiry, verification type, contact + public let verificationToken: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + clientSignature: String? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + publicKey: String, + verificationToken: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.clientSignature = clientSignature + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.publicKey = publicKey + self.verificationToken = verificationToken + } +} + +// MARK: - TOtpLoginInput + +public struct TOtpLoginInput: Codable, Sendable { + public let body: TOtpLoginBody + + public init( + body: TOtpLoginBody + ) { + self.body = body + } +} + +// MARK: - TRecoverUserResponse + +public struct TRecoverUserResponse: Codable, Sendable { + public let activity: v1Activity + /// ID of the authenticator created. + public let authenticatorId: [String] +} + +// MARK: - TRecoverUserBody + +public struct TRecoverUserBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The new authenticator to register. + public let authenticator: v1AuthenticatorParamsV2 + /// Unique identifier for the user performing recovery. + public let userId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + authenticator: v1AuthenticatorParamsV2, + userId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.authenticator = authenticator + self.userId = userId + } +} + +// MARK: - TRecoverUserInput + +public struct TRecoverUserInput: Codable, Sendable { + public let body: TRecoverUserBody + + public init( + body: TRecoverUserBody + ) { + self.body = body + } +} + +// MARK: - TRejectActivityResponse + +public struct TRejectActivityResponse: Codable, Sendable { + public let activity: v1Activity +} + +// MARK: - TRejectActivityBody + +public struct TRejectActivityBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// An artifact verifying a User's action. + public let fingerprint: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + fingerprint: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.fingerprint = fingerprint + } +} + +// MARK: - TRejectActivityInput + +public struct TRejectActivityInput: Codable, Sendable { + public let body: TRejectActivityBody + + public init( + body: TRejectActivityBody + ) { + self.body = body + } +} + +// MARK: - TRemoveOrganizationFeatureResponse + +public struct TRemoveOrganizationFeatureResponse: Codable, Sendable { + public let activity: v1Activity + /// Resulting list of organization features. + public let features: [v1Feature] +} + +// MARK: - TRemoveOrganizationFeatureBody + +public struct TRemoveOrganizationFeatureBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Name of the feature to remove + public let name: v1FeatureName + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + name: v1FeatureName + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.name = name + } +} + +// MARK: - TRemoveOrganizationFeatureInput + +public struct TRemoveOrganizationFeatureInput: Codable, Sendable { + public let body: TRemoveOrganizationFeatureBody + + public init( + body: TRemoveOrganizationFeatureBody + ) { + self.body = body + } +} + +// MARK: - TSetOrganizationFeatureResponse + +public struct TSetOrganizationFeatureResponse: Codable, Sendable { + public let activity: v1Activity + /// Resulting list of organization features. + public let features: [v1Feature] +} + +// MARK: - TSetOrganizationFeatureBody + +public struct TSetOrganizationFeatureBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Name of the feature to set + public let name: v1FeatureName + /// Optional value for the feature. Will override existing values if feature is already set. + public let value: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + name: v1FeatureName, + value: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.name = name + self.value = value + } +} + +// MARK: - TSetOrganizationFeatureInput + +public struct TSetOrganizationFeatureInput: Codable, Sendable { + public let body: TSetOrganizationFeatureBody + + public init( + body: TSetOrganizationFeatureBody + ) { + self.body = body + } +} + +// MARK: - TSignRawPayloadResponse + +public struct TSignRawPayloadResponse: Codable, Sendable { + public let activity: v1Activity + /// Component of an ECSDA signature. + public let r: String + /// Component of an ECSDA signature. + public let s: String + /// Component of an ECSDA signature. + public let v: String +} + +// MARK: - TSignRawPayloadBody + +public struct TSignRawPayloadBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8). + public let encoding: v1PayloadEncoding + /// Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032. + public let hashFunction: v1HashFunction + /// Raw unsigned payload to be signed. + public let payload: String + /// A Wallet account address, Private Key address, or Private Key identifier. + public let signWith: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + encoding: v1PayloadEncoding, + hashFunction: v1HashFunction, + payload: String, + signWith: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.encoding = encoding + self.hashFunction = hashFunction + self.payload = payload + self.signWith = signWith + } +} + +// MARK: - TSignRawPayloadInput + +public struct TSignRawPayloadInput: Codable, Sendable { + public let body: TSignRawPayloadBody + + public init( + body: TSignRawPayloadBody + ) { + self.body = body + } +} + +// MARK: - TSignRawPayloadsResponse + +public struct TSignRawPayloadsResponse: Codable, Sendable { + public let activity: v1Activity + public let signatures: [v1SignRawPayloadResult]? +} + +// MARK: - TSignRawPayloadsBody + +public struct TSignRawPayloadsBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8). + public let encoding: v1PayloadEncoding + /// Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032. + public let hashFunction: v1HashFunction + /// An array of raw unsigned payloads to be signed. + public let payloads: [String] + /// A Wallet account address, Private Key address, or Private Key identifier. + public let signWith: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + encoding: v1PayloadEncoding, + hashFunction: v1HashFunction, + payloads: [String], + signWith: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.encoding = encoding + self.hashFunction = hashFunction + self.payloads = payloads + self.signWith = signWith + } +} + +// MARK: - TSignRawPayloadsInput + +public struct TSignRawPayloadsInput: Codable, Sendable { + public let body: TSignRawPayloadsBody + + public init( + body: TSignRawPayloadsBody + ) { + self.body = body + } +} + +// MARK: - TSignTransactionResponse + +public struct TSignTransactionResponse: Codable, Sendable { + public let activity: v1Activity + public let signedTransaction: String +} + +// MARK: - TSignTransactionBody + +public struct TSignTransactionBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A Wallet account address, Private Key address, or Private Key identifier. + public let signWith: String + public let type: v1TransactionType + /// Raw unsigned transaction to be signed + public let unsignedTransaction: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + signWith: String, + type: v1TransactionType, + unsignedTransaction: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.signWith = signWith + self.type = type + self.unsignedTransaction = unsignedTransaction + } +} + +// MARK: - TSignTransactionInput + +public struct TSignTransactionInput: Codable, Sendable { + public let body: TSignTransactionBody + + public init( + body: TSignTransactionBody + ) { + self.body = body + } +} + +// MARK: - TStampLoginResponse + +public struct TStampLoginResponse: Codable, Sendable { + public let activity: v1Activity + /// Signed JWT containing an expiry, public key, session type, user id, and organization id + public let session: String +} + +// MARK: - TStampLoginBody + +public struct TStampLoginBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. + public let expirationSeconds: String? + /// Invalidate all other previously generated Login API keys + public let invalidateExisting: Bool? + /// Client-side public key generated by the user, which will be conditionally added to org data based on the passkey stamp associated with this request + public let publicKey: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + expirationSeconds: String? = nil, + invalidateExisting: Bool? = nil, + publicKey: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.expirationSeconds = expirationSeconds + self.invalidateExisting = invalidateExisting + self.publicKey = publicKey + } +} + +// MARK: - TStampLoginInput + +public struct TStampLoginInput: Codable, Sendable { + public let body: TStampLoginBody + + public init( + body: TStampLoginBody + ) { + self.body = body + } +} + +// MARK: - TUpdateOauth2CredentialResponse + +public struct TUpdateOauth2CredentialResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier of the OAuth 2.0 credential that was updated + public let oauth2CredentialId: String +} + +// MARK: - TUpdateOauth2CredentialBody + +public struct TUpdateOauth2CredentialBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The Client ID issued by the OAuth 2.0 provider + public let clientId: String + /// The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key + public let encryptedClientSecret: String + /// The ID of the OAuth 2.0 credential to update + public let oauth2CredentialId: String + /// The OAuth 2.0 provider + public let provider: v1Oauth2Provider + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + clientId: String, + encryptedClientSecret: String, + oauth2CredentialId: String, + provider: v1Oauth2Provider + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.clientId = clientId + self.encryptedClientSecret = encryptedClientSecret + self.oauth2CredentialId = oauth2CredentialId + self.provider = provider + } +} + +// MARK: - TUpdateOauth2CredentialInput + +public struct TUpdateOauth2CredentialInput: Codable, Sendable { + public let body: TUpdateOauth2CredentialBody + + public init( + body: TUpdateOauth2CredentialBody + ) { + self.body = body + } +} + +// MARK: - TUpdatePolicyResponse + +public struct TUpdatePolicyResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for a given Policy. + public let policyId: String +} + +// MARK: - TUpdatePolicyBody + +public struct TUpdatePolicyBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The condition expression that triggers the Effect (optional). + public let policyCondition: String? + /// The consensus expression that triggers the Effect (optional). + public let policyConsensus: String? + /// The instruction to DENY or ALLOW an activity (optional). + public let policyEffect: v1Effect? + /// Unique identifier for a given Policy. + public let policyId: String + /// Human-readable name for a Policy. + public let policyName: String? + /// Accompanying notes for a Policy (optional). + public let policyNotes: String? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + policyCondition: String? = nil, + policyConsensus: String? = nil, + policyEffect: v1Effect? = nil, + policyId: String, + policyName: String? = nil, + policyNotes: String? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.policyCondition = policyCondition + self.policyConsensus = policyConsensus + self.policyEffect = policyEffect + self.policyId = policyId + self.policyName = policyName + self.policyNotes = policyNotes + } +} + +// MARK: - TUpdatePolicyInput + +public struct TUpdatePolicyInput: Codable, Sendable { + public let body: TUpdatePolicyBody + + public init( + body: TUpdatePolicyBody + ) { + self.body = body + } +} + +// MARK: - TUpdatePrivateKeyTagResponse + +public struct TUpdatePrivateKeyTagResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for a given Private Key Tag. + public let privateKeyTagId: String +} + +// MARK: - TUpdatePrivateKeyTagBody + +public struct TUpdatePrivateKeyTagBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of Private Keys IDs to add this tag to. + public let addPrivateKeyIds: [String] + /// The new, human-readable name for the tag with the given ID. + public let newPrivateKeyTagName: String? + /// Unique identifier for a given Private Key Tag. + public let privateKeyTagId: String + /// A list of Private Key IDs to remove this tag from. + public let removePrivateKeyIds: [String] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + addPrivateKeyIds: [String], + newPrivateKeyTagName: String? = nil, + privateKeyTagId: String, + removePrivateKeyIds: [String] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.addPrivateKeyIds = addPrivateKeyIds + self.newPrivateKeyTagName = newPrivateKeyTagName + self.privateKeyTagId = privateKeyTagId + self.removePrivateKeyIds = removePrivateKeyIds + } +} + +// MARK: - TUpdatePrivateKeyTagInput + +public struct TUpdatePrivateKeyTagInput: Codable, Sendable { + public let body: TUpdatePrivateKeyTagBody + + public init( + body: TUpdatePrivateKeyTagBody + ) { + self.body = body + } +} + +// MARK: - TUpdateRootQuorumResponse + +public struct TUpdateRootQuorumResponse: Codable, Sendable { + public let activity: v1Activity +} + +// MARK: - TUpdateRootQuorumBody + +public struct TUpdateRootQuorumBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The threshold of unique approvals to reach quorum. + public let threshold: Int + /// The unique identifiers of users who comprise the quorum set. + public let userIds: [String] + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + threshold: Int, + userIds: [String] + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.threshold = threshold + self.userIds = userIds + } +} + +// MARK: - TUpdateRootQuorumInput + +public struct TUpdateRootQuorumInput: Codable, Sendable { + public let body: TUpdateRootQuorumBody + + public init( + body: TUpdateRootQuorumBody + ) { + self.body = body + } +} + +// MARK: - TUpdateUserResponse + +public struct TUpdateUserResponse: Codable, Sendable { + public let activity: v1Activity + /// A User ID. + public let userId: String +} + +// MARK: - TUpdateUserBody + +public struct TUpdateUserBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The user's email address. + public let userEmail: String? + /// Unique identifier for a given User. + public let userId: String + /// Human-readable name for a User. + public let userName: String? + /// The user's phone number in E.164 format e.g. +13214567890 + public let userPhoneNumber: String? + /// An updated list of User Tags to apply to this User. This field, if not needed, should be an empty array in your request body. + public let userTagIds: [String]? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + userEmail: String? = nil, + userId: String, + userName: String? = nil, + userPhoneNumber: String? = nil, + userTagIds: [String]? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.userEmail = userEmail + self.userId = userId + self.userName = userName + self.userPhoneNumber = userPhoneNumber + self.userTagIds = userTagIds + } +} + +// MARK: - TUpdateUserInput + +public struct TUpdateUserInput: Codable, Sendable { + public let body: TUpdateUserBody + + public init( + body: TUpdateUserBody + ) { + self.body = body + } +} + +// MARK: - TUpdateUserEmailResponse + +public struct TUpdateUserEmailResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier of the User whose email was updated. + public let userId: String +} + +// MARK: - TUpdateUserEmailBody + +public struct TUpdateUserEmailBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// The user's email address. Setting this to an empty string will remove the user's email. + public let userEmail: String + /// Unique identifier for a given User. + public let userId: String + /// Signed JWT containing a unique id, expiry, verification type, contact + public let verificationToken: String? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + userEmail: String, + userId: String, + verificationToken: String? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.userEmail = userEmail + self.userId = userId + self.verificationToken = verificationToken + } +} + +// MARK: - TUpdateUserEmailInput + +public struct TUpdateUserEmailInput: Codable, Sendable { + public let body: TUpdateUserEmailBody + + public init( + body: TUpdateUserEmailBody + ) { + self.body = body + } +} + +// MARK: - TUpdateUserNameResponse + +public struct TUpdateUserNameResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier of the User whose name was updated. + public let userId: String +} + +// MARK: - TUpdateUserNameBody + +public struct TUpdateUserNameBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Unique identifier for a given User. + public let userId: String + /// Human-readable name for a User. + public let userName: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + userId: String, + userName: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.userId = userId + self.userName = userName + } +} + +// MARK: - TUpdateUserNameInput + +public struct TUpdateUserNameInput: Codable, Sendable { + public let body: TUpdateUserNameBody + + public init( + body: TUpdateUserNameBody + ) { + self.body = body + } +} + +// MARK: - TUpdateUserPhoneNumberResponse + +public struct TUpdateUserPhoneNumberResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier of the User whose phone number was updated. + public let userId: String +} + +// MARK: - TUpdateUserPhoneNumberBody + +public struct TUpdateUserPhoneNumberBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Unique identifier for a given User. + public let userId: String + /// The user's phone number in E.164 format e.g. +13214567890. Setting this to an empty string will remove the user's phone number. + public let userPhoneNumber: String + /// Signed JWT containing a unique id, expiry, verification type, contact + public let verificationToken: String? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + userId: String, + userPhoneNumber: String, + verificationToken: String? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.userId = userId + self.userPhoneNumber = userPhoneNumber + self.verificationToken = verificationToken + } +} + +// MARK: - TUpdateUserPhoneNumberInput + +public struct TUpdateUserPhoneNumberInput: Codable, Sendable { + public let body: TUpdateUserPhoneNumberBody + + public init( + body: TUpdateUserPhoneNumberBody + ) { + self.body = body + } +} + +// MARK: - TUpdateUserTagResponse + +public struct TUpdateUserTagResponse: Codable, Sendable { + public let activity: v1Activity + /// Unique identifier for a given User Tag. + public let userTagId: String +} + +// MARK: - TUpdateUserTagBody + +public struct TUpdateUserTagBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// A list of User IDs to add this tag to. + public let addUserIds: [String] + /// The new, human-readable name for the tag with the given ID. + public let newUserTagName: String? + /// A list of User IDs to remove this tag from. + public let removeUserIds: [String] + /// Unique identifier for a given User Tag. + public let userTagId: String + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + addUserIds: [String], + newUserTagName: String? = nil, + removeUserIds: [String], + userTagId: String + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.addUserIds = addUserIds + self.newUserTagName = newUserTagName + self.removeUserIds = removeUserIds + self.userTagId = userTagId + } +} + +// MARK: - TUpdateUserTagInput + +public struct TUpdateUserTagInput: Codable, Sendable { + public let body: TUpdateUserTagBody + + public init( + body: TUpdateUserTagBody + ) { + self.body = body + } +} + +// MARK: - TUpdateWalletResponse + +public struct TUpdateWalletResponse: Codable, Sendable { + public let activity: v1Activity + /// A Wallet ID. + public let walletId: String +} + +// MARK: - TUpdateWalletBody + +public struct TUpdateWalletBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Unique identifier for a given Wallet. + public let walletId: String + /// Human-readable name for a Wallet. + public let walletName: String? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + walletId: String, + walletName: String? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.walletId = walletId + self.walletName = walletName + } +} + +// MARK: - TUpdateWalletInput + +public struct TUpdateWalletInput: Codable, Sendable { + public let body: TUpdateWalletBody + + public init( + body: TUpdateWalletBody + ) { + self.body = body + } +} + +// MARK: - TVerifyOtpResponse + +public struct TVerifyOtpResponse: Codable, Sendable { + public let activity: v1Activity + /// Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests) + public let verificationToken: String +} + +// MARK: - TVerifyOtpBody + +public struct TVerifyOtpBody: Codable, Sendable { + public let timestampMs: String? + public let organizationId: String? + /// Expiration window (in seconds) indicating how long the verification token is valid for. If not provided, a default of 1 hour will be used. Maximum value is 86400 seconds (24 hours) + public let expirationSeconds: String? + /// OTP sent out to a user's contact (email or SMS) + public let otpCode: String + /// ID representing the result of an init OTP activity. + public let otpId: String + /// Client-side public key generated by the user, which will be added to the JWT response and verified in subsequent requests via a client proof signature + public let publicKey: String? + + public init( + timestampMs: String? = nil, + organizationId: String? = nil, + expirationSeconds: String? = nil, + otpCode: String, + otpId: String, + publicKey: String? = nil + ) { + self.timestampMs = timestampMs + self.organizationId = organizationId + self.expirationSeconds = expirationSeconds + self.otpCode = otpCode + self.otpId = otpId + self.publicKey = publicKey + } +} + +// MARK: - TVerifyOtpInput + +public struct TVerifyOtpInput: Codable, Sendable { + public let body: TVerifyOtpBody + + public init( + body: TVerifyOtpBody + ) { + self.body = body + } +} + +// MARK: - TNOOPCodegenAnchorResponse + +public struct TNOOPCodegenAnchorResponse: Codable, Sendable { + public let activity: v1Activity +} + +// MARK: - TNOOPCodegenAnchorBody + +public struct TNOOPCodegenAnchorBody: Codable, Sendable { + public init() {} +} + +// MARK: - TTestRateLimitsResponse + +public struct TTestRateLimitsResponse: Codable, Sendable { +} + +// MARK: - TTestRateLimitsBody + +public struct TTestRateLimitsBody: Codable, Sendable { + public let organizationId: String? + /// Whether or not to set a limit on this request. + public let isSetLimit: Bool + /// Rate limit to set for org, if is_set_limit is set to true. + public let limit: Int + + public init( + organizationId: String? = nil, + isSetLimit: Bool, + limit: Int + ) { + self.organizationId = organizationId + self.isSetLimit = isSetLimit + self.limit = limit + } +} + +// MARK: - TTestRateLimitsInput + +public struct TTestRateLimitsInput: Codable, Sendable { + public let body: TTestRateLimitsBody + + public init( + body: TTestRateLimitsBody + ) { + self.body = body + } +} + +// MARK: - ProxyTGetAccountResponse + +public struct ProxyTGetAccountResponse: Codable, Sendable { + public let organizationId: String? +} + +// MARK: - ProxyTGetAccountBody + +public struct ProxyTGetAccountBody: Codable, Sendable { + /// Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY' + public let filterType: String + /// The value of the filter to apply for the specified type. For example, a specific email or name string. + public let filterValue: String + /// Signed JWT containing a unique id, expiry, verification type, contact. Used to verify access to PII (email/phone number) when filter_type is 'EMAIL' or 'PHONE_NUMBER'. + public let verificationToken: String? + + public init( + filterType: String, + filterValue: String, + verificationToken: String? = nil + ) { + self.filterType = filterType + self.filterValue = filterValue + self.verificationToken = verificationToken + } +} + +// MARK: - ProxyTGetAccountInput + +public struct ProxyTGetAccountInput: Codable, Sendable { + public let body: ProxyTGetAccountBody + + public init( + body: ProxyTGetAccountBody + ) { + self.body = body + } +} + +// MARK: - ProxyTOAuth2AuthenticateResponse + +public struct ProxyTOAuth2AuthenticateResponse: Codable, Sendable { + /// A Turnkey issued OIDC token to be used with the LoginWithOAuth activity + public let oidcToken: String +} + +// MARK: - ProxyTOAuth2AuthenticateBody + +public struct ProxyTOAuth2AuthenticateBody: Codable, Sendable { + /// The auth_code provided by the OAuth 2.0 to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow + public let authCode: String + /// The client ID registered with the OAuth 2.0 provider + public let clientId: String + /// The code verifier used by OAuth 2.0 PKCE providers + public let codeVerifier: String + /// An optional nonce used by the client to prevent replay/substitution of an ID token + public let nonce: String? + /// The OAuth 2.0 provider to authenticate with + public let provider: v1Oauth2Provider + /// The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider + public let redirectUri: String + + public init( + authCode: String, + clientId: String, + codeVerifier: String, + nonce: String? = nil, + provider: v1Oauth2Provider, + redirectUri: String + ) { + self.authCode = authCode + self.clientId = clientId + self.codeVerifier = codeVerifier + self.nonce = nonce + self.provider = provider + self.redirectUri = redirectUri + } +} + +// MARK: - ProxyTOAuth2AuthenticateInput + +public struct ProxyTOAuth2AuthenticateInput: Codable, Sendable { + public let body: ProxyTOAuth2AuthenticateBody + + public init( + body: ProxyTOAuth2AuthenticateBody + ) { + self.body = body + } +} + +// MARK: - ProxyTOAuthLoginResponse + +public struct ProxyTOAuthLoginResponse: Codable, Sendable { + /// Signed JWT containing an expiry, public key, session type, user id, and organization id + public let session: String +} + +// MARK: - ProxyTOAuthLoginBody + +public struct ProxyTOAuthLoginBody: Codable, Sendable { + /// Invalidate all other previously generated Login API keys + public let invalidateExisting: Bool? + /// Base64 encoded OIDC token + public let oidcToken: String + /// Unique identifier for a given Organization. If provided, this organization id will be used directly. If omitted, uses the OIDC token to look up the associated organization id. + public let organizationId: String? + /// Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request + public let publicKey: String + + public init( + invalidateExisting: Bool? = nil, + oidcToken: String, + organizationId: String? = nil, + publicKey: String + ) { + self.invalidateExisting = invalidateExisting + self.oidcToken = oidcToken + self.organizationId = organizationId + self.publicKey = publicKey + } +} + +// MARK: - ProxyTOAuthLoginInput + +public struct ProxyTOAuthLoginInput: Codable, Sendable { + public let body: ProxyTOAuthLoginBody + + public init( + body: ProxyTOAuthLoginBody + ) { + self.body = body + } +} + +// MARK: - ProxyTInitOtpResponse + +public struct ProxyTInitOtpResponse: Codable, Sendable { + /// Unique identifier for an OTP authentication + public let otpId: String +} + +// MARK: - ProxyTInitOtpBody + +public struct ProxyTInitOtpBody: Codable, Sendable { + /// Email or phone number to send the OTP code to + public let contact: String + /// Enum to specifiy whether to send OTP via SMS or email + public let otpType: String + + public init( + contact: String, + otpType: String + ) { + self.contact = contact + self.otpType = otpType + } +} + +// MARK: - ProxyTInitOtpInput + +public struct ProxyTInitOtpInput: Codable, Sendable { + public let body: ProxyTInitOtpBody + + public init( + body: ProxyTInitOtpBody + ) { + self.body = body + } +} + +// MARK: - ProxyTOtpLoginResponse + +public struct ProxyTOtpLoginResponse: Codable, Sendable { + /// Signed JWT containing an expiry, public key, session type, user id, and organization id + public let session: String +} + +// MARK: - ProxyTOtpLoginBody + +public struct ProxyTOtpLoginBody: Codable, Sendable { + /// Optional signature associated with the public key passed into the verification step. This must be a hex-encoded ECDSA signature over the verification token. Only required if a public key was provided during the verification step. + public let clientSignature: String? + /// Invalidate all other previously generated Login API keys + public let invalidateExisting: Bool? + /// Unique identifier for a given Organization. If provided, this organization id will be used directly. If omitted, uses the verification token to look up the verified sub-organization based on the contact and verification type. + public let organizationId: String? + /// Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token + public let publicKey: String + /// Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests) + public let verificationToken: String + + public init( + clientSignature: String? = nil, + invalidateExisting: Bool? = nil, + organizationId: String? = nil, + publicKey: String, + verificationToken: String + ) { + self.clientSignature = clientSignature + self.invalidateExisting = invalidateExisting + self.organizationId = organizationId + self.publicKey = publicKey + self.verificationToken = verificationToken + } +} + +// MARK: - ProxyTOtpLoginInput + +public struct ProxyTOtpLoginInput: Codable, Sendable { + public let body: ProxyTOtpLoginBody + + public init( + body: ProxyTOtpLoginBody + ) { + self.body = body + } +} + +// MARK: - ProxyTVerifyOtpResponse + +public struct ProxyTVerifyOtpResponse: Codable, Sendable { + /// Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests) + public let verificationToken: String +} + +// MARK: - ProxyTVerifyOtpBody + +public struct ProxyTVerifyOtpBody: Codable, Sendable { + /// OTP sent out to a user's contact (email or SMS) + public let otpCode: String + /// ID representing the result of an init OTP activity. + public let otpId: String + /// Client-side public key generated by the user, which will be added to the JWT response and verified in subsequent requests via a client proof signature + public let publicKey: String? + + public init( + otpCode: String, + otpId: String, + publicKey: String? = nil + ) { + self.otpCode = otpCode + self.otpId = otpId + self.publicKey = publicKey + } +} + +// MARK: - ProxyTVerifyOtpInput + +public struct ProxyTVerifyOtpInput: Codable, Sendable { + public let body: ProxyTVerifyOtpBody + + public init( + body: ProxyTVerifyOtpBody + ) { + self.body = body + } +} + +// MARK: - ProxyTSignupResponse + +public struct ProxyTSignupResponse: Codable, Sendable { + /// A list of app proofs generated by enclaves during activity execution, providing verifiable attestations of performed operations. + public let appProofs: [v1AppProof]? + public let organizationId: String + /// Root user ID created for this sub-organization + public let userId: String + /// Wallet created for the sub-organization, if provided in the request + public let wallet: v1WalletResult? +} + +// MARK: - ProxyTSignupBody + +public struct ProxyTSignupBody: Codable, Sendable { + /// A list of API Key parameters. This field, if not needed, should be an empty array in your request body. + public let apiKeys: [v1ApiKeyParamsV2] + /// A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. + public let authenticators: [v1AuthenticatorParamsV2] + /// A list of Oauth providers. This field, if not needed, should be an empty array in your request body. + public let oauthProviders: [v1OauthProviderParams] + public let organizationName: String? + public let userEmail: String? + public let userName: String? + public let userPhoneNumber: String? + public let userTag: String? + public let verificationToken: String? + /// The wallet to create for the sub-organization + public let wallet: v1WalletParams? + + public init( + apiKeys: [v1ApiKeyParamsV2], + authenticators: [v1AuthenticatorParamsV2], + oauthProviders: [v1OauthProviderParams], + organizationName: String? = nil, + userEmail: String? = nil, + userName: String? = nil, + userPhoneNumber: String? = nil, + userTag: String? = nil, + verificationToken: String? = nil, + wallet: v1WalletParams? = nil + ) { + self.apiKeys = apiKeys + self.authenticators = authenticators + self.oauthProviders = oauthProviders + self.organizationName = organizationName + self.userEmail = userEmail + self.userName = userName + self.userPhoneNumber = userPhoneNumber + self.userTag = userTag + self.verificationToken = verificationToken + self.wallet = wallet + } +} + +// MARK: - ProxyTSignupInput + +public struct ProxyTSignupInput: Codable, Sendable { + public let body: ProxyTSignupBody + + public init( + body: ProxyTSignupBody + ) { + self.body = body + } +} + +// MARK: - ProxyTGetWalletKitConfigResponse + +public struct ProxyTGetWalletKitConfigResponse: Codable, Sendable { + /// List of enabled authentication providers (e.g., 'facebook', 'google', 'apple', 'email', 'sms', 'passkey', 'wallet') + public let enabledProviders: [String] + /// Mapping of social login providers to their OAuth client IDs. + public let oauthClientIds: [String: String]? + /// OAuth redirect URL to be used for social login flows. + public let oauthRedirectUrl: String? + /// The organization ID this configuration applies to + public let organizationId: String + public let otpAlphanumeric: Bool? + public let otpLength: String? + /// Session expiration duration in seconds + public let sessionExpirationSeconds: String +} + +// MARK: - ProxyTGetWalletKitConfigBody + +public struct ProxyTGetWalletKitConfigBody: Codable, Sendable { + + public init() {} +} + +// MARK: - ProxyTGetWalletKitConfigInput + +public struct ProxyTGetWalletKitConfigInput: Codable, Sendable { + public let body: ProxyTGetWalletKitConfigBody + + public init( + body: ProxyTGetWalletKitConfigBody + ) { + self.body = body + } +} diff --git a/Sources/TurnkeyTypes/README.md b/Sources/TurnkeyTypes/README.md new file mode 100644 index 00000000..bf17c64c --- /dev/null +++ b/Sources/TurnkeyTypes/README.md @@ -0,0 +1,19 @@ +# TurnkeyTypes + +Auto-generated Swift types from Turnkey's Swagger/OpenAPI specifications. + +## Code Generation + +Types are auto-generated from Swagger specifications. To regenerate: + +```bash +cd Scripts && make generate +``` + +See [Scripts README](../../Scripts/README.md) for details. + +--- + +## Generated Files + +- `Generated/Types.swift` - All API request/response types with `Sendable` conformance